2023-04-28 22:47:59 +08:00
|
|
|
/*
|
|
|
|
* Copyright 2023 Nordic Semiconductor ASA
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/ {
|
|
|
|
aliases {
|
|
|
|
qdec0 = &qdec0;
|
|
|
|
qenca = &phase_a;
|
|
|
|
qencb = &phase_b;
|
|
|
|
};
|
|
|
|
|
|
|
|
encoder-emulate {
|
|
|
|
compatible = "gpio-leds";
|
|
|
|
phase_a: phase_a {
|
2024-06-20 21:20:07 +08:00
|
|
|
/* Arduino D1 */
|
|
|
|
gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
|
2023-04-28 22:47:59 +08:00
|
|
|
};
|
|
|
|
phase_b: phase_b {
|
2024-06-20 21:20:07 +08:00
|
|
|
/* Arduino D3 */
|
|
|
|
gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
|
2023-04-28 22:47:59 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
&pinctrl {
|
|
|
|
qdec_pinctrl: qdec_pinctrl {
|
|
|
|
group1 {
|
2024-06-20 21:20:07 +08:00
|
|
|
psels = <NRF_PSEL(QDEC_A, 1, 1)>, /* Ardiuno D0 */
|
|
|
|
<NRF_PSEL(QDEC_B, 1, 3)>; /* Arduino D2 */
|
2023-04-28 22:47:59 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
&qdec0 {
|
|
|
|
status = "okay";
|
|
|
|
pinctrl-0 = <&qdec_pinctrl>;
|
|
|
|
pinctrl-names = "default";
|
|
|
|
steps = < 120 >;
|
|
|
|
led-pre = < 500 >;
|
|
|
|
};
|