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
1 change: 1 addition & 0 deletions boards/gd/gd32f350r_eval/gd32f350r_eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ toolchain:
supported:
- watchdog
- dma
- adc
vendor: gd
1 change: 1 addition & 0 deletions boards/nxp/lpcxpresso55s36/lpcxpresso55s36.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ toolchain:
- zephyr
- gnuarmemb
supported:
- adc
- arduino_gpio
- can
- dac
Expand Down
1 change: 1 addition & 0 deletions boards/renesas/ek_ra8m1/ek_ra8m1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ supported:
- i2s
- i3c
- crc
- adc
vendor: renesas
9 changes: 6 additions & 3 deletions samples/drivers/adc/adc_dt/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
sample:
name: ADC devicetree driver sample
common:
tags:
- adc
depends_on: adc
filter: dt_node_has_prop("/zephyr,user","io-channels")

tests:
sample.drivers.adc.adc_dt:
tags:
- adc
depends_on: adc
platform_allow:
- nucleo_l073rz
- nucleo_h753zi
Expand Down
1 change: 1 addition & 0 deletions samples/drivers/adc/adc_sequence/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ common:
tags:
- adc
depends_on: adc
filter: dt_alias_exists("adc0")
harness: console
timeout: 10
harness_config:
Expand Down
11 changes: 11 additions & 0 deletions scripts/pylib/twister/expr_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,17 @@ def ast_expr(ast, env, edt):
if node and prop in node.props and node.props[prop].val:
return True
return False
elif ast[0] == "dt_node_has_prop":
# 1st arg 'label' must be a valid node alias or a node path
label = ast[1][0]
try:
node = edt.get_node(label)
Comment on lines +284 to +287
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not name this variable path (as the get_node() parameter is named)? label is a bit confusing.

Copy link
Contributor Author

@JarmouniA JarmouniA Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be an alias too, but I agree it's confusing, will recheck in a follow-up PR to document these expressions and address #94585 (comment)

except Exception:
return False
prop = ast[1][1]
if prop in node.props:
return True
return False


mutex = threading.Lock()
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/adc/adc_accuracy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(dac_accuracy)
project(adc_accuracy)

target_sources(app PRIVATE src/main.c)
target_sources_ifdef(CONFIG_REFERENCE_VOLTAGE_TEST app PRIVATE src/ref_volt.c)
Expand Down
11 changes: 7 additions & 4 deletions tests/drivers/adc/adc_accuracy_test/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ source "Kconfig.zephyr"
ZEPHYR_USER := zephyr,user

config DAC_SOURCE_TEST
bool
bool "Test using a DAC source"
select DAC
default y if $(dt_node_has_prop,/$(ZEPHYR_USER),dac)
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),dac)
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),dac-channel-id)
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),dac-resolution)

config REFERENCE_VOLTAGE_TEST
bool
default y if $(dt_node_has_prop,/$(ZEPHYR_USER),reference-mv)
bool "Test using a ref voltage source"
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),reference-mv)
depends on $(dt_node_has_prop,/$(ZEPHYR_USER),expected-accuracy)

config NUMBER_OF_PASSES
int "Number of passes"
Expand Down
10 changes: 10 additions & 0 deletions tests/drivers/adc/adc_accuracy_test/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ common:
- drivers
depends_on:
- adc
filter: dt_node_has_prop("/zephyr,user","io-channels")

tests:
drivers.adc.accuracy.dac_source:
depends_on:
- dac
extra_configs:
- CONFIG_DAC_SOURCE_TEST=y
# Test scenario is filtered if Kconfig dependencies are not satisfied
filter: CONFIG_DAC_SOURCE_TEST
harness_config:
fixture: dac_adc_loopback
platform_allow:
- frdm_k64f
drivers.adc.accuracy.ref_volt:
extra_configs:
- CONFIG_REFERENCE_VOLTAGE_TEST=y
# Test scenario is filtered if Kconfig dependencies are not satisfied
filter: CONFIG_REFERENCE_VOLTAGE_TEST
harness_config:
fixture: adc_ref_volt
platform_allow:
Expand Down
32 changes: 13 additions & 19 deletions tests/drivers/adc/adc_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ common:
- adc
- drivers
- userspace
depends_on: adc
filter: dt_node_has_prop("/zephyr,user","io-channels")
min_flash: 40

tests:
drivers.adc:
depends_on: adc
min_flash: 40
platform_exclude:
- nucleo_u031r8
- panb611evb/nrf54l15/cpuapp
Expand All @@ -21,28 +23,19 @@ tests:
- rpi_pico/rp2040/w/mcuboot
- rpi_pico2/rp2350a/m33/mcuboot
- rpi_pico2/rp2350a/m33/w/mcuboot
drivers.adc.b_u585i_iot02a_adc4:
extra_args:
- DTC_OVERLAY_FILE="boards/b_u585i_iot02a_adc4.overlay"
platform_allow:
- b_u585i_iot02a
drivers.adc.nucleo_f103rb_dma:
extra_args:
- DTC_OVERLAY_FILE="boards/nucleo_f103rb_dma.overlay"
- EXTRA_CONF_FILE="overlay-dma-stm32.conf"
platform_allow:
- nucleo_f103rb
- platform:b_u585i_iot02a/stm32u585xx:DTC_OVERLAY_FILE="boards/b_u585i_iot02a_adc4.overlay"
integration_platforms:
- native_sim
- native_sim/native/64
drivers.adc.dma_st_stm32:
extra_args:
- EXTRA_CONF_FILE="overlay-dma-stm32.conf"
depends_on:
- adc
- dma
min_flash: 40
platform_allow:
- b_u585i_iot02a
- disco_l475_iot1
- nucleo_f091rc
- nucleo_f103rb
- nucleo_f207zg
- nucleo_f401re
- nucleo_f429zi
Expand All @@ -65,14 +58,16 @@ tests:
- stm32f3_disco
- stm32h573i_dk
- stm32u083c_dk
extra_args:
- EXTRA_CONF_FILE=overlay-dma-stm32.conf
- platform:nucleo_f103rb/stm32f103xb:DTC_OVERLAY_FILE="boards/nucleo_f103rb_dma.overlay"
integration_platforms:
- disco_l475_iot1
- nucleo_l476rg
drivers.adc.dma_nxp_kinetis:
extra_args:
- EXTRA_CONF_FILE="overlay-dma-kinetis.conf"
depends_on:
- adc
- dma
min_flash: 40
platform_allow:
Expand All @@ -82,10 +77,9 @@ tests:
- frdm_k82f
drivers.adc.dma_espressif:
extra_args:
- DTC_OVERLAY_FILE="boards/esp32s3_devkitc_procpu.overlay"
- platform:esp32s3_devkitc/esp32s3/procpu:DTC_OVERLAY_FILE="boards/esp32s3_devkitc_procpu.overlay"
- EXTRA_CONF_FILE="overlay-dma-esp32.conf"
depends_on:
- adc
- dma
platform_allow:
- esp32s3_devkitc/esp32s3/procpu
3 changes: 2 additions & 1 deletion tests/drivers/adc/adc_error_cases/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ common:
tags:
- adc
- drivers
depends_on: adc
filter: dt_alias_exists("adc")

tests:
drivers.adc_error_cases:
depends_on: adc
platform_allow:
- nrf52840dk/nrf52840
- nrf54l15dk/nrf54l15/cpuapp
Expand Down
Loading