48#define pwm_init_hz(timer, frequency) pwm_init((timer), 1000000 / (frequency))
PwmTimer
PWM Timer selection.
Definition: pwm.h:28
uint16_t pwm_get_dc(PwmTimer timer, PwmChannel channel)
Gets the duty cycle of a specified channel for a PWM timer.
Definition: pwm.c:180
StatusCode pwm_set_pulse(PwmTimer timer, uint16_t pulse_width_us, PwmChannel channel, bool n_channel_en)
Sets the pulse width of a specified channel of a PWM timer.
Definition: pwm.c:95
StatusCode pwm_set_dc(PwmTimer timer, uint16_t dc, PwmChannel channel, bool n_channel_en)
Sets the duty cycle of a specified channel for a PWM timer.
Definition: pwm.c:160
StatusCode pwm_init(PwmTimer timer, uint16_t period_us)
Initializes a specified PWM timer with a period.
Definition: pwm.c:48
uint16_t pwm_get_period(PwmTimer timer)
Gets the current period of a specified PWM timer in microseconds.
Definition: pwm.c:207
PwmChannel
PWM Channel selection.
Definition: pwm.h:37
@ PWM_TIMER_2
Definition: pwm.h:30
@ NUM_PWM_TIMERS
Definition: pwm.h:33
@ PWM_TIMER_16
Definition: pwm.h:32
@ PWM_TIMER_1
Definition: pwm.h:29
@ PWM_TIMER_15
Definition: pwm.h:31
@ PWM_CHANNEL_1
Definition: pwm.h:38
@ PWM_CHANNEL_3
Definition: pwm.h:40
@ PWM_CHANNEL_4
Definition: pwm.h:41
@ NUM_PWM_CHANNELS
Definition: pwm.h:44
@ PWM_CHANNEL_5
Definition: pwm.h:42
@ PWM_CHANNEL_2
Definition: pwm.h:39
@ PWM_CHANNEL_6
Definition: pwm.h:43
StatusCode
StatusCodes for various errors.
Definition: status.h:27