diff --git a/.github/test-spec.yml b/.github/test-spec.yml index a2d51c1955dc..cbd0755e3d96 100644 --- a/.github/test-spec.yml +++ b/.github/test-spec.yml @@ -621,6 +621,7 @@ - "include/drivers/gpio/**/*" - "include/event_manager_proxy.h" - "subsys/event_manager_proxy/**/*" + - "samples/zephyr/drivers/adc/**/*" - "samples/zephyr/drivers/audio/**/*" - "samples/zephyr/drivers/i2c/**/*" - "samples/zephyr/drivers/watchdog/**/*" @@ -641,6 +642,7 @@ - "tests/drivers/spi/**/*" - "tests/drivers/uart/**/*" - "tests/subsys/event_manager_proxy/**/*" + - "tests/zephyr/drivers/adc/**/*" - "tests/zephyr/drivers/comparator/**/*" - "tests/zephyr/drivers/gpio/**/*" - "tests/zephyr/drivers/flash/**/*" diff --git a/CODEOWNERS b/CODEOWNERS index d604f79b5185..6c0342b436a6 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -667,6 +667,7 @@ /samples/zigbee/**/*.rst @nrfconnect/ncs-terahertz-doc /samples/zephyr/basic/blinky/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus /samples/zephyr/boards/nordic/system_off/ @nrfconnect/ncs-low-level-test +/samples/zephyr/drivers/adc/ @nrfconnect/ncs-low-level-test /samples/zephyr/drivers/audio/dmic/ @nrfconnect/ncs-low-level-test /samples/zephyr/drivers/i2c/rtio_loopback/ @nrfconnect/ncs-low-level-test /samples/zephyr/drivers/watchdog/ @nrfconnect/ncs-low-level-test @@ -919,6 +920,7 @@ /tests/tfm/ @nrfconnect/ncs-aegir @stephen-nordic @magnev /tests/unity/ @nordic-krch /tests/subsys/zigbee/ @nrfconnect/ncs-zigbee +/tests/zephyr/drivers/adc/ @nrfconnect/ncs-low-level-test /tests/zephyr/drivers/comparator/ @nrfconnect/ncs-low-level-test /tests/zephyr/drivers/flash/common/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus /tests/zephyr/drivers/gpio/ @nrfconnect/ncs-low-level-test diff --git a/samples/zephyr/drivers/adc/adc_dt/CMakeLists.txt b/samples/zephyr/drivers/adc/adc_dt/CMakeLists.txt new file mode 100644 index 000000000000..d362f1b549b7 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_dt/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(ADC) + +FILE(GLOB app_sources ${ZEPHYR_BASE}/samples/drivers/adc/adc_dt/src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/samples/zephyr/drivers/adc/adc_dt/README.txt b/samples/zephyr/drivers/adc/adc_dt/README.txt new file mode 100644 index 000000000000..b88fe6ecc51c --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_dt/README.txt @@ -0,0 +1,4 @@ +This sample extends the same-named Zephyr sample to verify it +with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/drivers/adc/adc_dt. diff --git a/samples/zephyr/drivers/adc/adc_dt/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay b/samples/zephyr/drivers/adc/adc_dt/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay new file mode 100644 index 000000000000..afd9d1b9b62f --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_dt/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay @@ -0,0 +1,50 @@ +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; + }; +}; + +&adc { + #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,input-positive = ; /* P1.11 */ + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.06 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@7 { + reg = <7>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.13 */ + zephyr,input-negative = ; /* P1.14 */ + zephyr,resolution = <12>; + }; +}; diff --git a/samples/zephyr/drivers/adc/adc_dt/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/zephyr/drivers/adc/adc_dt/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 000000000000..afd9d1b9b62f --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_dt/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,50 @@ +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; + }; +}; + +&adc { + #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,input-positive = ; /* P1.11 */ + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.06 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@7 { + reg = <7>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.13 */ + zephyr,input-negative = ; /* P1.14 */ + zephyr,resolution = <12>; + }; +}; diff --git a/samples/zephyr/drivers/adc/adc_dt/prj.conf b/samples/zephyr/drivers/adc/adc_dt/prj.conf new file mode 100644 index 000000000000..488a81dca520 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_dt/prj.conf @@ -0,0 +1 @@ +CONFIG_ADC=y diff --git a/samples/zephyr/drivers/adc/adc_dt/sample.yaml b/samples/zephyr/drivers/adc/adc_dt/sample.yaml new file mode 100644 index 000000000000..37a488b6b47d --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_dt/sample.yaml @@ -0,0 +1,21 @@ +sample: + name: ADC devicetree driver sample +tests: + nrf.extended.sample.drivers.adc.adc_dt: + tags: + - adc + - ci_samples_zephyr_drivers_adc + # depends_on: adc + integration_platforms: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + harness: console + timeout: 10 + harness_config: + type: multi_line + regex: + - "ADC reading\\[\\d+\\]:" + - "- .+, channel \\d+: -?\\d+" diff --git a/samples/zephyr/drivers/adc/adc_sequence/CMakeLists.txt b/samples/zephyr/drivers/adc/adc_sequence/CMakeLists.txt new file mode 100644 index 000000000000..fa159c7faf0e --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(ADC) + +FILE(GLOB app_sources ${ZEPHYR_BASE}/samples/drivers/adc/adc_sequence/src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/samples/zephyr/drivers/adc/adc_sequence/Kconfig b/samples/zephyr/drivers/adc/adc_sequence/Kconfig new file mode 100644 index 000000000000..df907c7d5580 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/Kconfig @@ -0,0 +1 @@ +source "samples/drivers/adc/adc_sequence/Kconfig" diff --git a/samples/zephyr/drivers/adc/adc_sequence/README.txt b/samples/zephyr/drivers/adc/adc_sequence/README.txt new file mode 100644 index 000000000000..df0c0c402e64 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/README.txt @@ -0,0 +1,4 @@ +This sample extends the same-named Zephyr sample to verify it +with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/drivers/adc/adc_sequence. diff --git a/samples/zephyr/drivers/adc/adc_sequence/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay b/samples/zephyr/drivers/adc/adc_sequence/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay new file mode 100644 index 000000000000..c004f356da67 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay @@ -0,0 +1,56 @@ +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; + }; +}; + +/ { + aliases { + adc0 = &adc; + }; +}; + +&adc { + #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,input-positive = ; /* P1.11 */ + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.06 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* 0.9 V internal */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@7 { + reg = <7>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.13 */ + zephyr,input-negative = ; /* P1.14 */ + zephyr,resolution = <12>; + }; +}; diff --git a/samples/zephyr/drivers/adc/adc_sequence/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/samples/zephyr/drivers/adc/adc_sequence/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 000000000000..c004f356da67 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,56 @@ +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 7>; + }; +}; + +/ { + aliases { + adc0 = &adc; + }; +}; + +&adc { + #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,input-positive = ; /* P1.11 */ + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.06 */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* 0.9 V internal */ + zephyr,resolution = <12>; + zephyr,oversampling = <8>; + }; + + channel@7 { + reg = <7>; + zephyr,gain = "ADC_GAIN_1"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; /* P1.13 */ + zephyr,input-negative = ; /* P1.14 */ + zephyr,resolution = <12>; + }; +}; diff --git a/samples/zephyr/drivers/adc/adc_sequence/prj.conf b/samples/zephyr/drivers/adc/adc_sequence/prj.conf new file mode 100644 index 000000000000..488a81dca520 --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/prj.conf @@ -0,0 +1 @@ +CONFIG_ADC=y diff --git a/samples/zephyr/drivers/adc/adc_sequence/sample.yaml b/samples/zephyr/drivers/adc/adc_sequence/sample.yaml new file mode 100644 index 000000000000..22d5a302c1cf --- /dev/null +++ b/samples/zephyr/drivers/adc/adc_sequence/sample.yaml @@ -0,0 +1,22 @@ +sample: + name: ADC driver sequence sample +tests: + nrf.extended.sample.drivers.adc.adc_sequence: + tags: + - adc + - ci_samples_zephyr_drivers_adc + # depends_on: adc + integration_platforms: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + harness: console + timeout: 10 + harness_config: + type: multi_line + regex: + - "ADC sequence reading \\[\\d+\\]:" + - "- .+, channel \\d+, \\d+ sequence samples:" + - "- - \\d+ (= \\d+mV)|(\\(value in mV not available\\))" diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index 67783893570b..d1fc4598ce83 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -1604,3 +1604,13 @@ ci_tests_zephyr_boards_nrf_qdec: files: - nrf/tests/zephyr/boards/nrf/qdec/ - zephyr/tests/boards/nrf/qdec/ + +ci_tests_zephyr_drivers_adc: + files: + - nrf/tests/zephyr/drivers/adc/ + - zephyr/tests/drivers/adc/ + +ci_samples_zephyr_drivers_adc: + files: + - nrf/samples/zephyr/drivers/adc/ + - zephyr/samples/drivers/adc/ diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/CMakeLists.txt b/tests/zephyr/drivers/adc/adc_accuracy_test/CMakeLists.txt new file mode 100644 index 000000000000..324e45e8d4a5 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(adc_accuracy) + +target_sources(app PRIVATE ${ZEPHYR_BASE}/tests/drivers/adc/adc_accuracy_test/src/main.c) +target_sources_ifdef(CONFIG_REFERENCE_VOLTAGE_TEST app PRIVATE ${ZEPHYR_BASE}/tests/drivers/adc/adc_accuracy_test/src/ref_volt.c) diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/Kconfig b/tests/zephyr/drivers/adc/adc_accuracy_test/Kconfig new file mode 100644 index 000000000000..ed505bab1874 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/Kconfig @@ -0,0 +1 @@ +source "tests/drivers/adc/adc_accuracy_test/Kconfig" diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/README.txt b/tests/zephyr/drivers/adc/adc_accuracy_test/README.txt new file mode 100644 index 000000000000..ef5e615f8be0 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/README.txt @@ -0,0 +1,4 @@ +This sample extends the same-named Zephyr sample to verify it +with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/adc/adc_accuracy_test. diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay b/tests/zephyr/drivers/adc/adc_accuracy_test/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay new file mode 100644 index 000000000000..0f8999597713 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay @@ -0,0 +1,22 @@ +/ { + zephyr,user { + io-channels = <&adc 0>; + reference_mv = <1800>; + expected_accuracy = <64>; + }; +}; + +&adc { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <14>; + }; +}; diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay b/tests/zephyr/drivers/adc/adc_accuracy_test/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay new file mode 100644 index 000000000000..0f8999597713 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay @@ -0,0 +1,22 @@ +/ { + zephyr,user { + io-channels = <&adc 0>; + reference_mv = <1800>; + expected_accuracy = <64>; + }; +}; + +&adc { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + channel@0 { + reg = <0>; + zephyr,gain = "ADC_GAIN_1_2"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <14>; + }; +}; diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/prj.conf b/tests/zephyr/drivers/adc/adc_accuracy_test/prj.conf new file mode 100644 index 000000000000..c82d81afb566 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/prj.conf @@ -0,0 +1,2 @@ +CONFIG_ZTEST=y +CONFIG_ADC=y diff --git a/tests/zephyr/drivers/adc/adc_accuracy_test/testcase.yaml b/tests/zephyr/drivers/adc/adc_accuracy_test/testcase.yaml new file mode 100644 index 000000000000..6133878f7637 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_accuracy_test/testcase.yaml @@ -0,0 +1,15 @@ +common: + tags: + - adc + - drivers + - ci_tests_zephyr_drivers_adc +tests: + nrf.extended.drivers.adc.accuracy.ref_volt: + # harness_config: + # fixture: adc_ref_volt + integration_platforms: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp + - nrf54l20pdk/nrf54l20/cpuapp diff --git a/tests/zephyr/drivers/adc/adc_api/CMakeLists.txt b/tests/zephyr/drivers/adc/adc_api/CMakeLists.txt new file mode 100644 index 000000000000..51d1909ea8be --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_api/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(adc_api) + +FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/adc/adc_api/src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/zephyr/drivers/adc/adc_api/Kconfig b/tests/zephyr/drivers/adc/adc_api/Kconfig new file mode 100644 index 000000000000..a46bf441c616 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_api/Kconfig @@ -0,0 +1 @@ +source "tests/drivers/adc/adc_api/Kconfig" diff --git a/tests/zephyr/drivers/adc/adc_api/README.txt b/tests/zephyr/drivers/adc/adc_api/README.txt new file mode 100644 index 000000000000..2e5f45bbd889 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_api/README.txt @@ -0,0 +1,4 @@ +This sample extends the same-named Zephyr sample to verify it +with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/adc/adc_api. diff --git a/tests/zephyr/drivers/adc/adc_api/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay b/tests/zephyr/drivers/adc/adc_api/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay new file mode 100644 index 000000000000..3e85ed0792f5 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_api/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay @@ -0,0 +1,38 @@ +/ { + zephyr,user { + io-channels = <&adc 0>, <&adc 1> , <&adc 2>; + }; +}; + +&adc { + #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,input-positive = ; + zephyr,resolution = <10>; + }; + + channel@1 { + reg = <1>; + zephyr,gain = "ADC_GAIN_1_4"; + zephyr,reference = "ADC_REF_EXTERNAL0"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <12>; + }; + + channel@2 { + reg = <2>; + zephyr,gain = "ADC_GAIN_2_3"; + zephyr,reference = "ADC_REF_INTERNAL"; + zephyr,acquisition-time = ; + zephyr,input-positive = ; + zephyr,resolution = <10>; + }; +}; diff --git a/tests/zephyr/drivers/adc/adc_api/prj.conf b/tests/zephyr/drivers/adc/adc_api/prj.conf new file mode 100644 index 000000000000..d95ab6031c27 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_api/prj.conf @@ -0,0 +1,7 @@ +CONFIG_ZTEST=y + +CONFIG_ADC=y +CONFIG_ADC_ASYNC=y +CONFIG_ADC_LOG_LEVEL_INF=y +CONFIG_HEAP_MEM_POOL_SIZE=1024 +CONFIG_TEST_USERSPACE=y diff --git a/tests/zephyr/drivers/adc/adc_api/testcase.yaml b/tests/zephyr/drivers/adc/adc_api/testcase.yaml new file mode 100644 index 000000000000..1b5b305bf5bb --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_api/testcase.yaml @@ -0,0 +1,12 @@ +common: + tags: + - adc + - drivers + - userspace + - ci_tests_zephyr_drivers_adc +tests: + nrf.extended.drivers.adc: + integration_platforms: + - nrf54l09pdk/nrf54l09/cpuapp + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp diff --git a/tests/zephyr/drivers/adc/adc_error_cases/CMakeLists.txt b/tests/zephyr/drivers/adc/adc_error_cases/CMakeLists.txt new file mode 100644 index 000000000000..5065eb55aa15 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_error_cases/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(adc_error_cases) + +FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/adc/adc_error_cases/src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/zephyr/drivers/adc/adc_error_cases/README.txt b/tests/zephyr/drivers/adc/adc_error_cases/README.txt new file mode 100644 index 000000000000..d9103aa5e84e --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_error_cases/README.txt @@ -0,0 +1,4 @@ +This sample extends the same-named Zephyr sample to verify it +with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/adc/adc_error_cases. diff --git a/tests/zephyr/drivers/adc/adc_error_cases/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay b/tests/zephyr/drivers/adc/adc_error_cases/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay new file mode 100644 index 000000000000..30fc47336c6d --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_error_cases/boards/nrf54l09pdk_nrf54l09_cpuapp.overlay @@ -0,0 +1,9 @@ +/ { + aliases { + adc = &adc; + }; +}; + +&adc { + status = "okay"; +}; diff --git a/tests/zephyr/drivers/adc/adc_error_cases/prj.conf b/tests/zephyr/drivers/adc/adc_error_cases/prj.conf new file mode 100644 index 000000000000..40f19db980dc --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_error_cases/prj.conf @@ -0,0 +1,3 @@ +CONFIG_ZTEST=y + +CONFIG_ADC=y diff --git a/tests/zephyr/drivers/adc/adc_error_cases/testcase.yaml b/tests/zephyr/drivers/adc/adc_error_cases/testcase.yaml new file mode 100644 index 000000000000..15c4788ad9e7 --- /dev/null +++ b/tests/zephyr/drivers/adc/adc_error_cases/testcase.yaml @@ -0,0 +1,11 @@ +common: + tags: + - adc + - drivers + - ci_tests_zephyr_drivers_adc +tests: + nrf.extended.drivers.adc_error_cases: + integration_platforms: + - nrf54l09pdk/nrf54l09/cpuapp + platform_allow: + - nrf54l09pdk/nrf54l09/cpuapp