Skip to content

Commit a25ca3f

Browse files
committed
giga: add pwm channels (D2-D13) and DACs
1 parent b873df8 commit a25ca3f

File tree

1 file changed

+89
-15
lines changed

1 file changed

+89
-15
lines changed

Diff for: loader/boards/arduino_giga_r1_m7.overlay

+89-15
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,80 @@
5757
clock-frequency = <I2C_BITRATE_FAST>;
5858
};
5959

60-
// XCLK as PWM from PJ9
6160
&timers1 {
6261
status = "okay";
63-
st,prescaler = <0>;
62+
st,prescaler = <4>;
6463

65-
cam_clock_pwm: pwm {
64+
pwm1: pwm {
6665
status = "okay";
67-
pinctrl-0 = <&tim1_ch3_pj9>;
66+
pinctrl-0 = <&tim1_ch3_pj9 &tim1_ch1_pk1 &tim1_ch2_pj11>;
6867
pinctrl-names = "default";
6968
};
7069
};
7170

72-
&cam_clock_pwm {
73-
/* ...then use the pwmclock node to start the clock generation */
71+
&timers2 {
72+
status = "okay";
73+
st,prescaler = <100>;
74+
75+
pwm2: pwm {
76+
status = "okay";
77+
pinctrl-0 = <&tim2_ch4_pa3 &tim2_ch3_pa2>;
78+
pinctrl-names = "default";
79+
};
80+
};
81+
82+
&timers3 {
83+
status = "okay";
84+
st,prescaler = <100>;
85+
86+
pwm3: pwm {
87+
status = "okay";
88+
pinctrl-0 = <&tim3_ch2_pa7 &tim3_ch1_pb4>;
89+
pinctrl-names = "default";
90+
};
91+
};
92+
93+
&timers4 {
94+
status = "okay";
95+
st,prescaler = <100>;
96+
97+
pwm4: pwm {
98+
status = "okay";
99+
pinctrl-0 = <&tim4_ch2_pd13 &tim4_ch3_pb8 &tim4_ch4_pb9>;
100+
pinctrl-names = "default";
101+
};
102+
};
103+
104+
&timers8 {
105+
status = "okay";
106+
st,prescaler = <100>;
107+
108+
pwm8: pwm {
109+
status = "okay";
110+
pinctrl-0 = <&tim8_ch1_pj8 &tim8_ch2_pj10>;
111+
pinctrl-names = "default";
112+
};
113+
};
114+
115+
&timers12 {
116+
status = "okay";
117+
st,prescaler = <100>;
118+
119+
pwm12: pwm {
120+
status = "okay";
121+
pinctrl-0 = <&tim12_ch1_ph6>;
122+
pinctrl-names = "default";
123+
};
124+
};
125+
126+
&pwm1 {
127+
/* Use the pwmclock node to start the clock generation */
74128
pwmclock: pwmclock {
75129
status = "okay";
76130
compatible = "pwm-clock";
77131
clock-frequency = <0>;
78132
#clock-cells = <1>;
79-
pwms = <&cam_clock_pwm 3 PWM_HZ(6000000) PWM_POLARITY_NORMAL>;
133+
pwms = <&pwm1 3 PWM_HZ(12000000) PWM_POLARITY_NORMAL>;
80134
};
81135
};
82136

@@ -422,14 +476,18 @@
422476
<&gpioe 3 GPIO_ACTIVE_LOW>;
423477

424478
pwm-pin-gpios = <&gpioj 9 0>,
425-
<&arduino_header 6 0>,
426-
<&arduino_header 5 0>,
427-
<&arduino_header 17 0>,
428-
<&arduino_header 12 0>,
429-
<&arduino_header 2 0>,
430-
<&arduino_header 3 0>,
479+
<&arduino_header 8 0>,
431480
<&arduino_header 9 0>,
432-
<&arduino_header 10 0>;
481+
<&arduino_header 10 0>,
482+
<&arduino_header 11 0>,
483+
<&arduino_header 12 0>,
484+
<&arduino_header 13 0>,
485+
<&arduino_header 14 0>,
486+
<&arduino_header 15 0>,
487+
<&arduino_header 16 0>,
488+
<&arduino_header 17 0>,
489+
<&arduino_header 18 0>,
490+
<&arduino_header 19 0>;
433491

434492
adc-pin-gpios = <&gpioc 4 0>,
435493
<&gpioc 5 0>,
@@ -450,7 +508,19 @@
450508
cdc-acm = <&cdc_acm_uart0>;
451509
i2cs = <&i2c2>, <&i2c4>, <&i2c1>;
452510
spis = <&spi1>, <&spi5>;
453-
pwms = <&cam_clock_pwm 3 PWM_HZ(6000000) PWM_POLARITY_NORMAL>;
511+
pwms = <&pwm1 3 PWM_HZ(6000000) PWM_POLARITY_NORMAL>,
512+
<&pwm2 4 PWM_HZ(500) PWM_POLARITY_NORMAL>,
513+
<&pwm2 3 PWM_HZ(500) PWM_POLARITY_NORMAL>,
514+
<&pwm8 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
515+
<&pwm3 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
516+
<&pwm4 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
517+
<&pwm3 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
518+
<&pwm4 3 PWM_HZ(500) PWM_POLARITY_NORMAL>,
519+
<&pwm4 4 PWM_HZ(500) PWM_POLARITY_NORMAL>,
520+
<&pwm1 1 PWM_HZ(5000) PWM_POLARITY_NORMAL>,
521+
<&pwm8 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
522+
<&pwm1 2 PWM_HZ(5000) PWM_POLARITY_NORMAL>,
523+
<&pwm12 1 PWM_HZ(500) PWM_POLARITY_NORMAL>;
454524

455525
io-channels = <&adc1 4>,
456526
<&adc1 8>,
@@ -466,5 +536,9 @@
466536
<&adc1 0>,
467537
<&adc1 18>,
468538
<&adc1 19>;
539+
540+
dac = <&dac1>;
541+
dac-channels = <1>, <2>;
542+
dac-resolution = <12>;
469543
};
470544
};

0 commit comments

Comments
 (0)