Skip to content

Commit 4ac9de1

Browse files
committed
tests: zephyr: boards: nrf: qdec: enable qdec for LM20 DK
LM20 DK. Signed-off-by: Piotr Kosycarz <[email protected]>
1 parent 41c53a8 commit 4ac9de1

File tree

6 files changed

+104
-10
lines changed

6 files changed

+104
-10
lines changed

samples/zephyr/sensor/qdec/boards/nrf54lm20apdk_nrf54lm20a_cpuapp.overlay

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
encoder-emulate {
99
compatible = "gpio-leds";
1010
phase_a: phase_a {
11-
gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
11+
gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
1212
};
1313
phase_b: phase_b {
14-
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
14+
gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
1515
};
1616
};
1717
};
1818

1919
&pinctrl {
2020
qdec_pinctrl: qdec_pinctrl {
2121
group1 {
22-
psels = <NRF_PSEL(QDEC_A, 1, 9)>,
23-
<NRF_PSEL(QDEC_B, 1, 11)>;
22+
psels = <NRF_PSEL(QDEC_A, 1, 16)>,
23+
<NRF_PSEL(QDEC_B, 1, 24)>;
2424
};
2525
};
2626
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 8 GPIO_ACTIVE_HIGH>;
12+
};
13+
phase_b: phase_b {
14+
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
15+
};
16+
};
17+
};
18+
19+
&pinctrl {
20+
qdec_pinctrl: qdec_pinctrl {
21+
group1 {
22+
psels = <NRF_PSEL(QDEC_A, 1, 9)>,
23+
<NRF_PSEL(QDEC_B, 1, 11)>;
24+
};
25+
};
26+
};
27+
28+
&gpio1 {
29+
status = "okay";
30+
};
31+
32+
&qdec20 {
33+
status = "okay";
34+
pinctrl-0 = <&qdec_pinctrl>;
35+
pinctrl-names = "default";
36+
steps = <120>;
37+
led-pre = <500>;
38+
};

samples/zephyr/sensor/qdec/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tests:
1313
platform_allow:
1414
- nrf54l20pdk/nrf54l20/cpuapp
1515
- nrf54lm20apdk/nrf54lm20a/cpuapp
16+
- [email protected]/nrf54lm20a/cpuapp
1617
integration_platforms:
1718
- nrf54l20pdk/nrf54l20/cpuapp
1819
- nrf54lm20apdk/nrf54lm20a/cpuapp

tests/zephyr/boards/nrf/qdec/boards/nrf54lm20apdk_nrf54lm20a_cpuapp.overlay

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@
1414
encoder-emulate {
1515
compatible = "gpio-leds";
1616
phase_a: phase_a {
17-
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
17+
gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
1818
};
1919
phase_b: phase_b {
20-
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
20+
gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
2121
};
2222
};
2323
};
2424

2525
&pinctrl {
2626
qdec_pinctrl: qdec_pinctrl {
2727
group1 {
28-
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
29-
<NRF_PSEL(QDEC_B, 1, 10)>;
28+
psels = <NRF_PSEL(QDEC_A, 1, 16)>,
29+
<NRF_PSEL(QDEC_B, 1, 24)>;
3030
};
3131
};
3232

3333
qdec_sleep_pinctrl: qdec_sleep_pinctrl {
3434
group1 {
35-
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
36-
<NRF_PSEL(QDEC_B, 1, 10)>;
35+
psels = <NRF_PSEL(QDEC_A, 1, 16)>,
36+
<NRF_PSEL(QDEC_B, 1, 24)>;
3737
low-power-enable;
3838
};
3939
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
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+
phase_a: phase_a {
17+
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
18+
};
19+
phase_b: phase_b {
20+
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
21+
};
22+
};
23+
};
24+
25+
&pinctrl {
26+
qdec_pinctrl: qdec_pinctrl {
27+
group1 {
28+
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
29+
<NRF_PSEL(QDEC_B, 1, 10)>;
30+
};
31+
};
32+
33+
qdec_sleep_pinctrl: qdec_sleep_pinctrl {
34+
group1 {
35+
psels = <NRF_PSEL(QDEC_A, 1, 8)>,
36+
<NRF_PSEL(QDEC_B, 1, 10)>;
37+
low-power-enable;
38+
};
39+
};
40+
};
41+
42+
&gpio1 {
43+
status = "okay";
44+
};
45+
46+
&qdec20 {
47+
status = "okay";
48+
pinctrl-0 = <&qdec_pinctrl>;
49+
pinctrl-1 = <&qdec_sleep_pinctrl>;
50+
pinctrl-names = "default", "sleep";
51+
steps = <127>;
52+
led-pre = <500>;
53+
zephyr,pm-device-runtime-auto;
54+
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ common:
22
platform_allow:
33
- nrf54l20pdk/nrf54l20/cpuflpr
44
- nrf54lm20apdk/nrf54lm20a/cpuapp
5+
- [email protected]/nrf54lm20a/cpuapp
56
integration_platforms:
67
- nrf54l20pdk/nrf54l20/cpuflpr
78
- nrf54lm20apdk/nrf54lm20a/cpuapp

0 commit comments

Comments
 (0)