app.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 (5)
  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 0x01030000 //驱动层版本号V1.3.0.0
  36. #define APPSWVERSION 0x01020102
  37. //--------------------------------------------------------------------------------
  38. #define APP_CONFIG_FILE_LATEST_VERSION 0
  39. #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
  40. typedef struct AppNVMDataType
  41. {
  42. BOOL appDataModify; //数据更改标志位
  43. UINT8 battSN[BATT_SN_LEN]; //电池SN号码
  44. BOOL isBattLocked; //0:not locked; 1:locked
  45. UINT8 chargEndWorkTime; //the unit is min
  46. UINT8 wakeupWorkTime; //the unit is min
  47. UINT8 sleepTime;
  48. UINT16 HwVersion;
  49. UINT32 BLSwVersion;
  50. UINT32 DrvSwVersion;
  51. UINT32 AppSwVersion;
  52. UINT8 EOLState;
  53. }AppNVMDataType;
  54. typedef struct AppConfigHeader
  55. {
  56. UINT16 fileBodySize; //file body size, not include size of header;
  57. UINT8 version;
  58. UINT8 checkSum;
  59. }AppConfigHeader;
  60. typedef struct _UartAnswerMsg
  61. {
  62. bool UartFlag;
  63. UINT8 dataPtr[8];
  64. UINT16 len;
  65. }UartAnswerMsgType;
  66. typedef enum
  67. {
  68. APP_INIT_STATE,
  69. APP_DEACTIVE_STATE,
  70. APP_IPREADY_STATE,
  71. APP_REPORT_STATE,
  72. APP_IDLE_STATE,
  73. APP_WAIT_STATE
  74. } appRunningState_t;
  75. //uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif /* APP_H */