Configuration struct for the timer peripheral.
More...
Configuration struct for the timer peripheral.
- Note
- These settings are used during initialization and changing them afterwards may not have the desired effect.
#include <pwm.h>
|
Peripheral | periph |
|
uint32_t | prescaler |
| Prescaler that divides the PWM timer frequency. The final frequency will be sysclk / (2 * (period + 1) * (prescaler + 1)).
|
|
uint32_t | period |
| period in ticks at TIM frequency before the counter resets. Affects both the frequency and resolution of PWM.
|
|
◆ Peripheral
Hardware Timer to use for PWM.
Enumerator |
---|
TIM_3 | 16-bit counter (max period 0xffff)
|
TIM_4 | 16-bit counter (max period 0xffff)
|
TIM_5 | 32-bit counter (max period 0xffffffff)
|
◆ Config() [1/2]
daisy::PWMHandle::Config::Config |
( |
| ) |
|
|
inline |
◆ Config() [2/2]
daisy::PWMHandle::Config::Config |
( |
Peripheral | periph_, |
|
|
uint32_t | prescaler_ = 0, |
|
|
uint32_t | period_ = 0xffff ) |
|
inline |
◆ period
uint32_t daisy::PWMHandle::Config::period |
period in ticks at TIM frequency before the counter resets. Affects both the frequency and resolution of PWM.
- Note
- TIM3 and TIM4 are both 16-bit timers so the max period is 0xffff. TIM5 is a 32-bit timer so the max period is 0xffffffff (about 20 seconds per reset).
◆ periph
◆ prescaler
uint32_t daisy::PWMHandle::Config::prescaler |
Prescaler that divides the PWM timer frequency. The final frequency will be sysclk / (2 * (period + 1) * (prescaler + 1)).
The documentation for this struct was generated from the following file: