Skip to content

Commit 2470784

Browse files
samples/tests: adc: silabs: add multiple device overlays.
This commit introduces/updates overlays for multiple silabs boards for ADC samples and ADC tests. Signed-off-by: Martin Hoff <[email protected]>
1 parent d21081f commit 2470784

29 files changed

+992
-18
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2025 Silicon Laboratories Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "dt-bindings/adc/silabs-adc.h"
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 0>, <&adc0 1>;
12+
};
13+
};
14+
15+
&adc0 {
16+
status = "okay";
17+
#address-cells = <1>;
18+
#size-cells = <0>;
19+
20+
channel@0 {
21+
reg = <0>;
22+
zephyr,gain = "ADC_GAIN_1";
23+
zephyr,reference = "ADC_REF_INTERNAL";
24+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
25+
zephyr,resolution = <12>;
26+
zephyr,input-positive = <IADC_INPUT_IOVDD>;
27+
};
28+
29+
channel@1 {
30+
reg = <1>;
31+
zephyr,gain = "ADC_GAIN_1";
32+
zephyr,reference = "ADC_REF_INTERNAL";
33+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
34+
zephyr,resolution = <12>;
35+
zephyr,input-positive = <IADC_INPUT_VBAT>;
36+
};
37+
};
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Silicon Laboratories Inc.
5+
*/
6+
7+
#include <dt-bindings/adc/silabs-adc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 3>, <&adc0 4>;
12+
};
13+
};
14+
15+
&pinctrl {
16+
adc0_default: adc0_default {
17+
group0 {
18+
/* Allocate odd bus 0 on GPIO port B to IADC for access to pin PB1 */
19+
silabs,analog-bus = <ABUS_BODD0_IADC0>;
20+
};
21+
};
22+
};
23+
24+
&adc0 {
25+
pinctrl-0 = <&adc0_default>;
26+
pinctrl-names = "default";
27+
#address-cells = <1>;
28+
#size-cells = <0>;
29+
status = "okay";
30+
31+
channel@3 {
32+
reg = <3>;
33+
zephyr,gain = "ADC_GAIN_1";
34+
zephyr,reference = "ADC_REF_INTERNAL";
35+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
36+
zephyr,resolution = <12>;
37+
zephyr,input-positive = <IADC_INPUT_AVDD>;
38+
};
39+
40+
channel@4 {
41+
reg = <4>;
42+
zephyr,gain = "ADC_GAIN_1";
43+
zephyr,reference = "ADC_REF_VDD_1";
44+
zephyr,vref-mv = <3000>;
45+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
46+
zephyr,resolution = <12>;
47+
zephyr,input-positive = <IADC_INPUT_PB3>;
48+
};
49+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Silicon Laboratories Inc.
5+
*/
6+
7+
#include <dt-bindings/adc/silabs-adc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 3>, <&adc0 4>;
12+
};
13+
};
14+
15+
&pinctrl {
16+
adc0_default: adc0_default {
17+
group0 {
18+
/* Allocate odd bus 0 on GPIO port C/D to IADC for access to pin PD3 */
19+
silabs,analog-bus = <ABUS_CDODD0_IADC0>;
20+
};
21+
};
22+
};
23+
24+
&adc0 {
25+
pinctrl-0 = <&adc0_default>;
26+
pinctrl-names = "default";
27+
#address-cells = <1>;
28+
#size-cells = <0>;
29+
status = "okay";
30+
31+
channel@3 {
32+
reg = <3>;
33+
zephyr,gain = "ADC_GAIN_1";
34+
zephyr,reference = "ADC_REF_INTERNAL";
35+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
36+
zephyr,resolution = <12>;
37+
zephyr,input-positive = <IADC_INPUT_AVDD>;
38+
};
39+
40+
channel@4 {
41+
reg = <4>;
42+
zephyr,gain = "ADC_GAIN_1";
43+
zephyr,reference = "ADC_REF_VDD_1";
44+
zephyr,vref-mv = <3300>;
45+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
46+
zephyr,resolution = <12>;
47+
zephyr,input-positive = <IADC_INPUT_PD3>;
48+
};
49+
50+
};
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Silicon Laboratories Inc.
5+
*/
6+
7+
#include <dt-bindings/adc/silabs-adc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 3>, <&adc0 4>;
12+
};
13+
};
14+
15+
&pinctrl {
16+
adc0_default: adc0_default {
17+
group0 {
18+
/* Allocate odd bus 0 on GPIO port B to IADC for access to pin PB1 */
19+
silabs,analog-bus = <ABUS_BODD0_IADC0>;
20+
};
21+
};
22+
};
23+
24+
&adc0 {
25+
pinctrl-0 = <&adc0_default>;
26+
pinctrl-names = "default";
27+
#address-cells = <1>;
28+
#size-cells = <0>;
29+
status = "okay";
30+
31+
channel@3 {
32+
reg = <3>;
33+
zephyr,gain = "ADC_GAIN_1";
34+
zephyr,reference = "ADC_REF_INTERNAL";
35+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
36+
zephyr,resolution = <12>;
37+
zephyr,input-positive = <IADC_INPUT_AVDD>;
38+
};
39+
40+
channel@4 {
41+
reg = <4>;
42+
zephyr,gain = "ADC_GAIN_1";
43+
zephyr,reference = "ADC_REF_VDD_1";
44+
zephyr,vref-mv = <3300>;
45+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
46+
zephyr,resolution = <12>;
47+
zephyr,input-positive = <IADC_INPUT_PB3>;
48+
};
49+
};

