user_config.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #ifndef _USER_CONFIG_H_
  2. #define _USER_CONFIG_H_
  3. #include "yc_protocol.h"
  4. #include "GT5DL32A3W.h"
  5. #include "EPD.h"
  6. #include "GUI_Paint.h"
  7. #include "LORA.h"
  8. #include "LED.h"
  9. #include "user_button.h"
  10. #include "FONT_LIB.h"
  11. #include "SPIFFS.h"
  12. #include "Decection.h"
  13. typedef enum
  14. {
  15. YC_TASK_NONE = 0,
  16. YC_TASK_OTHER,
  17. YC_TASK_BUTTON,
  18. YC_TASK_LORA,
  19. YC_TASK_UNPACK,
  20. YC_TASK_LOGIC,
  21. YC_TASK_RIGHT_SCREEN,
  22. YC_TASK_LEFT_SCREEN,
  23. YC_TASK_DEAL, // 数据处理
  24. YC_TASK_END,
  25. } YC_TASK_FUNC;
  26. #define LEFT_SCREEN_BIT 1
  27. #define RIGHT_SCREEN_BIT 2
  28. #define SCREEN_WIDTH 648
  29. #define SCREEN_HEIGHT 480
  30. #define IS_FEB_MONTH ((Machine_info.day == 29) && (Machine_info.month == 2) && \
  31. (!((Machine_info.year / 4 == 0) || (Machine_info.year / 2000 == 0))))
  32. #define IS_LEAP_YEAR ((Machine_info.day == 30) && (Machine_info.month == 2) && \
  33. ((Machine_info.year / 4 == 0) || (Machine_info.year / 2000 == 0)))
  34. #define IS_SMALL_MONTH ((Machine_info.day == 31) && ((Machine_info.month == 4) || \
  35. (Machine_info.month == 6) || \
  36. (Machine_info.month == 9) || \
  37. (Machine_info.month == 11)))
  38. #define IS_BIG_MONTH ((Machine_info.day == 32) && ((Machine_info.month == 1) || \
  39. (Machine_info.month == 3) || \
  40. (Machine_info.month == 5) || \
  41. (Machine_info.month == 7) || \
  42. (Machine_info.month == 8) || \
  43. (Machine_info.month == 10) || \
  44. (Machine_info.month == 12)))
  45. extern FONT_TYPE_T ascii_type_5x7;
  46. extern FONT_TYPE_T ascii_type_7x8;
  47. extern FONT_TYPE_T ascii_type_6x12;
  48. extern FONT_TYPE_T ascii_type_8x16;
  49. extern FONT_TYPE_T ascii_type_12x24;
  50. extern FONT_TYPE_T ascii_type_12x24_b;
  51. extern FONT_TYPE_T ascii_type_16x32;
  52. extern FONT_TYPE_T chinese_type_12;
  53. extern FONT_TYPE_T chinese_type_16;
  54. extern FONT_TYPE_T chinese_type_24;
  55. extern FONT_TYPE_T chinese_type_32;
  56. extern PAINT_TIME Paint_time_info;
  57. extern PAINT Paint_info;
  58. #if !HARDWARE_SPI
  59. extern struct EPD_INFO_SET left_screen;
  60. extern struct EPD_INFO_SET right_screen;
  61. #endif
  62. extern adc_oneshot_unit_handle_t adc1_handle;
  63. // extern Machine_info_t Machine_info;
  64. typedef enum
  65. {
  66. STATE_NONE = 0, // 机器状态
  67. STATE_OPERATION = 1, // 运行
  68. STATE_SHUT_DOWN = 2, // 停机
  69. STATE_BREAKDOWN = 3, // 故障
  70. STATE_SAFEKEEP = 4, // 封存
  71. STATE_UPKEEP = 5, // 保养
  72. STATE_WAIT_MATERIALS = 6, // 待料
  73. STATE_END,
  74. } Machine_state_t;
  75. // typedef struct
  76. // {
  77. // bool is_into_sleep;
  78. // bool is_left;
  79. // }Screen_dis_t;
  80. extern int last_batt_precent;
  81. void esp_ble_ota(void);
  82. void reset_default(bool is_dis, uint8_t power_status);
  83. void Paint_leftScreen(bool is_poweron, bool is_test);
  84. void Paint_rightScreen(bool is_poweron, bool is_test);
  85. #endif