app.h 2.1 KB

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