From a97560775c04c50395b3e4e1557998bde6ad33be Mon Sep 17 00:00:00 2001 From: Agoston Kapitany Date: Tue, 30 Sep 2025 16:41:54 +0200 Subject: [PATCH] samples: adc_dt: adding silabs xg24_dk2601b Enable to test adc_dt sample with xg24_dk2601b board. Signed-off-by: Agoston Kapitany --- .../adc/adc_dt/boards/xg24_dk2601b.overlay | 77 +++++++++++++++++++ samples/drivers/adc/adc_dt/sample.yaml | 1 + 2 files changed, 78 insertions(+) create mode 100644 samples/drivers/adc/adc_dt/boards/xg24_dk2601b.overlay diff --git a/samples/drivers/adc/adc_dt/boards/xg24_dk2601b.overlay b/samples/drivers/adc/adc_dt/boards/xg24_dk2601b.overlay new file mode 100644 index 0000000000000..130c571199c3d --- /dev/null +++ b/samples/drivers/adc/adc_dt/boards/xg24_dk2601b.overlay @@ -0,0 +1,77 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * Copyright (c) 2025 Silicon Laboratories Inc. + */ + +#include +#include + +/* + * ch0: VDD: does not need analog bus + * ch1: button0 on GPIO port B2 pin: requires even analog bus + * ch2: button1 on GPIO port B3 pin: requires odd analog bus + * ch3: U.FL connector on AIN0 pin: does not need analog bus + */ + +/ { + zephyr,user { + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>; + }; +}; + +&pinctrl { + adc0_default: adc0_default { + group0 { + silabs,analog-bus = , ; + }; + }; +}; + +&adc0 { + pinctrl-0 = <&adc0_default>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + zephyr,input-positive = ; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_VDD_1"; + zephyr,vref-mv = <3300>; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + zephyr,input-positive = ; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_VDD_1"; + zephyr,vref-mv = <3300>; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + zephyr,input-positive = ; + }; + + channel@3 { + reg = <3>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_VDD_1"; + zephyr,vref-mv = <3300>; + zephyr,acquisition-time = ; + zephyr,resolution = <12>; + zephyr,input-positive = ; + }; + +}; diff --git a/samples/drivers/adc/adc_dt/sample.yaml b/samples/drivers/adc/adc_dt/sample.yaml index b6eaa02cf14ae..1d93617834c75 100644 --- a/samples/drivers/adc/adc_dt/sample.yaml +++ b/samples/drivers/adc/adc_dt/sample.yaml @@ -37,6 +37,7 @@ tests: - mcx_n9xx_evk/mcxn947/cpu0 - frdm_mcxc242 - ucans32k1sic + - xg24_dk2601b - xg24_rb4187c - xg29_rb4412a - raytac_an54l15q_db/nrf54l15/cpuapp