-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: drivers: gpio: Add test for NFCT pins as GPIO
Add test that verifies correct operation of NFCT pins as GPIO. Signed-off-by: Sebastian Głąb <[email protected]>
- Loading branch information
1 parent
6e2d7d9
commit 9ca1f6a
Showing
10 changed files
with
187 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(gpio_nfct) | ||
|
||
FILE(GLOB app_sources ${ZEPHYR_NRF_MODULE_DIR}/tests/drivers/gpio/gpio_more_loops/src/main.c) | ||
target_sources(app PRIVATE ${app_sources}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
|
||
config TEST_DURATION | ||
int "Test duration in ms" | ||
default 4000 | ||
help | ||
Test will run for (at least) defined time. | ||
This value affects how many times GPIOs will be toggled. | ||
|
||
source "Kconfig.zephyr" |
1 change: 1 addition & 0 deletions
1
tests/drivers/gpio/gpio_nfct/boards/nrf54h20dk_nrf54h20_cpuapp.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_NRF_REGTOOL_VERBOSITY=1 |
34 changes: 34 additions & 0 deletions
34
tests/drivers/gpio/gpio_nfct/boards/nrf54h20dk_nrf54h20_cpuapp.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/ { | ||
/* Test requirements: | ||
* NFC antenna connected to the DK. | ||
*/ | ||
test_gpios { | ||
compatible = "gpio-leds"; | ||
out_gpios: out_gpios { | ||
gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
in_gpios: in_gpios { | ||
gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; | ||
}; | ||
|
||
&nfct { | ||
status = "okay"; /* not needed - APP is the default owner of NFCT */ | ||
}; | ||
|
||
&gpiote130 { | ||
status = "okay"; | ||
owned-channels = <7>; | ||
}; | ||
|
||
&gpio2 { | ||
status = "okay"; | ||
}; |
1 change: 1 addition & 0 deletions
1
tests/drivers/gpio/gpio_nfct/boards/nrf54h20dk_nrf54h20_cpurad.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_NRF_REGTOOL_VERBOSITY=1 |
34 changes: 34 additions & 0 deletions
34
tests/drivers/gpio/gpio_nfct/boards/nrf54h20dk_nrf54h20_cpurad.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/ { | ||
/* Test requirements: | ||
* NFC antenna connected to the DK. | ||
*/ | ||
test_gpios { | ||
compatible = "gpio-leds"; | ||
out_gpios: out_gpios { | ||
gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
in_gpios: in_gpios { | ||
gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; | ||
}; | ||
|
||
&nfct { | ||
status = "okay"; /* APP is the default owner of NFCT */ | ||
}; | ||
|
||
&gpiote130 { | ||
status = "okay"; | ||
owned-channels = <7>; | ||
}; | ||
|
||
&gpio2 { | ||
status = "okay"; | ||
}; |
33 changes: 33 additions & 0 deletions
33
tests/drivers/gpio/gpio_nfct/boards/nrf54l15dk_nrf54l15_cpuapp.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/ { | ||
/* Test requirements: | ||
* NFC antenna connected to the DK. | ||
*/ | ||
test_gpios { | ||
compatible = "gpio-leds"; | ||
out_gpios: out_gpios { | ||
gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
in_gpios: in_gpios { | ||
gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; | ||
}; | ||
|
||
&uicr { | ||
nfct-pins-as-gpios; | ||
}; | ||
|
||
&gpiote20 { | ||
status = "okay"; | ||
}; | ||
|
||
&gpio1 { | ||
status = "okay"; | ||
}; |
35 changes: 35 additions & 0 deletions
35
tests/drivers/gpio/gpio_nfct/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/ { | ||
/* Test requirements: | ||
* P1.00 shorted with P1.01; | ||
* P1.02 shorted with P1.03. | ||
* (NFC pins are P1.01 and P1.02) | ||
*/ | ||
test_gpios { | ||
compatible = "gpio-leds"; | ||
out_gpios: out_gpios { | ||
gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>, <&gpio1 2 GPIO_ACTIVE_HIGH>; | ||
}; | ||
|
||
in_gpios: in_gpios { | ||
gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>, <&gpio1 3 GPIO_ACTIVE_HIGH>; | ||
}; | ||
}; | ||
}; | ||
|
||
&uicr { | ||
nfct-pins-as-gpios; | ||
}; | ||
|
||
&gpiote20 { | ||
status = "okay"; | ||
}; | ||
|
||
&gpio1 { | ||
status = "okay"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_GPIO=y | ||
CONFIG_ZTEST=y | ||
CONFIG_LOG=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
common: | ||
tags: | ||
- drivers | ||
- gpio | ||
- ci_tests_drivers_gpio | ||
depends_on: gpio | ||
filter: not CONFIG_COVERAGE | ||
harness: ztest | ||
harness_config: | ||
fixture: gpio_loopback | ||
|
||
tests: | ||
drivers.gpio.gpio_nfct: | ||
platform_allow: | ||
- nrf54l15dk/nrf54l15/cpuapp | ||
- nrf54l20pdk/nrf54l20/cpuapp | ||
- nrf54h20dk/nrf54h20/cpuapp | ||
- nrf54h20dk/nrf54h20/cpurad | ||
integration_platforms: | ||
- nrf54l15dk/nrf54l15/cpuapp | ||
- nrf54l20pdk/nrf54l20/cpuapp | ||
- nrf54h20dk/nrf54h20/cpuapp |