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.

83 lines
1.7 KiB

3 years ago
  1. /**
  2. * @file light.h
  3. * @author Finny (tianjialong0106@163.com)
  4. * @brief Project micro shape photometer light control
  5. * @version 0.1
  6. * @date 2022-09-25
  7. *
  8. * @copyright Copyright (c) 2022
  9. *
  10. */
  11. #pragma once
  12. #include <stdbool.h>
  13. typedef enum
  14. {
  15. ShutDown = 1, //关机
  16. StartingUp, //开机
  17. } power_state_t;
  18. typedef enum
  19. {
  20. NoHeat = 1, //没加热
  21. Heating, //加热中
  22. HeatComplete, //加热完成
  23. } heating_state_t;
  24. typedef enum
  25. {
  26. NoReaction = 1, //没反应
  27. Reacting, //反应中
  28. ReactionComplete, //反应完成
  29. } reaction_state_t;
  30. typedef enum
  31. {
  32. NotConnected = 1, //未连接
  33. Connecting, //连接中
  34. ConnectionComplete, //连接完成
  35. } wifi_state_t;
  36. typedef struct
  37. {
  38. power_state_t state;
  39. bool change_flag;
  40. } power_state_light_structer_t;
  41. typedef struct
  42. {
  43. heating_state_t state;
  44. bool change_flag;
  45. } heating_state_light_structer_t;
  46. typedef struct
  47. {
  48. reaction_state_t state;
  49. bool change_flag;
  50. } reaction_state_light_structer_t;
  51. typedef struct
  52. {
  53. wifi_state_t state;
  54. bool change_flag;
  55. } wifi_state_light_structer_t;
  56. // Debug light
  57. void T_debug_light_init(void);
  58. void T_debug_light_toggle_level(void);
  59. // Power light
  60. void T_power_light_init(power_state_light_structer_t *power_state_light_structer);
  61. // Heating state light
  62. void T_heating_state_light_init(heating_state_light_structer_t *heating_state_light_structer);
  63. // Reaction state light
  64. void T_reaction_state_light_init(reaction_state_light_structer_t *reaction_state_light_structer);
  65. // WIFI state light
  66. void T_wifi_state_light_init(wifi_state_light_structer_t *wifi_state_light_structer);
  67. // Schedule
  68. void T_debug_light_schedule(void);
  69. void T_light_schedule(void);