diff --git a/cpu/stm32/include/periph/cpu_pwm.h b/cpu/stm32/include/periph/cpu_pwm.h index 9154b32543..f22c1048f0 100644 --- a/cpu/stm32/include/periph/cpu_pwm.h +++ b/cpu/stm32/include/periph/cpu_pwm.h @@ -33,10 +33,21 @@ extern "C" { /** * @brief PWM channel + * + * When using a general-purpose timer for a PWM device, the outputs OC of + * each of the four capture/compare channels can be used as PWM channel. + * The respective capture/compare channel is then specified with 0...3 in + * `cc_chan` for the outputs OC1...OC4. + * + * Advanced timers like TIM1 and TIM8 have additionally three complementary + * outputs OCN of the capture/compare channels, which can also be used + * as PWM channels. These complementary outputs are defined with an offset + * of 4, i.e. they are specified in `cc_chan` with 4...6 for OC1N...OC3N. */ typedef struct { gpio_t pin; /**< GPIO pin mapped to this channel */ - uint8_t cc_chan; /**< capture compare channel used */ + uint8_t cc_chan; /**< Capture/compare channel used: 0..3 for OC1..OC4 + or 4..6 for OC1N..OC3N for advanced timers */ } pwm_chan_t; /**