samples: drivers: adc: adc_dt: Add overlay for xg24_rb4187c

Add support for xg24_rb4187c to the ADC sample app. Configure two
channels, one measuring the AVDD supply against the 1.21V bandgap
reference, and one measuring pin PB1 (wired to button 0) against
the AVDD (VDDX) reference.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
This commit is contained in:
Aksel Skauge Mellbye 2025-01-24 11:15:30 +01:00 committed by Benjamin Cabé
parent 140e2c229b
commit bb381005b8
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,50 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright (c) 2025 Silicon Laboratories Inc.
*/
#include <dt-bindings/pinctrl/silabs/xg24-pinctrl.h>
#include <dt-bindings/adc/silabs-adc.h>
/ {
zephyr,user {
io-channels = <&adc0 3>, <&adc0 4>;
};
};
&pinctrl {
adc0_default: adc0_default {
group0 {
/* Allocate odd bus 0 on GPIO port B to IADC for access to pin PB1 */
silabs,analog-bus = <ABUS_BODD0_IADC0>;
};
};
};
&adc0 {
pinctrl-0 = <&adc0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@3 {
reg = <3>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
zephyr,input-positive = <IADC_INPUT_AVDD>;
};
channel@4 {
reg = <4>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_VDD_1";
zephyr,vref-mv = <3300>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
zephyr,input-positive = <IADC_INPUT_PB1>;
};
};

View File

@ -35,6 +35,7 @@ tests:
- frdm_mcxn947/mcxn947/cpu0
- frdm_mcxc242
- ucans32k1sic
- xg24_rb4187c
integration_platforms:
- nucleo_l073rz
- nrf52840dk/nrf52840