app.h.orig 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /****************************************************************************
  2. *
  3. * Copy right: 2017-, Copyrigths of EigenComm Ltd.
  4. * File name: app.h
  5. * Description: EC616 onenet demo entry header file
  6. * History: Rev1.0 2018-07-12
  7. *
  8. ****************************************************************************/
  9. #include "commontypedef.h"
  10. #ifndef APP_H
  11. #define APP_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. //全局定义声明区
  16. #define BMS_MANUFACTURE (1) //BMS制造商表示1-超力源,2-美顺
  17. #define DATA_MODULE_TYPE (1) //1表示NB模块,2表示4G cat1
  18. <<<<<<< HEAD
  19. #define BMS_INFO (2) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺6455
  20. =======
  21. #define BMS_INFO (3) //1-1表示超力源4830,1-2表示超力源6060,2-1表示美顺MLS,2-2表示美顺MWL,2-3表示美顺MGM
  22. >>>>>>> V2-V2300
  23. #define EOLSTATE (0) //1标识下线检测跳过,使用默认值
  24. #if BMS_MANUFACTURE==1
  25. #if BMS_INFO==1
  26. #define BATT_CELL_VOL_NUM (14)
  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. #endif
  34. #elif BMS_MANUFACTURE==2
  35. #if BMS_INFO==1
  36. #define BATT_CELL_VOL_NUM (20)
  37. #define BATT_TEMP_NUM (3)
  38. #define BATT_OTHER_TEMP_NUM (2)
  39. #elif BMS_INFO==2
  40. #define BATT_CELL_VOL_NUM (17)
  41. #define BATT_TEMP_NUM (4)
  42. #define BATT_OTHER_TEMP_NUM (2)
  43. #elif BMS_INFO==3
  44. #define BATT_CELL_VOL_NUM (20)
  45. #define BATT_TEMP_NUM (4)
  46. #define BATT_OTHER_TEMP_NUM (2)
  47. #endif
  48. #endif
  49. #define NB_OTHER_TEMP_NUM (4) //NB采集的温度个数
  50. #define BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2)
  51. #define HWVERSION 0x0102 //硬件主版本,现为V1.2板
  52. #define BLSWVERSION 0x01020000 //BootLoader版本号V1.2.0.0
  53. #define DRVSWVERSION 0x01050000 //驱动层版本号V1.4.0.0 驱动层1.5.0.0,增加了三轴
  54. //#define APPSWVERSION 0x01020209
  55. <<<<<<< HEAD
  56. #define APPSWVERSION 0x02000108
  57. // #define APPSWVERSION 0x0201000E
  58. =======
  59. #define APPSWVERSION 0x02030010
  60. //#define APPSWVERSION 0x0201000E
  61. >>>>>>> V2-V2300
  62. //--------------------------------------------------------------------------------
  63. #define APP_CONFIG_FILE_LATEST_VERSION 0
  64. #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
  65. #define APP_DATAINFO_FILE_NAME "qxappDataInfo.nvm"
  66. #define BATT_SN_LEN 17
  67. typedef struct AppNVMDataType
  68. {
  69. BOOL appDataModify; //数据更改标志位
  70. UINT8 battSN[BATT_SN_LEN]; //电池SN号码
  71. BOOL isBattLocked; //0:not locked; 1:locked
  72. UINT8 chargEndWorkTime; //the unit is min
  73. UINT8 wakeupWorkTime; //the unit is min
  74. UINT8 sleepTime;
  75. UINT16 HwVersion;
  76. UINT32 BLSwVersion;
  77. UINT32 DrvSwVersion;
  78. UINT32 AppSwVersion;
  79. UINT8 EOLState;
  80. }AppNVMDataType;
  81. typedef struct AppConfigHeader
  82. {
  83. UINT16 fileBodySize; //file body size, not include size of header;
  84. UINT8 version;
  85. UINT8 checkSum;
  86. }AppConfigHeader;
  87. typedef struct _UartAnswerMsg
  88. {
  89. BOOL UartFlag;
  90. UINT8 dataPtr[8];
  91. UINT16 len;
  92. }UartAnswerMsgType;
  93. typedef enum
  94. {
  95. APP_INIT_STATE,
  96. APP_DEACTIVE_STATE,
  97. APP_IPREADY_STATE,
  98. APP_REPORT_STATE,
  99. APP_IDLE_STATE,
  100. APP_WAIT_STATE
  101. } appRunningState_t;
  102. //uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  103. //累计数据结构体
  104. typedef struct AppDataType
  105. {
  106. BOOL appDataModify; //数据更改标志位
  107. UINT8 BmsChrgInfoSendFreq;
  108. UINT8 BmsDisChrgInfoSendFreq;
  109. UINT8 GpsChrgInfoSendFreq;
  110. UINT8 GpsDisChrgInfoSendFreq;
  111. INT8 BattCurrentNegFlag;
  112. UINT32 CumulativeCapacity;
  113. UINT32 AccMileage;
  114. UINT16 SysReStart;
  115. UINT8 RelayControl;
  116. }AppDataBody;
  117. typedef struct _AppDataHeader
  118. {
  119. UINT16 fileBodySize; //file body size, not include size of header;
  120. UINT8 checkSum;
  121. }AppDataHeader;
  122. #ifdef __cplusplus
  123. }
  124. #endif
  125. #endif /* APP_H */