fan_pwm.h 531 B

1234567891011121314151617181920212223
  1. #ifndef _FAN_PWM_H__
  2. #define _FAN_PWM_H__
  3. #include "bsp/bsp.h"
  4. #include "os/os_types.h"
  5. #define PWM_FREQ_HZ 200
  6. #define FAN_DUTY_COUNT (1000000/200)
  7. #define FAN_MAX_DUTY_COUNT (FAN_DUTY_COUNT/2)
  8. #ifdef CONFIG_BOARD_MCXXX
  9. void fan_pwm_init(void);
  10. void fan_stop(void);
  11. void fan_set_duty(u8 duty); //duty 0-100
  12. bool fan_pwm_is_running(void);
  13. #else
  14. static void fan_pwm_init(void) {}
  15. static void fan_stop(void) {}
  16. static void fan_set_duty(u8 duty) {}
  17. bool fan_pwm_is_running(void){return false;}
  18. #endif
  19. #endif /* _FAN_PWM_H__ */