File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,21 @@ extern "C" {
3333
3434/**
3535 * @brief PWM channel
36+ *
37+ * When using a general-purpose timer for a PWM device, the outputs OC<n> of
38+ * each of the four capture/compare channels can be used as PWM channel.
39+ * The respective capture/compare channel is then specified with 0...3 in
40+ * `cc_chan` for the outputs OC1...OC4.
41+ *
42+ * Advanced timers like TIM1 and TIM8 have additionally three complementary
43+ * outputs OC<n>N of the capture/compare channels, which can also be used
44+ * as PWM channels. These complementary outputs are defined with an offset
45+ * of 4, i.e. they are specified in `cc_chan` with 4...6 for OC1N...OC3N.
3646 */
3747typedef struct {
3848 gpio_t pin ; /**< GPIO pin mapped to this channel */
39- uint8_t cc_chan ; /**< capture compare channel used */
49+ uint8_t cc_chan ; /**< Capture/compare channel used: 0..3 for OC1..OC4
50+ or 4..6 for OC1N..OC3N for advanced timers */
4051} pwm_chan_t ;
4152
4253/**
You can’t perform that action at this time.
0 commit comments