zephyr/dts/bindings/pwm/st,stm32-pwm.yaml
Hein Wessels 1732651062 drivers: pwm: stm32: support capturing on four channels
Previously the pwm capture only support capturing on channel 1
and 2, because the slave mode controller was used, which uses
the signal TIxFP which is not available for channel 3 and 4.

This commit adds optional support for four channel capturing by
changing the method of capturing PWM signals to not use the
slave mode controller to reset the counter register. Instead the
counter is reset in the ISR. This will result in a slight loss
of accuracy but is still within an acceptable range.

Co-authored-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-09-07 09:42:25 +02:00

38 lines
1.1 KiB
YAML

description: STM32 PWM
compatible: "st,stm32-pwm"
include: [pwm-controller.yaml, base.yaml, pinctrl-device.yaml]
properties:
pinctrl-0:
required: true
pinctrl-names:
required: true
four-channel-capture-support:
type: boolean
description: |
Add support to capture on four channels. This is less accurate than
the default 2 channel support because the counter is reset by
interrupt instead of slave-mode controller. This option can also
be used as alternative for timers that does not support slave mode.
"#pwm-cells":
const: 3
description: |
Number of items to expect in a PWM
- channel of the timer used for PWM
- period to set in ns
- flags : combination of standard flags like PWM_POLARITY_NORMAL
or specific flags like STM32_PWM_COMPLEMENTARY. As an example,
the following complementary PWMs(CH2&CH2N) are shown below.
<&pwm1 2 100 (PWM_POLARITY_NORMAL)>;
<&pwm1 2 100 (PWM_POLARITY_NORMAL | STM32_PWM_COMPLEMENTARY)>;
pwm-cells:
- channel
- period
- flags