/**************************************************************************** * * Copy right: 2021-, Copyrigths of RLWL Ltd. * File name: app.h * Description: App Config H file * History: Rev3.0 2021-07-06 * ****************************************************************************/ #define BMS_MANUFACTURE (2) //BMS制造商表示1-超力源,2-美顺 #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1 #define BMS_INFO (1) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455 #define EOLSTATE (0) //1标识下线检测跳过,使用默认值 #define DEFAULT_SN "RLTEST00000000001" #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 (4) #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) #elif BMS_INFO==3 #define BATT_CELL_VOL_NUM (20) #define BATT_TEMP_NUM (4) #define BATT_OTHER_TEMP_NUM (2) #endif #endif #define NB_OTHER_TEMP_NUM (4) //NB采集的温度个数 #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 0x01050000 //驱动层版本号V1.4.0.0 驱动层1.5.0.0,增加了三轴 #define APPSWVERSION 0x03000000 //数据模块软件版本号 #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 //declear struct vars 结构体变量定义 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 AppDataType { BOOL appDataModify; //数据更改标志位 UINT8 BmsChrgInfoSendFreq; UINT8 BmsDisChrgInfoSendFreq; UINT8 GpsChrgInfoSendFreq; UINT8 GpsDisChrgInfoSendFreq; INT8 BattCurrentNegFlag; UINT32 CumulativeCapacity; UINT32 AccMileage; UINT16 SysReStart; }AppDataBody; typedef struct _AppDataHeader { UINT16 fileBodySize; //file body size, not include size of header; UINT8 checkSum; }AppDataHeader; typedef struct _UartAnswerMsg { BOOL UartFlag; UINT8 dataPtr[8]; UINT16 len; }UartAnswerMsgType;