1description: nRFx S/W PWM
2
3compatible: "nordic,nrf-sw-pwm"
4
5include: [pwm-controller.yaml, base.yaml]
6
7properties:
8  generator:
9    type: phandle
10    required: true
11    description: |
12      Reference to TIMER or RTC instance for generating PWM output signals
13
14  clock-prescaler:
15    type: int
16    required: true
17    description: |
18      Clock prescaler for RTC or TIMER used for generating PWM output signals.
19
20      RTC: needs to be set to 0, which gives 32768 Hz base clock for PWM
21      generation.
22
23      TIMER: 16 MHz / 2^prescaler base clock is used for PWM generation.
24
25  channel-gpios:
26    type: phandle-array
27    required: true
28    description: |
29      An array of GPIOs assigned as outputs for the PWM channels. The number
30      of items in this array determines the number of channels that this PWM
31      will provide. This value is limited by the number of compare registers
32      in the used RTC/TIMER instance minus 1.
33
34      Example:
35
36        sw_pwm: sw-pwm {
37          compatible = "nordic,nrf-sw-pwm";
38          ...
39          channel-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>,
40                          <&gpio1 12 GPIO_ACTIVE_HIGH>;
41          ...
42        };
43
44      The above will assign P0.20 as the output for channel 0 and P1.12 as
45      the output for channel 1. Both outputs will be initially configured as
46      active high.
47
48      Please note that in the flags cell (the last component of each item
49      of the array) only the GPIO flags that specify the active level are
50      taken into account (any others are ignored), and they are used only
51      when the initial (inactive) state of the outputs is set.
52      After any PWM signal generation is requested for a given channel,
53      the polarity of its output is determined by the flag specified
54      in the request, i.e. PWM_POLARITY_INVERTED or PWM_POLARITY_NORMAL.
55
56  "#pwm-cells":
57    const: 3
58
59pwm-cells:
60  - channel
61  - period
62  - flags
63