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.

96 lines
2.4 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
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 enum
  28. {
  29. closeCameraFillLight = 1, //关闭摄像头补光灯
  30. openCameraFillLight, //打开摄像头补光灯
  31. } camera_fill_light_t;
  32. typedef struct
  33. {
  34. power_state_t state;
  35. bool change_flag;
  36. } power_state_light_structer_t;
  37. typedef struct
  38. {
  39. heating_plate_state_t state;
  40. bool change_flag;
  41. } heating_plate_state_light_structer_t;
  42. typedef struct
  43. {
  44. reaction_state_t state;
  45. bool change_flag;
  46. } reaction_state_light_structer_t;
  47. typedef struct
  48. {
  49. wifi_state_t state;
  50. bool change_flag;
  51. } wifi_state_light_structer_t;
  52. typedef struct
  53. {
  54. camera_fill_light_t state;
  55. bool change_flag;
  56. } camera_fill_light_structer_t;
  57. // Debug light
  58. void T_debug_light_init(void);
  59. void T_light_toggle_level(uint8_t io_num);
  60. // Power light
  61. void T_power_light_init(power_state_light_structer_t *power_state_light_structer);
  62. // Heating state light
  63. void T_heating_plate_state_light_init(heating_plate_state_light_structer_t *heating_plate_state_light_structer);
  64. void T_heating_plate_light_change_state(heating_plate_state_t change_state);
  65. void T_heating_plate_light_set_rgb_by_state(heating_plate_state_t state);
  66. // Reaction state light
  67. void T_reaction_state_light_init(reaction_state_light_structer_t *reaction_state_light_structer);
  68. void T_reaction_light_change_state(reaction_state_t change_state);
  69. void T_reaction_light_set_rgb_by_state(reaction_state_t state);
  70. // WIFI state light
  71. void T_wifi_state_light_init(wifi_state_light_structer_t *wifi_state_light_structer);
  72. void T_wifi_light_change_state(wifi_state_t change_state);
  73. void T_wifi_light_set_rgb_by_state(wifi_state_t state);
  74. // Camera fill light
  75. void T_camera_fill_light_init(camera_fill_light_structer_t *camera_fill_light_structer);
  76. void T_camera_fill_light_set_level(bool level);
  77. // Schedule
  78. void T_debug_light_schedule(void);
  79. void T_light_schedule(void);