Firmware SDK
|
Driver for PWM generation. More...
Enumerations | |
enum | twr_pwm_channel_t { TWR_PWM_P0 = TWR_GPIO_P0 , TWR_PWM_P1 = TWR_GPIO_P1 , TWR_PWM_P2 = TWR_GPIO_P2 , TWR_PWM_P3 = TWR_GPIO_P3 , TWR_PWM_P6 = TWR_GPIO_P6 , TWR_PWM_P7 = TWR_GPIO_P7 , TWR_PWM_P8 = TWR_GPIO_P8 , TWR_PWM_P12 = TWR_GPIO_P12 , TWR_PWM_P14 = TWR_GPIO_P14 } |
PWM channels. | |
enum | twr_pwm_tim_t { TWR_PWM_TIM2_P0_P1_P2_P3 , TWR_PWM_TIM3_P6_P7_P8 , TWR_PWM_TIM21_P12_P14 } |
PWM timers. More... | |
Functions | |
void | twr_pwm_init (twr_pwm_channel_t channel) |
Initialize PWM timers based on GPIO pin. More... | |
void | twr_pwm_enable (twr_pwm_channel_t channel) |
Enable PWM output on GPIO pin. More... | |
void | twr_pwm_disable (twr_pwm_channel_t channel) |
Disable PWM output on GPIO pin. More... | |
void | twr_pwm_set (twr_pwm_channel_t channel, uint16_t pwm_value) |
Set PWM value for GPIO pin. More... | |
void | twr_pwm_tim_configure (twr_pwm_tim_t tim, uint32_t resolution_us, uint32_t period_cycles) |
Reconfigure TIM3. More... | |
Driver for PWM generation.
enum twr_pwm_tim_t |
void twr_pwm_disable | ( | twr_pwm_channel_t | channel | ) |
void twr_pwm_enable | ( | twr_pwm_channel_t | channel | ) |
void twr_pwm_init | ( | twr_pwm_channel_t | channel | ) |
void twr_pwm_set | ( | twr_pwm_channel_t | channel, |
uint16_t | pwm_value | ||
) |
Set PWM value for GPIO pin.
[channel] | channel GPIO channel |
[pwm_value] | PWM duty value 0-255 in default configuration |
Definition at line 193 of file twr_pwm.c.
Referenced by twr_servo_set_angle(), and twr_servo_set_microseconds().
void twr_pwm_tim_configure | ( | twr_pwm_tim_t | tim, |
uint32_t | resolution_us, | ||
uint32_t | period_cycles | ||
) |