app.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. //#define BAT4830
  19. #define BAT6060 //电池型号变化需要更改
  20. #ifdef BAT4830
  21. #define BATT_CELL_VOL_NUM (14)
  22. #define BATT_TEMP_NUM (3)
  23. #define BMS_INFO (1) //1BMS信息表示4830
  24. #define BATT_OTHER_TEMP_NUM (2)
  25. #elif defined BAT6060
  26. #define BATT_CELL_VOL_NUM (17)
  27. #define BATT_TEMP_NUM (4)
  28. #define BMS_INFO (2) //2-BMS信息表示6060
  29. #define BATT_OTHER_TEMP_NUM (2)
  30. #endif
  31. #define BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2)
  32. #define BATT_SN_LEN 17
  33. #define HWVERSION 0x0102 //硬件主版本,现为V1.2板
  34. #define BLSWVERSION 0x01020000 //BootLoader版本号V1.2.0.0
  35. #define DRVSWVERSION 0x01040000 //驱动层版本号V1.4.0.0
  36. //#define APPSWVERSION 0x0102011E
  37. #define APPSWVERSION 0x02000003
  38. //--------------------------------------------------------------------------------
  39. #define APP_CONFIG_FILE_LATEST_VERSION 0
  40. #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
  41. #define APP_DATAINFO_FILE_NAME "qxappDataInfo.nvm"
  42. typedef struct AppNVMDataType
  43. {
  44. BOOL appDataModify; //数据更改标志位
  45. UINT8 battSN[BATT_SN_LEN]; //电池SN号码
  46. BOOL isBattLocked; //0:not locked; 1:locked
  47. UINT8 chargEndWorkTime; //the unit is min
  48. UINT8 wakeupWorkTime; //the unit is min
  49. UINT8 sleepTime;
  50. UINT16 HwVersion;
  51. UINT32 BLSwVersion;
  52. UINT32 DrvSwVersion;
  53. UINT32 AppSwVersion;
  54. UINT8 EOLState;
  55. }AppNVMDataType;
  56. typedef struct AppConfigHeader
  57. {
  58. UINT16 fileBodySize; //file body size, not include size of header;
  59. UINT8 version;
  60. UINT8 checkSum;
  61. }AppConfigHeader;
  62. typedef struct _UartAnswerMsg
  63. {
  64. bool UartFlag;
  65. UINT8 dataPtr[8];
  66. UINT16 len;
  67. }UartAnswerMsgType;
  68. typedef enum
  69. {
  70. APP_INIT_STATE,
  71. APP_DEACTIVE_STATE,
  72. APP_IPREADY_STATE,
  73. APP_REPORT_STATE,
  74. APP_IDLE_STATE,
  75. APP_WAIT_STATE
  76. } appRunningState_t;
  77. //uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  78. //累计数据结构体
  79. typedef struct AppDataType
  80. {
  81. BOOL appDataModify; //数据更改标志位
  82. UINT8 BmsChrgInfoSendFreq;
  83. UINT8 BmsDisChrgInfoSendFreq;
  84. UINT8 GpsChrgInfoSendFreq;
  85. UINT8 GpsDisChrgInfoSendFreq;
  86. UINT32 CumulativeCapacity;
  87. }AppDataBody;
  88. typedef struct _AppDataHeader
  89. {
  90. UINT16 fileBodySize; //file body size, not include size of header;
  91. UINT8 checkSum;
  92. }AppDataHeader;
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96. #endif /* APP_H */