You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. typedef enum
  5. {
  6. ShutDown = 1, //关机
  7. StartingUp, //开机
  8. } power_state_t;
  9. typedef enum
  10. {
  11. NoHeat = 1, //没加热
  12. Heating, //加热中
  13. HeatComplete, //加热完成
  14. } heating_plate_state_t;
  15. typedef enum
  16. {
  17. NoReaction = 1, //没反应
  18. Reacting, //反应中
  19. ReactionComplete, //反应完成
  20. } reaction_state_t;
  21. typedef enum
  22. {
  23. NotConnected = 1, //未连接
  24. Connecting, //连接中
  25. ConnectionComplete, //连接完成
  26. } wifi_state_t;
  27. typedef struct
  28. {
  29. power_state_t state;
  30. bool change_flag;
  31. } power_state_light_structer_t;
  32. typedef struct
  33. {
  34. heating_plate_state_t state;
  35. bool change_flag;
  36. } heating_plate_state_light_structer_t;
  37. typedef struct
  38. {
  39. reaction_state_t state;
  40. bool change_flag;
  41. } reaction_state_light_structer_t;
  42. typedef struct
  43. {
  44. wifi_state_t state;
  45. bool change_flag;
  46. } wifi_state_light_structer_t;
  47. // Debug light
  48. void T_debug_light_init(void);
  49. void T_light_toggle_level(uint8_t io_num);
  50. // Power light
  51. void T_power_light_init(power_state_light_structer_t *power_state_light_structer);
  52. // Heating state light
  53. void T_heating_plate_state_light_init(heating_plate_state_light_structer_t *heating_plate_state_light_structer);
  54. void T_heating_plate_light_change_state(heating_plate_state_t change_state);
  55. void T_heating_plate_light_set_rgb_by_state(heating_plate_state_t state);
  56. // Reaction state light
  57. void T_reaction_state_light_init(reaction_state_light_structer_t *reaction_state_light_structer);
  58. void T_reaction_light_change_state(reaction_state_t change_state);
  59. void T_reaction_light_set_rgb_by_state(reaction_state_t state);
  60. // WIFI state light
  61. void T_wifi_state_light_init(wifi_state_light_structer_t *wifi_state_light_structer);
  62. void T_wifi_light_change_state(wifi_state_t change_state);
  63. void T_wifi_light_set_rgb_by_state(wifi_state_t state);
  64. // Schedule
  65. void T_debug_light_schedule(void);
  66. void T_light_schedule(void);