app.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 BAT4830
  18. //#define BAT6060
  19. #ifdef BAT4830
  20. #define BATT_CELL_VOL_NUM (14)
  21. #define BATT_TEMP_NUM (3)
  22. #define BMS_INFO (1)
  23. #define BATT_OTHER_TEMP_NUM (2)
  24. #elif defined BAT6060
  25. #define BATT_CELL_VOL_NUM (17)
  26. #define BATT_TEMP_NUM (5)
  27. #define BMS_INFO (2)
  28. #define BATT_OTHER_TEMP_NUM (2)
  29. #endif
  30. #define BATT_CELL_VOL_NUM_2 (BATT_CELL_VOL_NUM*2)
  31. #define BATT_SN_LEN 17
  32. #define HWVERSION 0x0102 //硬件主版本,现为V1.2板
  33. #define BLSWVERSION 0x01020000 //BootLoader版本号V1.2.0.0
  34. #define DRVSWVERSION 0x01030000 //驱动层版本号V1.3.0.0
  35. #define APPSWVERSION 0x01020101
  36. #define APP_CONFIG_FILE_LATEST_VERSION 1
  37. #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
  38. //--------------------------------------------------------------------------------
  39. typedef struct AppNVMDataType
  40. {
  41. BOOL appDataModify; //数据更改标志位
  42. UINT8 battSN[BATT_SN_LEN]; //电池SN号码
  43. BOOL isBattLocked; //0:not locked; 1:locked
  44. UINT8 chargEndWorkTime; //the unit is min
  45. UINT8 wakeupWorkTime; //the unit is min
  46. UINT8 sleepTime;
  47. UINT16 HwVersion;
  48. UINT32 BLSwVersion;
  49. UINT32 DrvSwVersion;
  50. UINT32 AppSwVersion;
  51. }AppNVMDataType;
  52. typedef struct AppConfigHeader
  53. {
  54. UINT16 fileBodySize; //file body size, not include size of header;
  55. UINT8 version;
  56. UINT8 checkSum;
  57. }AppConfigHeader;
  58. typedef struct _UartAnswerMsg
  59. {
  60. bool UartFlag;
  61. UINT8 dataPtr[8];
  62. UINT16 len;
  63. }UartAnswerMsgType;
  64. typedef enum
  65. {
  66. APP_INIT_STATE,
  67. APP_DEACTIVE_STATE,
  68. APP_IPREADY_STATE,
  69. APP_REPORT_STATE,
  70. APP_IDLE_STATE,
  71. APP_WAIT_STATE
  72. } appRunningState_t;
  73. //uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* APP_H */