samples/drivers/adc/adc_dt/boards/xg24_rb4187c.overlay

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Copyright (c) 2025 Silicon Laboratories Inc.
55
*/
66

7-
#include <dt-bindings/pinctrl/silabs/xg24-pinctrl.h>
87
#include <dt-bindings/adc/silabs-adc.h>
98

109
/ {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Silicon Laboratories Inc.
5+
*/
6+
7+
#include <dt-bindings/adc/silabs-adc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 3>, <&adc0 4>;
12+
};
13+
};
14+
15+
&pinctrl {
16+
adc0_default: adc0_default {
17+
group0 {
18+
/* Allocate odd bus 0 on GPIO port B to IADC for access to pin PB1 */
19+
silabs,analog-bus = <ABUS_BODD0_IADC0>;
20+
};
21+
};
22+
};
23+
24+
&adc0 {
25+
pinctrl-0 = <&adc0_default>;
26+
pinctrl-names = "default";
27+
#address-cells = <1>;
28+
#size-cells = <0>;
29+
status = "okay";
30+
31+
channel@3 {
32+
reg = <3>;
33+
zephyr,gain = "ADC_GAIN_1";
34+
zephyr,reference = "ADC_REF_INTERNAL";
35+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
36+
zephyr,resolution = <12>;
37+
zephyr,input-positive = <IADC_INPUT_AVDD>;
38+
};
39+
40+
channel@4 {
41+
reg = <4>;
42+
zephyr,gain = "ADC_GAIN_1";
43+
zephyr,reference = "ADC_REF_VDD_1";
44+
zephyr,vref-mv = <3300>;
45+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
46+
zephyr,resolution = <12>;
47+
zephyr,input-positive = <IADC_INPUT_PB3>;
48+
};
49+
};

samples/drivers/adc/adc_dt/boards/xg29_rb4412a.overlay

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
zephyr,gain = "ADC_GAIN_1";
3535
zephyr,reference = "ADC_REF_INTERNAL";
3636
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
37-
zephyr,resolution = <12>;
37+
zephyr,oversampling = <5>;
38+
zephyr,resolution = <16>;
3839
zephyr,input-positive = <IADC_INPUT_AVDD>;
3940
};
4041

@@ -44,6 +45,7 @@
4445
zephyr,reference = "ADC_REF_VDD_1";
4546
zephyr,vref-mv = <3300>;
4647
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
48+
zephyr,oversampling = <5>;
4749
zephyr,resolution = <12>;
4850
zephyr,input-positive = <IADC_INPUT_PD3>;
4951
};

samples/drivers/adc/adc_dt/sample.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ tests:
3737
- mcx_n9xx_evk/mcxn947/cpu0
3838
- frdm_mcxc242
3939
- ucans32k1sic
40+
- sltb010a
41+
- slwrb4180a
42+
- xg23_rb4210a
4043
- xg24_rb4187c
44+
- xg27_dk2602a
4145
- xg29_rb4412a
46+
- bg29_rb4420a
4247
- raytac_an54l15q_db/nrf54l15/cpuapp
4348
- frdm_mcxa346
4449
- frdm_mcxa266
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2025 Silicon Laboratories Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "dt-bindings/adc/silabs-adc.h"
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 0>, <&adc0 1>;
12+
};
13+
14+
aliases {
15+
adc0 = &adc0;
16+
};
17+
};
18+
19+
&adc0 {
20+
status = "okay";
21+
#address-cells = <1>;
22+
#size-cells = <0>;
23+
24+
channel@0 {
25+
reg = <0>;
26+
zephyr,gain = "ADC_GAIN_1";
27+
zephyr,reference = "ADC_REF_INTERNAL";
28+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
29+
zephyr,resolution = <12>;
30+
zephyr,input-positive = <IADC_INPUT_IOVDD>;
31+
};
32+
33+
channel@1 {
34+
reg = <1>;
35+
zephyr,gain = "ADC_GAIN_1";
36+
zephyr,reference = "ADC_REF_INTERNAL";
37+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
38+
zephyr,resolution = <12>;
39+
zephyr,input-positive = <IADC_INPUT_VBAT>;
40+
};
41+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2025 Silicon Laboratories Inc.
5+
*/
6+
7+
#include <dt-bindings/adc/silabs-adc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&adc0 3>, <&adc0 4>;
12+
};
13+
14+
aliases {
15+
adc0 = &adc0;
16+
};
17+
};
18+
19+
&pinctrl {
20+
adc0_default: adc0_default {
21+
group0 {
22+
/* Allocate odd bus 0 on GPIO port B to IADC for access to pin PB1 */
23+
silabs,analog-bus = <ABUS_BODD0_IADC0>;
24+
};
25+
};
26+
};
27+
28+
&adc0 {
29+
pinctrl-0 = <&adc0_default>;
30+
pinctrl-names = "default";
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
status = "okay";
34+
35+
channel@3 {
36+
reg = <3>;
37+
zephyr,gain = "ADC_GAIN_1";
38+
zephyr,reference = "ADC_REF_INTERNAL";
39+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
40+
zephyr,resolution = <12>;
41+
zephyr,input-positive = <IADC_INPUT_AVDD>;
42+
};
43+
44+
channel@4 {
45+
reg = <4>;
46+
zephyr,gain = "ADC_GAIN_1";
47+
zephyr,reference = "ADC_REF_VDD_1";
48+
zephyr,vref-mv = <3000>;
49+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
50+
zephyr,resolution = <12>;
51+
zephyr,input-positive = <IADC_INPUT_PB3>;
52+
};
53+
};

0 commit comments

Comments
 (0)