Skip to content

Commit 46d5142

Browse files
mstasiaknordicnordic-piks
authored andcommitted
tests: qdec: add nRF54LS05B support
Added support for nRF54LS05B in qdec tests. Signed-off-by: Michał Stasiak <[email protected]>
1 parent b8186b4 commit 46d5142

File tree

7 files changed

+169
-3
lines changed

7 files changed

+169
-3
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Two loopbacks are required:
3+
* P1.08 - P1.09
4+
* P1.10 - P1.11
5+
*/
6+
7+
/ {
8+
aliases {
9+
qdec0 = &qdec20;
10+
qenca = &phase_a;
11+
qencb = &phase_b;
12+
};
13+
14+
encoder-emulate {
15+
compatible = "gpio-leds";
16+
17+
phase_a: phase_a {
18+
gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
19+
};
20+
21+
phase_b: phase_b {
22+
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
23+
};
24+
};
25+
};
26+
27+
&pinctrl {
28+
qdec_pinctrl: qdec_pinctrl {
29+
group1 {
30+
psels = <NRF_PSEL(QDEC_A, 1, 9)>,
31+
<NRF_PSEL(QDEC_B, 1, 11)>;
32+
};
33+
};
34+
};
35+
36+
&gpio1 {
37+
status = "okay";
38+
};
39+
40+
&qdec20 {
41+
status = "okay";
42+
pinctrl-0 = <&qdec_pinctrl>;
43+
pinctrl-names = "default";
44+
steps = <120>;
45+
led-pre = <500>;
46+
};

samples/zephyr/sensor/qdec/sample.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ common:
1010

1111
tests:
1212
nrf.extended.sample.sensor.nrf_qdec_sensor:
13-
depends_on: future_target
13+
platform_allow:
14+
- nrf54ls05dk/nrf54ls05b/cpuapp
15+
- [email protected]/nrf54ls05b/cpuapp
16+
integration_platforms:
17+
- nrf54ls05dk/nrf54ls05b/cpuapp
1418
harness_config:
1519
fixture: gpio_loopback
1620
type: multi_line
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&pinctrl {
8+
qdec20_default_test: qdec20_default_test {
9+
group1 {
10+
psels = <NRF_PSEL(QDEC_A, 1, 10)>,
11+
<NRF_PSEL(QDEC_B, 1, 11)>;
12+
};
13+
};
14+
15+
qdec20_sleep_test: qdec20_sleep_test {
16+
group1 {
17+
psels = <NRF_PSEL(QDEC_A, 1, 10)>,
18+
<NRF_PSEL(QDEC_B, 1, 11)>;
19+
low-power-enable;
20+
};
21+
};
22+
};
23+
24+
&qdec20 {
25+
status = "okay";
26+
pinctrl-0 = <&qdec20_default_test>;
27+
pinctrl-1 = <&qdec20_sleep_test>;
28+
pinctrl-names = "default", "sleep";
29+
steps = <127>;
30+
led-pre = <500>;
31+
};

tests/drivers/qdec/qdec_instances/testcase.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ tests:
1111
- nrf54h20dk/nrf54h20/cpuapp
1212
- nrf54l15dk/nrf54l15/cpuapp
1313
- nrf54lm20dk/nrf54lm20a/cpuapp
14+
- [email protected]/nrf54ls05b/cpuapp
15+
- nrf54ls05dk/nrf54ls05b/cpuapp
1416
integration_platforms:
1517
- nrf54h20dk/nrf54h20/cpuapp
1618
- nrf54l15dk/nrf54l15/cpuapp
1719
- nrf54lm20dk/nrf54lm20a/cpuapp
20+
- nrf54ls05dk/nrf54ls05b/cpuapp
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
encoder-emulate {
9+
compatible = "gpio-leds";
10+
11+
phase_a: phase_a {
12+
gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
13+
};
14+
15+
phase_b: phase_b {
16+
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
17+
};
18+
};
19+
20+
qdec_loopbacks: loopbacks {
21+
compatible = "test-qdec-loopbacks";
22+
23+
loopback0 {
24+
qdec = <&qdec20>;
25+
qenc-emul-gpios = <&phase_a &phase_b>;
26+
};
27+
};
28+
};
29+
30+
&pinctrl {
31+
qdec_pinctrl: qdec_pinctrl {
32+
group1 {
33+
psels = <NRF_PSEL(QDEC_A, 1, 9)>,
34+
<NRF_PSEL(QDEC_B, 1, 11)>;
35+
};
36+
};
37+
38+
qdec_sleep_pinctrl: qdec_sleep_pinctrl {
39+
group1 {
40+
psels = <NRF_PSEL(QDEC_A, 1, 9)>,
41+
<NRF_PSEL(QDEC_B, 1, 11)>;
42+
low-power-enable;
43+
};
44+
};
45+
};
46+
47+
&gpio1 {
48+
status = "okay";
49+
};
50+
51+
&qdec20 {
52+
status = "okay";
53+
pinctrl-0 = <&qdec_pinctrl>;
54+
pinctrl-1 = <&qdec_sleep_pinctrl>;
55+
pinctrl-names = "default", "sleep";
56+
steps = <127>;
57+
led-pre = <500>;
58+
zephyr,pm-device-runtime-auto;
59+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
description: |
2+
Binding describing loopbacks required to run tests/boards/nrf/qdec test in Zephyr.
3+
4+
compatible: "test-qdec-loopbacks"
5+
6+
child-binding:
7+
description: |
8+
Binding describing a single loopback pair consisting of a QDEC device and two "gpio-leds" pins
9+
working as a quadrature encoder for the test.
10+
properties:
11+
qdec:
12+
type: phandle
13+
required: true
14+
description: Node of the QDEC device used to capture quadrature signal in the loopback.
15+
qenc-emul-gpios:
16+
type: phandles
17+
required: true
18+
description: |
19+
Children nodes of "gpio-leds" compatible used to generate quadrature signal. The first
20+
phandles outputs phase A signal, the second one outputs phase B signal.

tests/zephyr/boards/nrf/qdec/testcase.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
common:
2-
depends_on:
3-
- future_target
2+
platform_allow:
3+
- [email protected]/nrf54ls05b/cpuapp
4+
- nrf54ls05dk/nrf54ls05b/cpuapp
5+
integration_platforms:
6+
- nrf54ls05dk/nrf54ls05b/cpuapp
47
harness: ztest
58
harness_config:
69
fixture: gpio_loopback

0 commit comments

Comments
 (0)