123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #include "commontypedef.h"
- #ifndef APP_H
- #define APP_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define BMS_MANUFACTURE (2)
- #define DATA_MODULE_TYPE (1)
- #define BMS_INFO (3)
- #define EOLSTATE (0)
- #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 BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2)
- #define HWVERSION 0x0102
- #define BLSWVERSION 0x01020000
- #define DRVSWVERSION 0x01050000
- #define APPSWVERSION 0x02030003
- #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];
- BOOL isBattLocked;
- UINT8 chargEndWorkTime;
- UINT8 wakeupWorkTime;
- UINT8 sleepTime;
- UINT16 HwVersion;
- UINT32 BLSwVersion;
- UINT32 DrvSwVersion;
- UINT32 AppSwVersion;
- UINT8 EOLState;
- }AppNVMDataType;
- typedef struct AppConfigHeader
- {
- UINT16 fileBodySize;
- 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;
- typedef struct AppDataType
- {
- BOOL appDataModify;
- UINT8 BmsChrgInfoSendFreq;
- UINT8 BmsDisChrgInfoSendFreq;
- UINT8 GpsChrgInfoSendFreq;
- UINT8 GpsDisChrgInfoSendFreq;
- INT8 BattCurrentNegFlag;
- UINT32 CumulativeCapacity;
- UINT32 AccMileage;
- }AppDataBody;
- typedef struct _AppDataHeader
- {
- UINT16 fileBodySize;
- UINT8 checkSum;
- }AppDataHeader;
- #ifdef __cplusplus
- }
- #endif
- #endif
|