/**************************************************************************** * * Copy right: 2017-, Copyrigths of EigenComm Ltd. * File name: app.h * Description: EC616 onenet demo entry header file * History: Rev1.0 2018-07-12 * ****************************************************************************/ #include "commontypedef.h" #ifndef APP_H #define APP_H #ifdef __cplusplus extern "C" { #endif //全局定义声明区 #define BAT4830 #ifdef BAT4830 #define BATT_CELL_VOL_NUM (14) #define BATT_TEMP_NUM (3) #else #define BATT_CELL_VOL_NUM (17) #define BATT_TEMP_NUM (5) #endif #define BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2) #define BATT_SN_LEN 17 #define SWVERSION 0xA21 #define HWVERSION 0xB22 #define APP_CONFIG_FILE_LATEST_VERSION 1 #define APP_CONFIG_FILE_NAME "qxappconfig.nvm" //-------------------------------------------------------------------------------- typedef struct AppNVMDataType { BOOL appDataModify; //数据更改标志位 UINT8 battSN[BATT_SN_LEN]; //电池SN号码 BOOL isBattLocked; //0:not locked; 1:locked UINT8 chargEndWorkTime; //the unit is min UINT8 wakeupWorkTime; //the unit is min UINT8 sleepTime; UINT16 HwVersion; UINT16 SwVersion; }AppNVMDataType; typedef struct AppConfigHeader { UINT16 fileBodySize; //file body size, not include size of header; UINT8 version; UINT8 checkSum; }AppConfigHeader; typedef struct _UartAnswerMsg { bool UartFlag; UINT8 dataPtr[8]; UINT16 len; }UartAnswerMsgType; typedef enum { APP_INIT_STATE, APP_DEACTIVE_STATE, APP_IPREADY_STATE, APP_REPORT_STATE, APP_IDLE_STATE, APP_WAIT_STATE } appRunningState_t; //uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len); #ifdef __cplusplus } #endif #endif /* APP_H */