Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: zephyr: boards: nrf: qdec: add support for l20 #20889

Merged
merged 1 commit into from
Mar 12, 2025
Merged
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
5 changes: 5 additions & 0 deletions scripts/ci/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1599,3 +1599,8 @@ ci_tests_zephyr_drivers_gpio:
files:
- nrf/tests/zephyr/drivers/gpio/
- zephyr/tests/drivers/gpio/

ci_tests_zephyr_boards_nrf_qdec:
files:
- nrf/tests/zephyr/boards/nrf/qdec/
- zephyr/tests/boards/nrf/qdec/
13 changes: 13 additions & 0 deletions tests/zephyr/boards/nrf/qdec/CMakeLists.txt
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(qdec_sensor)

FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/boards/nrf/qdec/src/*.c)
target_sources(app PRIVATE ${app_sources})
4 changes: 4 additions & 0 deletions tests/zephyr/boards/nrf/qdec/README.txt
Original file line number Diff line number Diff line change
@@ -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/boards/nrf/qdec.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};

encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
};
};

&pinctrl {
qdec_pinctrl: qdec_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
<NRF_PSEL(QDEC_B, 1, 10)>;
};
};

qdec_sleep_pinctrl: qdec_sleep_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
<NRF_PSEL(QDEC_B, 1, 10)>;
low-power-enable;
};
};
};

&gpio1 {
status = "okay";
};

&qdec20 {
status = "okay";
pinctrl-0 = <&qdec_pinctrl>;
pinctrl-1 = <&qdec_sleep_pinctrl>;
pinctrl-names = "default", "sleep";
steps = <127>;
led-pre = <500>;
zephyr,pm-device-runtime-auto;
};
3 changes: 3 additions & 0 deletions tests/zephyr/boards/nrf/qdec/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_ZTEST=y
CONFIG_SENSOR=y
CONFIG_GPIO=y
21 changes: 21 additions & 0 deletions tests/zephyr/boards/nrf/qdec/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
common:
platform_allow:
- nrf54l20pdk/nrf54l20/cpuapp
integration_platforms:
- nrf54l20pdk/nrf54l20/cpuapp
harness: ztest
harness_config:
fixture: gpio_loopback
tags:
- drivers
- sensors
- qdec
- ci_tests_zephyr_boards_nrf_qdec
tests:
nrf.extended.drivers.sensor.qdec: {}
nrf.extended.drivers.sensor.qdec.pm_runtime:
tags:
- pm
extra_configs:
- CONFIG_PM_DEVICE=y
- CONFIG_PM_DEVICE_RUNTIME=y