app.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 SWVERSION 0xA21
  27. #define HWVERSION 0xB22
  28. #define APP_CONFIG_FILE_LATEST_VERSION 1
  29. #define APP_CONFIG_FILE_NAME "qxappconfig.nvm"
  30. //--------------------------------------------------------------------------------
  31. typedef struct AppNVMDataType
  32. {
  33. BOOL appDataModify; //数据更改标志位
  34. UINT8 battSN[BATT_SN_LEN]; //电池SN号码
  35. BOOL isBattLocked; //0:not locked; 1:locked
  36. UINT8 chargEndWorkTime; //the unit is min
  37. UINT8 wakeupWorkTime; //the unit is min
  38. UINT8 sleepTime;
  39. UINT16 HwVersion;
  40. UINT16 SwVersion;
  41. }AppNVMDataType;
  42. typedef struct AppConfigHeader
  43. {
  44. UINT16 fileBodySize; //file body size, not include size of header;
  45. UINT8 version;
  46. UINT8 checkSum;
  47. }AppConfigHeader;
  48. typedef struct _UartAnswerMsg
  49. {
  50. bool UartFlag;
  51. UINT8 dataPtr[8];
  52. UINT16 len;
  53. }UartAnswerMsgType;
  54. typedef enum
  55. {
  56. APP_INIT_STATE,
  57. APP_DEACTIVE_STATE,
  58. APP_IPREADY_STATE,
  59. APP_REPORT_STATE,
  60. APP_IDLE_STATE,
  61. APP_WAIT_STATE
  62. } appRunningState_t;
  63. //uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif /* APP_H */