Skip to content

Commit c27570f

Browse files
AjithAnandhan4kartben
authored andcommitted
samples: adc_dt: add dts overlay for STM32F4-DISCO
Add a board-specif dts overlay file for the adc_dt sample on the STM32F4-DISCO board to enable for ADC channel support. Signed-off-by: Ajith Anandhan <ajithanandhan0406@gmail.com>
1 parent 6fa82f7 commit c27570f

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

boards/st/stm32f4_disco/stm32f4_disco.dts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ zephyr_udc0: &usbotg_fs {
164164
};
165165

166166
&adc1 {
167+
pinctrl-0 = <&adc1_in1_pa1 &adc1_in6_pa6>;
168+
pinctrl-names = "default";
167169
st,adc-prescaler = <2>;
168170
status = "okay";
169171
};

boards/st/stm32f4_disco/stm32f4_disco.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ supported:
1111
- can
1212
- pwm
1313
- counter
14+
- adc
1415
vendor: st
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2025 Ajith Anandhan
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/{
8+
zephyr,user {
9+
io-channels = <&adc1 1>, <&adc1 6>;
10+
};
11+
};
12+
13+
&adc1 {
14+
#address-cells = <1>;
15+
#size-cells = <0>;
16+
17+
channel@1 {
18+
reg = <1>;
19+
zephyr,gain = "ADC_GAIN_1";
20+
zephyr,reference = "ADC_REF_INTERNAL";
21+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
22+
zephyr,resolution = <12>;
23+
};
24+
25+
channel@6 {
26+
reg = <6>;
27+
zephyr,gain = "ADC_GAIN_1";
28+
zephyr,reference = "ADC_REF_INTERNAL";
29+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
30+
zephyr,resolution = <12>;
31+
};
32+
};

0 commit comments

Comments
 (0)