Skip to content
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
14 changes: 8 additions & 6 deletions tests/boards/nrf/qdec/boards/bl54l15_dvk_nrf54l15_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
*/

/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};

encoder-emulate {
compatible = "gpio-leds";

Expand All @@ -22,6 +16,14 @@
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec20>;
qenc-emul-gpios = <&phase_a &phase_b>;
};
};
};

&pinctrl {
Expand Down
14 changes: 8 additions & 6 deletions tests/boards/nrf/qdec/boards/bl54l15u_dvk_nrf54l15_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
*/

/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};

encoder-emulate {
compatible = "gpio-leds";

Expand All @@ -22,6 +16,14 @@
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec20>;
qenc-emul-gpios = <&phase_a &phase_b>;
};
};
};

&pinctrl {
Expand Down
7 changes: 7 additions & 0 deletions tests/boards/nrf/qdec/boards/nrf52840dk_nrf52840.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec0>;
qenc-emul-gpios = <&phase_a &phase_b>;
};
};
};

&pinctrl {
Expand Down
14 changes: 8 additions & 6 deletions tests/boards/nrf/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
*/

/ {
aliases {
qdec0 = &qdec1;
qenca = &phase_a;
qencb = &phase_b;
};

encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
Expand All @@ -21,6 +15,14 @@
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec1>;
qenc-emul-gpios = <&phase_a &phase_b>;
};
};
};

&pinctrl {
Expand Down
76 changes: 64 additions & 12 deletions tests/boards/nrf/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,101 @@
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
qdec0 = &qdec130;
qenca = &phase_a;
qencb = &phase_b;
};
/* Required loopbacks
* P2.08 <-> P2.09
* P2.10 <-> P2.11
* P1.02 <-> P1.03
* P7.01 <-> P1.05
*/

/ {
encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
phase_a0: phase_a0 {
gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
phase_b0: phase_b0 {
gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
};
phase_a1: phase_a1 {
gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
};
phase_b1: phase_b1 {
gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec130>;
qenc-emul-gpios = <&phase_a0 &phase_b0>;
};
loopback1 {
qdec = <&qdec131>;
qenc-emul-gpios = <&phase_a1 &phase_b1>;
};
};
};

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

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

qdec_131_pinctrl: qdec_131_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 3)>,
<NRF_PSEL(QDEC_B, 1, 5)>;
};
};

qdec_131_sleep_pinctrl: qdec_131_sleep_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 3)>,
<NRF_PSEL(QDEC_B, 1, 5)>;
low-power-enable;
};
};
};

&gpio1 {
status = "okay";
};

&gpio2 {
status = "okay";
};

&gpio7 {
status = "okay";
};

&qdec130 {
status = "okay";
pinctrl-0 = <&qdec_pinctrl>;
pinctrl-1 = <&qdec_sleep_pinctrl>;
pinctrl-0 = <&qdec_130_pinctrl>;
pinctrl-1 = <&qdec_130_sleep_pinctrl>;
pinctrl-names = "default", "sleep";
steps = <127>;
led-pre = <500>;
zephyr,pm-device-runtime-auto;
};

&qdec131 {
status = "okay";
pinctrl-0 = <&qdec_131_pinctrl>;
pinctrl-1 = <&qdec_131_sleep_pinctrl>;
pinctrl-names = "default", "sleep";
steps = <127>;
led-pre = <500>;
Expand Down
72 changes: 60 additions & 12 deletions tests/boards/nrf/qdec/boards/nrf54l15dk_nrf54l15_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,97 @@
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};
/* Required loopbacks
* P1.8 <-> P1.9
* P1.10 <-> P1.11
* P1.12 <-> P1.13
* P1.14 <-> P2.10
*/

/ {
encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
phase_a0: phase_a0 {
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
phase_b0: phase_b0 {
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
phase_a1: phase_a1 {
gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
};
phase_b1: phase_b1 {
gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec20>;
qenc-emul-gpios = <&phase_a0 &phase_b0>;
};
loopback1 {
qdec = <&qdec21>;
qenc-emul-gpios = <&phase_a1 &phase_b1>;
};
};
};

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

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

qdec_21_pinctrl: qdec_21_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 12)>,
<NRF_PSEL(QDEC_B, 1, 14)>;
};
};

qdec_21_sleep_pinctrl: qdec_21_sleep_pinctrl {
group1 {
psels = <NRF_PSEL(QDEC_A, 1, 12)>,
<NRF_PSEL(QDEC_B, 1, 14)>;
low-power-enable;
};
};
};

&gpio1 {
status = "okay";
};

&gpio2 {
status = "okay";
};

&qdec20 {
status = "okay";
pinctrl-0 = <&qdec_pinctrl>;
pinctrl-1 = <&qdec_sleep_pinctrl>;
pinctrl-0 = <&qdec_20_pinctrl>;
pinctrl-1 = <&qdec_20_sleep_pinctrl>;
pinctrl-names = "default", "sleep";
steps = <127>;
led-pre = <500>;
zephyr,pm-device-runtime-auto;
};

&qdec21 {
status = "okay";
pinctrl-0 = <&qdec_21_pinctrl>;
pinctrl-1 = <&qdec_21_sleep_pinctrl>;
pinctrl-names = "default", "sleep";
steps = <127>;
led-pre = <500>;
Expand Down
14 changes: 8 additions & 6 deletions tests/boards/nrf/qdec/boards/nrf54lm20dk_nrf54lm20_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
*/

/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};

encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
Expand All @@ -26,6 +20,14 @@
gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
};
};

qdec_loopbacks: loopbacks {
compatible = "test-qdec-loopbacks";
loopback0 {
qdec = <&qdec20>;
qenc-emul-gpios = <&phase_a &phase_b>;
};
};
};

&pinctrl {
Expand Down
20 changes: 20 additions & 0 deletions tests/boards/nrf/qdec/dts/bindings/test-qdec-loopback.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
description: |
Binding describing loopbacks required to run tests/boards/nrf/qdec test in Zephyr.

compatible: "test-qdec-loopbacks"

child-binding:
description: |
Binding describing a single loopback pair consisting of a QDEC device and two "gpio-leds" pins
working as a quadrature encoder for the test.
properties:
qdec:
type: phandle
required: true
description: Node of the QDEC device used to capture quadrature signal in the loopback.
qenc-emul-gpios:
type: phandles
required: true
description: |
Children nodes of "gpio-leds" compatible used to generate quadrature signal. The first
phandles outputs phase A signal, the second one outputs phase B signal.
Loading
Loading