AppConfig.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /****************************************************************************
  2. *
  3. * Copy right: 2021-, Copyrigths of RLWL Ltd.
  4. * File name: app.h
  5. * Description: App Config H file
  6. * History: Rev3.0 2021-07-06
  7. *
  8. ****************************************************************************/
  9. #define BMS_MANUFACTURE (2) //BMS制造商表示1-超力源,2-美顺
  10. #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1
  11. #define BMS_INFO (1) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455
  12. #define EOLSTATE (0) //1标识下线检测跳过,使用默认值
  13. #define DEFAULT_SN "RLTEST00000000001"
  14. #if BMS_MANUFACTURE==1
  15. #if BMS_INFO==1
  16. #define BATT_CELL_VOL_NUM (14)
  17. #define BATT_TEMP_NUM (3)
  18. #define BATT_OTHER_TEMP_NUM (2)
  19. #elif BMS_INFO==2
  20. #define BATT_CELL_VOL_NUM (17)
  21. #define BATT_TEMP_NUM (4)
  22. #define BATT_OTHER_TEMP_NUM (2)
  23. #endif
  24. #elif BMS_MANUFACTURE==2
  25. #if BMS_INFO==1
  26. #define BATT_CELL_VOL_NUM (20)
  27. #define BATT_TEMP_NUM (3)
  28. #define BATT_OTHER_TEMP_NUM (2)
  29. #elif BMS_INFO==2
  30. #define BATT_CELL_VOL_NUM (17)
  31. #define BATT_TEMP_NUM (4)
  32. #define BATT_OTHER_TEMP_NUM (2)
  33. #elif BMS_INFO==3
  34. #define BATT_CELL_VOL_NUM (20)
  35. #define BATT_TEMP_NUM (4)
  36. #define BATT_OTHER_TEMP_NUM (2)
  37. #endif
  38. #endif
  39. #define NB_OTHER_TEMP_NUM (4) //NB采集的温度个数
  40. #define BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2)
  41. #define HWVERSION 0x0102 //硬件主版本,现为V1.2板
  42. #define BLSWVERSION 0x01020000 //BootLoader版本号V1.2.0.0
  43. #define DRVSWVERSION 0x01050000 //驱动层版本号V1.4.0.0 驱动层1.5.0.0,增加了三轴
  44. #define APPSWVERSION 0x03000000 //数据模块软件版本号
  45. #define APP_CONFIG_FILE_LATEST_VERSION 0
  46. #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
  47. #define APP_DATAINFO_FILE_NAME "qxappDataInfo.nvm"
  48. #define BATT_SN_LEN 17
  49. //declear struct vars 结构体变量定义
  50. typedef struct AppNVMDataType
  51. {
  52. BOOL appDataModify; //数据更改标志位
  53. UINT8 battSN[BATT_SN_LEN]; //电池SN号码
  54. BOOL isBattLocked; //电池锁定状态0:not locked; 1:locked
  55. UINT8 chargEndWorkTime; //the unit is min 充电结束持续发送时间
  56. UINT8 wakeupWorkTime; //the unit is min 唤醒工作时间
  57. UINT8 sleepTime; //睡眠时间
  58. UINT16 HwVersion;
  59. UINT32 BLSwVersion;
  60. UINT32 DrvSwVersion;
  61. UINT32 AppSwVersion;
  62. UINT8 EOLState; //下线检测状态
  63. }AppNVMDataType;
  64. typedef struct AppConfigHeader
  65. {
  66. UINT16 fileBodySize; //file body size, not include size of header;
  67. UINT8 version;
  68. UINT8 checkSum;
  69. }AppConfigHeader;
  70. typedef struct AppDataType
  71. {
  72. BOOL appDataModify; //数据更改标志位
  73. UINT8 BmsChrgInfoSendFreq;
  74. UINT8 BmsDisChrgInfoSendFreq;
  75. UINT8 GpsChrgInfoSendFreq;
  76. UINT8 GpsDisChrgInfoSendFreq;
  77. INT8 BattCurrentNegFlag;
  78. UINT32 CumulativeCapacity;
  79. UINT32 AccMileage;
  80. UINT16 SysReStart;
  81. }AppDataBody;
  82. typedef struct _AppDataHeader
  83. {
  84. UINT16 fileBodySize; //file body size, not include size of header;
  85. UINT8 checkSum;
  86. }AppDataHeader;
  87. typedef struct _UartAnswerMsg
  88. {
  89. BOOL UartFlag;
  90. UINT8 dataPtr[8];
  91. UINT16 len;
  92. }UartAnswerMsgType;