/**************************************************************************** * * 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 BMS_MANUFACTURE (1) //BMS制造商表示1-超力源,2-美顺 #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1 #define BMS_INFO (2) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455 #if BMS_MANUFACTURE==1 #if BMS_INFO==1 #define BATT_CELL_VOL_NUM (14) #define BATT_TEMP_NUM (3) #define BATT_OTHER_TEMP_NUM (2) #elif BMS_INFO==2 #define BATT_CELL_VOL_NUM (17) #define BATT_TEMP_NUM (5) #define BATT_OTHER_TEMP_NUM (2) #endif #elif BMS_MANUFACTURE==2 #if BMS_INFO==1 #define BATT_CELL_VOL_NUM (20) #define BATT_TEMP_NUM (3) #define BATT_OTHER_TEMP_NUM (2) #elif BMS_INFO==2 #define BATT_CELL_VOL_NUM (17) #define BATT_TEMP_NUM (4) #define BATT_OTHER_TEMP_NUM (2) #endif #endif #define BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2) #define HWVERSION 0x0102 //硬件主版本,现为V1.2板 #define BLSWVERSION 0x01020000 //BootLoader版本号V1.2.0.0 #define DRVSWVERSION 0x01040000 //驱动层版本号V1.4.0.0 #define APPSWVERSION 0x01030000 //#define APPSWVERSION 0x02000007 //-------------------------------------------------------------------------------- #define APP_CONFIG_FILE_LATEST_VERSION 0 #define APP_CONFIG_FILE_NAME "qxappconfig.nvm" #define APP_DATAINFO_FILE_NAME "qxappDataInfo.nvm" #define BATT_SN_LEN 17 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; UINT32 BLSwVersion; UINT32 DrvSwVersion; UINT32 AppSwVersion; UINT8 EOLState; }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); //累计数据结构体 typedef struct AppDataType { BOOL appDataModify; //数据更改标志位 UINT8 BmsChrgInfoSendFreq; UINT8 BmsDisChrgInfoSendFreq; UINT8 GpsChrgInfoSendFreq; UINT8 GpsDisChrgInfoSendFreq; UINT32 CumulativeCapacity; }AppDataBody; typedef struct _AppDataHeader { UINT16 fileBodySize; //file body size, not include size of header; UINT8 checkSum; }AppDataHeader; #ifdef __cplusplus } #endif #endif /* APP_H */