Skip to content

Commit

Permalink
boards: adafruit: fix reversed rel wheel events on Macropad RP2040
Browse files Browse the repository at this point in the history
Inverts the two rotA/rotB GPIOs so that the direction of the rel wheel
events is correct.
Also adds a zephyr,lvgl-encoder-input node to make the encoder
available to LVGL users.

Signed-off-by: Benjamin Cabé <[email protected]>
  • Loading branch information
kartben committed Feb 27, 2025
1 parent 1f44e01 commit 35e5fb5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions boards/adafruit/macropad_rp2040/adafruit_macropad_rp2040.dts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,20 @@

encoder {
compatible = "gpio-qdec";
gpios = <&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&gpio0 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
gpios = <&gpio0 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&gpio0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
zephyr,axis = <INPUT_REL_WHEEL>;
steps-per-period = <4>;
sample-time-us = <2000>;
idle-timeout-ms = <200>;
};

lvgl_encoder_input {
compatible = "zephyr,lvgl-encoder-input";
rotation-input-code = <INPUT_REL_WHEEL>;
button-input-code = <INPUT_KEY_ENTER>;
};

stemma_connector: stemma_connector {
compatible = "stemma-qt-connector";
#gpio-cells = <2>;
Expand Down

0 comments on commit 35e5fb5

Please sign in to comment.