Fork of the espurna firmware for `mhsw` switches
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.

33 lines
894 B

6 years ago
  1. #ifndef __PWM_H__
  2. #define __PWM_H__
  3. /*pwm.h: function and macro definition of PWM API , driver level */
  4. /*user_light.h: user interface for light API, user level*/
  5. /*user_light_adj: API for color changing and lighting effects, user level*/
  6. /*NOTE!! : DO NOT CHANGE THIS FILE*/
  7. /*SUPPORT UP TO 8 PWM CHANNEL*/
  8. //#define PWM_CHANNEL_NUM_MAX 8
  9. struct pwm_param {
  10. uint32 period;
  11. uint32 freq;
  12. uint32 duty[PWM_CHANNEL_NUM_MAX]; //PWM_CHANNEL<=8
  13. };
  14. /* pwm_init should be called only once, for now */
  15. void pwm_init(uint32 period, uint32 *duty,uint32 pwm_channel_num,uint32 (*pin_info_list)[3]);
  16. void pwm_start(void);
  17. void pwm_set_duty(uint32 duty, uint8 channel);
  18. uint32 pwm_get_duty(uint8 channel);
  19. void pwm_set_period(uint32 period);
  20. uint32 pwm_get_period(void);
  21. uint32 get_pwm_version(void);
  22. void set_pwm_debug_en(uint8 print_en);
  23. #endif