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.

50 lines
1.4 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #ifndef _pwm_module_H_
  2. #define _pwm_module_H_
  3. #include "lib_config.h"
  4. #include "light.h"
  5. #include "ozone_work.h"
  6. #include "port.h"
  7. #include "system_ES8P5066.h"
  8. typedef struct {
  9. uint32_t s_hardware_frequency; // ��λKhz���������ڵ�PWMƵ��
  10. uint32_t s_hardware_duty; // �������ڵ�PWMռ�ձ�
  11. uint32_t s_large_period; // ��λms���������ڵĶ�ʱ����
  12. uint32_t s_large_duty; // �������ڵĶ�ʱռ�ձ�
  13. } pwm_message_t;
  14. typedef struct {
  15. uint32_t hardware_frequency; // ��λKhz�������ػ�ǰ��PWMƵ��
  16. uint32_t hardware_duty; // �����ػ�ǰ��PWMռ�ձ�
  17. uint32_t large_period; // ��λms�������ػ�ǰ�Ķ�ʱ����
  18. uint32_t large_duty; // �����ػ�ǰ�Ķ�ʱռ�ձ�
  19. } shutdown_before_message_t;
  20. void HOOK_pwm_module_set_pwm_duty(uint32_t frequency, uint32_t duty);
  21. void HOOK_pwm_stop(void);
  22. bool HOOK_pwm_is_enable(void);
  23. void pwm_module_set_pwm_output_1(uint32_t large_period, uint32_t large_duty);
  24. void pwm_module_set_pwm_output_2(uint32_t hardware_period,
  25. uint32_t hardware_duty, uint32_t large_period,
  26. uint32_t large_duty);
  27. void ozone_pwm_control_set_pwm_duty(uint32_t frequency, uint32_t duty);
  28. void pwm_module_stop_pwm(void);
  29. void update_large_period(void);
  30. void pwm_module_loop(void);
  31. #endif
  32. // 2Сʱ
  33. // 50
  34. // 80
  35. // 3Сʱ
  36. // 1Сʱ
  37. // if(haspassed(beigin)/Сʱ%2<=1){
  38. // ��
  39. // }else{
  40. // }