Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions boards/silabs/radio_boards/slwrb4180a/slwrb4180a-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
silabs,input-filter;
};
};

iadc0_default: iadc0_default {
group0 {
silabs,analog-bus = <ABUS_AEVEN0_IADC0>;
};
};
};
55 changes: 55 additions & 0 deletions boards/silabs/radio_boards/slwrb4180a/slwrb4180a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/dts-v1/;
#include <silabs/xg21/efr32mg21a020f1024im32.dtsi>
#include <dt-bindings/adc/silabs-adc.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "slwrb4180a-pinctrl.dtsi"

Expand All @@ -30,6 +31,7 @@
sw0 = &button0;
sw1 = &button1;
watchdog0 = &wdog0;
adc0 = &adc0;
};

leds {
Expand Down Expand Up @@ -64,6 +66,37 @@
};
};

joystick {
compatible = "adc-keys";
io-channels = <&adc0 0>;
keyup-threshold-mv = <3300>;

select-key {
press-thresholds-mv = <33>;
zephyr,code = <INPUT_KEY_ENTER>;
};

left-key {
press-thresholds-mv = <1980>;
zephyr,code = <INPUT_KEY_LEFT>;
};

down-key {
press-thresholds-mv = <1650>;
zephyr,code = <INPUT_KEY_DOWN>;
};

up-key {
press-thresholds-mv = <2831>;
zephyr,code = <INPUT_KEY_UP>;
};

right-key {
press-thresholds-mv = <2533>;
zephyr,code = <INPUT_KEY_RIGHT>;
};
};

exp_header: exp-header {
compatible = "silabs,exp-header";
#gpio-cells = <2>;
Expand All @@ -80,6 +113,10 @@
gpio-map-mask = <0xffffffff 0x0>;
gpio-map-pass-thru = <0x0 GPIO_DT_FLAGS_MASK>;
};

zephyr,user {
io-channels = <&adc0 0>;
};
};

&cpu0 {
Expand Down Expand Up @@ -128,6 +165,24 @@
clocks = <&lfxo>;
};

&adc0 {
pinctrl-0 = <&iadc0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

channel@0 {
reg = <0>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,gain = "ADC_GAIN_1";
zephyr,input-positive = <IADC_INPUT_PA0>;
zephyr,reference = "ADC_REF_VDD_1";
zephyr,resolution = <12>;
zephyr,vref-mv = <3300>;
};
};

&usart0 {
current-speed = <115200>;
pinctrl-0 = <&usart0_default>;
Expand Down
6 changes: 6 additions & 0 deletions boards/silabs/radio_boards/slwrb4180b/slwrb4180b-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@
silabs,input-filter;
};
};

iadc0_default: iadc0_default {
group0 {
silabs,analog-bus = <ABUS_AEVEN0_IADC0>;
};
};
};
55 changes: 55 additions & 0 deletions boards/silabs/radio_boards/slwrb4180b/slwrb4180b.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/dts-v1/;
#include <silabs/xg21/efr32mg21a020f1024im32.dtsi>
#include <dt-bindings/adc/silabs-adc.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include "slwrb4180b-pinctrl.dtsi"

Expand All @@ -30,6 +31,7 @@
sw0 = &button0;
sw1 = &button1;
watchdog0 = &wdog0;
adc0 = &adc0;
};

leds {
Expand Down Expand Up @@ -62,6 +64,37 @@
};
};

joystick {
compatible = "adc-keys";
io-channels = <&adc0 0>;
keyup-threshold-mv = <3300>;

select-key {
press-thresholds-mv = <33>;
zephyr,code = <INPUT_KEY_ENTER>;
};

left-key {
press-thresholds-mv = <1980>;
zephyr,code = <INPUT_KEY_LEFT>;
};

down-key {
press-thresholds-mv = <1650>;
zephyr,code = <INPUT_KEY_DOWN>;
};

up-key {
press-thresholds-mv = <2831>;
zephyr,code = <INPUT_KEY_UP>;
};

right-key {
press-thresholds-mv = <2533>;
zephyr,code = <INPUT_KEY_RIGHT>;
};
};

exp_header: exp-header {
compatible = "silabs,exp-header";
#gpio-cells = <2>;
Expand All @@ -78,6 +111,10 @@
gpio-map-mask = <0xffffffff 0x0>;
gpio-map-pass-thru = <0x0 GPIO_DT_FLAGS_MASK>;
};

zephyr,user {
io-channels = <&adc0 0>;
};
};

&cpu0 {
Expand Down Expand Up @@ -126,6 +163,24 @@
clocks = <&lfxo>;
};

&adc0 {
pinctrl-0 = <&iadc0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

channel@0 {
reg = <0>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,gain = "ADC_GAIN_1";
zephyr,input-positive = <IADC_INPUT_PA0>;
zephyr,reference = "ADC_REF_VDD_1";
zephyr,resolution = <12>;
zephyr,vref-mv = <3300>;
};
};

