Skip to content

Commit 8cf71d0

Browse files
sudarsan-22kartben
authored andcommitted
samples: adc_dt: add overlay for STM32F0-DISCO
Add board-specific overlay file for the adc_dt sample on the STM32F0-DISCO board to enable ADC channel support. Signed-off-by: Sudarsan N <[email protected]>
1 parent c203760 commit 8cf71d0

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

boards/st/stm32f0_disco/stm32f0_disco.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
};
5454
};
5555

56+
&adc1 {
57+
pinctrl-0 = <&adc_in0_pa0 &adc_in1_pa1>;
58+
pinctrl-names = "default";
59+
st,adc-clock-source = "SYNC";
60+
st,adc-prescaler = <4>;
61+
status = "okay";
62+
};
63+
5664
&clk_lsi {
5765
status = "okay";
5866
};

boards/st/stm32f0_disco/stm32f0_disco.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ toolchain:
88
ram: 8
99
supported:
1010
- watchdog
11+
- adc
1112
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 Sudarsan N
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/{
8+
zephyr,user {
9+
io-channels = <&adc1 0>, <&adc1 1>;
10+
};
11+
};
12+
13+
&adc1 {
14+
#address-cells = <1>;
15+
#size-cells = <0>;
16+
17+
channel@0 {
18+
reg = <0>;
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@1 {
26+
reg = <1>;
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)