|
Open Model Railroad Network (OpenMRN)
|
Set of 4 PWM channels that belong to a single timer resource in the STM32 microcontrollers. More...
#include <Stm32PWM.hxx>
Classes | |
| class | Channel |
Public Member Functions | |
| Stm32PWMGroup (TIM_TypeDef *base, uint16_t prescaler, uint32_t period_counts) | |
| Constructor. | |
| PWM * | get_channel (unsigned id) |
Static Public Member Functions | |
| static constexpr PWM * | get_channel (Stm32PWMGroup *parent, unsigned id) |
Private Member Functions | |
| void | set_period (uint32_t counts) |
Private Attributes | |
| TIM_HandleTypeDef | timHandle_ |
| HAL handle structure. Note this is extremely wasteful of RAM. | |
| uninitialized< Channel > | channels_ [4] |
Friends | |
| class | Channel |
Set of 4 PWM channels that belong to a single timer resource in the STM32 microcontrollers.
Note that the different channels are tied to be using the same period, but the duty cycle can be independently set.
Definition at line 45 of file Stm32PWM.hxx.
|
inline |
Constructor.
| base | defines which timer resource to use. |
| prescaler | is 0 to 65535 (plus 1 will be the prescaling factor) |
| period_counts | is the timer period in clock cycles. Must be less than 65536 * prescaler. |
Definition at line 54 of file Stm32PWM.hxx.
|
inlinestaticconstexpr |
| parent | the PWMGroup object. Does not need to be initialized yet. |
| id | is the channel number, 1..4 |
Definition at line 81 of file Stm32PWM.hxx.
|
inline |
| id | is the channel number, 1..4 |
Definition at line 72 of file Stm32PWM.hxx.
|
inlineprivate |
Definition at line 147 of file Stm32PWM.hxx.
|
friend |
Definition at line 145 of file Stm32PWM.hxx.
|
private |
Definition at line 157 of file Stm32PWM.hxx.
|
private |
HAL handle structure. Note this is extremely wasteful of RAM.
Definition at line 155 of file Stm32PWM.hxx.