&usart0 {
current-speed = <115200>;
pinctrl-0 = <&usart0_default>;
Expand Down
1 change: 1 addition & 0 deletions boards/silabs/radio_boards/xg27/xg27_rb4194a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
sw1 = &button1;
watchdog0 = &wdog0;
dht0 = &si7021;
adc0 = &adc0;
};

leds {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
};
};

iadc0_default: iadc0_default {
group0 {
silabs,analog-bus = <ABUS_CDODD0_IADC0>;
};
};

itm_default: itm_default {
group0 {
pins = <GPIO_SWV_PA3>;
Expand Down
55 changes: 55 additions & 0 deletions boards/silabs/radio_boards/xg29_rb4412a/xg29_rb4412a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/dts-v1/;
#include <silabs/xg29/efr32mg29b140f1024im40.dtsi>
#include <dt-bindings/adc/silabs-adc.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/regulator/silabs_dcdc.h>
Expand Down Expand Up @@ -35,6 +36,7 @@
sw1 = &button1;
watchdog0 = &wdog0;
dht0 = &si7021;
adc0 = &adc0;
};

leds {
Expand Down Expand Up @@ -75,6 +77,37 @@
};
};

joystick {
compatible = "adc-keys";
io-channels = <&adc0 0>;
keyup-threshold-mv = <3300>;

select-key {
press-thresholds-mv = <33>;
zephyr,code = <INPUT_KEY_ENTER>;
};

left-key {
press-thresholds-mv = <1980>;
zephyr,code = <INPUT_KEY_LEFT>;
};

down-key {
press-thresholds-mv = <1650>;
zephyr,code = <INPUT_KEY_DOWN>;
};

up-key {
press-thresholds-mv = <2831>;
zephyr,code = <INPUT_KEY_UP>;
};

right-key {
press-thresholds-mv = <2533>;
zephyr,code = <INPUT_KEY_RIGHT>;
};
};

display_enable: sensor_enable: gpio_switch_0 {
compatible = "regulator-fixed";
enable-gpios = <&gpioc 7 GPIO_ACTIVE_HIGH>;
Expand All @@ -98,6 +131,10 @@
gpio-map-mask = <0xffffffff 0x0>;
gpio-map-pass-thru = <0x0 GPIO_DT_FLAGS_MASK>;
};

zephyr,user {
io-channels = <&adc0 0>;
};
};

&cpu0 {
Expand Down Expand Up @@ -210,6 +247,24 @@
};
};

&adc0 {
pinctrl-0 = <&iadc0_default>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

channel@0 {
reg = <0>;
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,gain = "ADC_GAIN_1";
zephyr,input-positive = <IADC_INPUT_PD3>;
zephyr,reference = "ADC_REF_VDD_1";
zephyr,resolution = <12>;
zephyr,vref-mv = <3300>;
};
};

&gpio {
status = "okay";
};
Expand Down
5 changes: 5 additions & 0 deletions doc/releases/migration-guide-4.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ Device Drivers and Devicetree

.. zephyr-keep-sorted-start re(^\w)

ADC
===

* :dtcompatible:`silabs,gecko-iadc` has been replaced by :dtcompatible:`silabs,iadc`.

MFD
===

Expand Down
1 change: 1 addition & 0 deletions drivers/adc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ zephyr_library_sources_ifdef(CONFIG_ADC_XMC4XXX adc_xmc4xxx.c)
zephyr_library_sources_ifdef(CONFIG_ADC_ESP32 adc_esp32.c)
zephyr_library_sources_ifdef(CONFIG_ADC_GECKO_ADC adc_gecko.c)
zephyr_library_sources_ifdef(CONFIG_ADC_GECKO_IADC iadc_gecko.c)
zephyr_library_sources_ifdef(CONFIG_ADC_SILABS_IADC adc_silabs_iadc.c)
zephyr_library_sources_ifdef(CONFIG_ADC_SILABS_SIWX91X adc_silabs_siwx91x.c)
zephyr_library_sources_ifdef(CONFIG_ADC_INFINEON_CAT1 adc_ifx_cat1.c)
zephyr_library_sources_ifdef(CONFIG_ADC_SMARTBOND_GPADC adc_smartbond_gpadc.c)
Expand Down
2 changes: 2 additions & 0 deletions drivers/adc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ source "drivers/adc/Kconfig.gecko"

source "drivers/adc/Kconfig.siwx91x"

source "drivers/adc/Kconfig.silabs"

source "drivers/adc/Kconfig.ifx_cat1"

source "drivers/adc/Kconfig.smartbond"
Expand Down
20 changes: 20 additions & 0 deletions drivers/adc/Kconfig.silabs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

config ADC_SILABS_IADC
bool "Silabs Incremental ADC driver"
default y
depends on DT_HAS_SILABS_IADC_ENABLED
select SILABS_SISDK_IADC
select ADC_CONFIGURABLE_INPUTS
help
Enable the driver implementation for Silabs Incremental ADC

config ADC_SILABS_IADC_DMA
bool "Silabs IADC async DMA support"
depends on ADC_SILABS_IADC
depends on DMA
help
Enable DMA support with the Silabs IADC driver.
This allows ADC conversions to be performed (asynchronously or not)
using DMA for improved performance.
Loading