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.

62 lines
1.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #ifndef __OZONE_WORK_H__
  2. #define __OZONE_WORK_H__
  3. #include "adc.h"
  4. #include "port.h"
  5. #include "systick.h"
  6. #include "timer.h"
  7. #include <stdbool.h> //���岼��
  8. #include <stdint.h>
  9. #include <string.h>
  10. #define LED_INIT(_bool, _port_led_set) \
  11. { .set_led_state = _bool, .port_led_set = _port_led_set }
  12. typedef void (*port_led_set_t)(bool state);
  13. typedef struct {
  14. bool set_led_state;
  15. port_led_set_t port_led_set;
  16. } led_t, rgb_t;
  17. static led_t s_leds[] = {
  18. LED_INIT(false, port_led0_set),
  19. LED_INIT(false, port_led1_set),
  20. LED_INIT(false, port_led2_set),
  21. LED_INIT(false, port_led3_set),
  22. };
  23. static rgb_t s_rgb[] = {
  24. LED_INIT(false, port_led_r_set),
  25. LED_INIT(false, port_led_g_set),
  26. LED_INIT(false, port_led_b_set),
  27. };
  28. typedef struct {
  29. bool switch_key_state;
  30. bool interva_flag;
  31. bool ozone_interva_state;
  32. int ozone_work_state; // 0?????1?????2????
  33. uint8_t timing_rank; // 1??30min?2??60min,3??90min,4??120min
  34. uint32_t ozone_work_time;
  35. uint32_t ozone_interval_time;
  36. uint32_t count_down_begin_sys_time;
  37. uint32_t count_interval_down_begin_sys_time;
  38. } ozone_message_t;
  39. void gears_led_on(uint8_t led_number);
  40. void timing_led_on(uint8_t led_number);
  41. void set_ozen_gears(int ozen_gears);
  42. void ozone_work_mode(int mode);
  43. void set_ozone_work_time(void);
  44. void timing_ozone_work_over(void);
  45. void is_ozone_work_time_over(void);
  46. void is_ozone_interva_time_over(void);
  47. void set_interval_time(void);
  48. static void ozone_interval_begin(void);
  49. static void close_ozone_work(void);
  50. bool get_ozone_starting_up_state(void);
  51. void process_switch_key(void);
  52. void power_on_ozone_work_state(void);
  53. void process_voltage_abnormal(void);
  54. void set_rgb_flicker(void);
  55. #endif