Skip to content

Commit d2b7cef

Browse files
committed
variant: nicla_vision: fix adc configuration
1 parent 56a1686 commit d2b7cef

1 file changed

Lines changed: 30 additions & 14 deletions

File tree

variants/arduino_nicla_vision_stm32h747xx_m7/arduino_nicla_vision_stm32h747xx_m7.overlay

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
};
7979

8080
&adc1 {
81-
pinctrl-0 = <&adc1_inp4_pc4 &adc1_inp5_pb1 &adc1_inp12_pc2 &adc1_inp13_pc3>;
81+
pinctrl-0 = <&adc1_inp4_pc4>;
8282
pinctrl-names = "default";
8383
st,adc-clock-source = "SYNC";
8484
st,adc-prescaler = <4>;
@@ -104,8 +104,8 @@
104104
};
105105
};
106106

107-
&adc3 {
108-
pinctrl-0 = <&adc3_inp0_pc2_c &adc3_inp1_pc3_c>;
107+
&adc2 {
108+
pinctrl-0 = <&adc2_inp2_pf13>;
109109
pinctrl-names = "default";
110110
st,adc-clock-source = "SYNC";
111111
st,adc-prescaler = <4>;
@@ -114,15 +114,28 @@
114114
#address-cells = <1>;
115115
#size-cells = <0>;
116116

117-
channel@0 {
118-
reg = <0>;
117+
channel@2 {
118+
reg = <2>;
119119
zephyr,gain = "ADC_GAIN_1";
120120
zephyr,reference = "ADC_REF_INTERNAL";
121121
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
122122
zephyr,resolution = <16>;
123123
};
124-
channel@1 {
125-
reg = <1>;
124+
};
125+
126+
&adc3 {
127+
zephyr,deferred-init;
128+
pinctrl-0 = <&adc3_inp5_pf3>;
129+
pinctrl-names = "default";
130+
st,adc-clock-source = "SYNC";
131+
st,adc-prescaler = <4>;
132+
status = "okay";
133+
134+
#address-cells = <1>;
135+
#size-cells = <0>;
136+
137+
channel@5 {
138+
reg = <5>;
126139
zephyr,gain = "ADC_GAIN_1";
127140
zephyr,reference = "ADC_REF_INTERNAL";
128141
zephyr,acquisition-time = <ADC_ACQ_TIME_MAX>;
@@ -206,11 +219,14 @@
206219
<&gpioe 3 GPIO_ACTIVE_HIGH>, /* Red LED PE_3 */
207220
<&gpioc 13 GPIO_ACTIVE_HIGH>, /* Green LED PC_13 */
208221
<&gpiof 4 GPIO_ACTIVE_HIGH>, /* Blue LED PF_4 */
209-
<&gpiog 0 GPIO_ACTIVE_HIGH>; /* SE05X_EN */
222+
<&gpiog 0 GPIO_ACTIVE_HIGH>, /* SE05X_EN */
223+
<&gpioc 4 GPIO_ACTIVE_HIGH>, /* PC4 A0 ADC1 ch4 */
224+
<&gpiof 13 GPIO_ACTIVE_HIGH>, /* PF13 A1 ADC2 ch2 */
225+
<&gpiof 3 GPIO_ACTIVE_HIGH>; /* PF3 A2 ADC3 ch5 */
210226

211-
adc-pin-gpios = <&gpioc 4 GPIO_ACTIVE_HIGH>, /* A0 PC_4 */
212-
<&gpiof 13 GPIO_ACTIVE_HIGH>, /* A1 PF_13 */
213-
<&gpiof 3 GPIO_ACTIVE_HIGH>; /* A2 PF_3 */
227+
adc-pin-gpios = <&gpioc 4 GPIO_ACTIVE_HIGH>, /* A0 PC4 */
228+
<&gpiof 13 GPIO_ACTIVE_HIGH>, /* A1 PF13 */
229+
<&gpiof 3 GPIO_ACTIVE_HIGH>; /* A2 PF3 */
214230

215231
pwm-pin-gpios = <&gpioa 8 GPIO_ACTIVE_HIGH>,
216232
<&gpioc 6 GPIO_ACTIVE_HIGH>,
@@ -226,9 +242,9 @@
226242
i2cs = <&i2c1>, <&i2c2>, <&i2c3>;
227243
spis = <&spi4>, <&spi5>;
228244

229-
io-channels = <&adc1 0>,
230-
<&adc3 0>,
231-
<&adc1 6>;
245+
io-channels = <&adc1 4>,
246+
<&adc2 2>,
247+
<&adc3 5>;
232248

233249
builtin-led-gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>, /* Green LED PC_13 (LED_BUILTIN) */
234250
<&gpioe 3 GPIO_ACTIVE_HIGH>, /* Red LED PE_3 */

0 commit comments

Comments
 (0)