#ifndef API_GLOBAL__H
#define API_GLOBAL__H

#include <avr/pgmspace.h>

#include "api_define.h"

extern char decrypt_uartString[BUFFER_SIZE];
extern uint8_t twiData[8];
extern char temp_twiString[BUFFER_SIZE];/*temporary variable for storage received TWIS data*/
extern char twiString[BUFFER_SIZE];/*variable for storage received TWIS data*/
extern char store_twiData[BUFFER_SIZE];


extern char setParameter[MAX_PARAMETER][MAX_LENGTH_PARAMETER]; /*storage of cut string */
extern char *ptr_setParameter[MAX_PARAMETER];
extern char uart_message_string[BUFFER_SIZE];
extern char message[BUFFER_SIZE];
extern char uartString[BUFFER_SIZE]; /* variable for storage received a complete string via UART */

extern uint8_t twi_errorCode; /* error code for I2C-communication */
extern uint8_t general_errorCode; /*general error code */
extern uint8_t mailbox_errorCode; /* error code for Message Object Block */
extern uint8_t uart_errorCode; /* error code for UART-communication */

extern volatile unsigned char uartReady;/*variable for UART Interrupt*/
extern volatile unsigned char twiReady;/*variable for Uart Interrupt*/
extern unsigned char nextCharPos;/* variable for the storage of data in serial string variable */





extern const uint8_t serial_error_number[] ;
extern const char *serial_error[] PROGMEM;

extern const uint8_t twi_error_number[];
extern const char *twi_error[] PROGMEM;

extern const uint8_t mob_error_number[] ;
extern const char *mob_error[] PROGMEM;

extern const uint16_t general_error_number[];
extern const char *general_error[] PROGMEM;

extern char currentCommandKeyword[MAX_LENGTH_KEYWORD];/*variable to store current command keyword e.g. "SEND"*/
extern char currentResponseKeyword[MAX_LENGTH_KEYWORD];/*variable to store current command keyword e.g. "RECV"*/


/*variable to store values*/
extern char tmp_str[BUFFER_SIZE];


extern uint8_t debug;
extern uint32_t debugMask;

enum debugLevels
{
   noDebug = 0,
   verboseDebug,
   eventDebug,
   eventDebugVerbose,
   periodicDebug,
   levelsDebug_MAXIMUM_INDEX
};

enum debugSystems
{
      debugMain,
      debugUART, 
     //debugTWI,
      debugTIMER0,
      debugTIMER1,
      debugTIMER0A,
      debugTIMER0AScheduler,
      debugRELAY,
      debugCommandKey,  
      debugDecrypt,
      debugDEBUG,
    
      debugSHOW,
    
      debugSystems_MAXIMUM_INDEX
};



#endif

