2 * pwm.h - arm pwm interface header file
4 * author: hackbard@hackdaworld.org
15 #define pwm_enable PWMTCR=0x09
16 #define pwm_reset PWMTCR=0x03
17 #define pwm_disable PWMTCR=0x00
20 #define PWM_SINGLE_EDGE 0x00
21 #define PWM_DOUBLE_EDGE 0x01
23 #define PWM_MATCH_INTERRUPT 0x01
24 #define PWM_MATCH_RESET 0x02
25 #define PWM_MATCH_STOP 0x04
28 #define PWM_INVALID_CHAN 0x01
29 #define PWM_STUPID 0x02
39 /* function prototypes */
41 void pwm_set_rate_and_prescaler(u32 rate,u32 prescaler);
42 int pwm_config(u8 pwmchan,u8 mode,u32 val1,u32 val2);
43 int pwm_update_match(u8 pwmchan,u8 mode,u32 val1,u32 val2);
44 void pwm_match_ctrl_config(u8 matchreg,u8 ctrl);