Skip to content

Commit 6793b30

Browse files
committed
tests: zephyr: boards: nrf: qdec: add support for l20
base on zephyr Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
1 parent 12c1e54 commit 6793b30

File tree

6 files changed

+94
-0
lines changed

6 files changed

+94
-0
lines changed

scripts/ci/tags.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -1599,3 +1599,8 @@ ci_tests_zephyr_drivers_gpio:
15991599
files:
16001600
- nrf/tests/zephyr/drivers/gpio/
16011601
- zephyr/tests/drivers/gpio/
1602+
1603+
ci_tests_zephyr_boards_nrf_qdec:
1604+
files:
1605+
- nrf/tests/zephyr/boards/nrf/qdec/
1606+
- zephyr/tests/boards/nrf/qdec/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(qdec_sensor)
11+
12+
FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/boards/nrf/qdec/src/*.c)
13+
target_sources(app PRIVATE ${app_sources})
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This sample extends the same-named Zephyr sample to verify it
2+
with Nordic development kits.
3+
4+
Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/boards/nrf/qdec.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/ {
2+
aliases {
3+
qdec0 = &qdec20;
4+
qenca = &phase_a;
5+
qencb = &phase_b;
6+
};
7+
8+
encoder-emulate {
9+
compatible = "gpio-leds";
10+
phase_a: phase_a {
11+
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
12+
};
13+
phase_b: phase_b {
14+
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
15+
};
16+
};
17+
};
18+
19+
&pinctrl {
20+
qdec_pinctrl: qdec_pinctrl {
21+
group1 {
22+
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
23+
<NRF_PSEL(QDEC_B, 1, 10)>;
24+
};
25+
};
26+
27+
qdec_sleep_pinctrl: qdec_sleep_pinctrl {
28+
group1 {
29+
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
30+
<NRF_PSEL(QDEC_B, 1, 10)>;
31+
low-power-enable;
32+
};
33+
};
34+
};
35+
36+
&gpio1 {
37+
status = "okay";
38+
};
39+
40+
&qdec20 {
41+
status = "okay";
42+
pinctrl-0 = <&qdec_pinctrl>;
43+
pinctrl-1 = <&qdec_sleep_pinctrl>;
44+
pinctrl-names = "default", "sleep";
45+
steps = <127>;
46+
led-pre = <500>;
47+
zephyr,pm-device-runtime-auto;
48+
};

tests/zephyr/boards/nrf/qdec/prj.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_ZTEST=y
2+
CONFIG_SENSOR=y
3+
CONFIG_GPIO=y
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
common:
2+
platform_allow:
3+
- nrf54l20pdk/nrf54l20/cpuapp
4+
integration_platforms:
5+
- nrf54l20pdk/nrf54l20/cpuapp
6+
harness: ztest
7+
harness_config:
8+
fixture: gpio_loopback
9+
tags:
10+
- drivers
11+
- sensors
12+
- qdec
13+
- ci_tests_zephyr_boards_nrf_qdec
14+
tests:
15+
nrf.extended.drivers.sensor.qdec: {}
16+
nrf.extended.drivers.sensor.qdec.pm_runtime:
17+
tags:
18+
- pm
19+
extra_configs:
20+
- CONFIG_PM_DEVICE=y
21+
- CONFIG_PM_DEVICE_RUNTIME=y

0 commit comments

Comments
 (0)