PWM
The generator parses all timer channels configured for PWM output and emits one independent STM32PWM instance per channel.
Example
When the third argument is true, the complementary output of that timer channel is used.
static STM32PWM pwm_tim1_ch1(&htim1, TIM_CHANNEL_1, false);
Generation Rules
- every channel in a PWM Generation mode under a TIM peripheral of the CubeMX project gets one object;
- objects are named
pwm_<timer>_ch<channel>, such aspwm_tim1_ch1; - a complementary output channel (
CHxNin CubeMX) gets an object name ending inn(such aspwm_tim1_ch1n) and usesTIM_CHANNEL_xwithtrueas the third constructor argument; other channels passfalse. With both the main and the complementary output on (PWM Generation1 CH1 CH1N), the two objectspwm_tim1_ch1andpwm_tim1_ch1nare generated.