Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: arm: wio terminal: separate buttons and joystick definition #67458

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
9 changes: 8 additions & 1 deletion boards/arm/wio_terminal/wio_terminal.dts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
};

/* Buttons */
gpio_keys {
buttons: buttons {
compatible = "gpio-keys";
user_button_0: button_0 {
label = "User Button 0";
Expand All @@ -65,6 +65,13 @@
gpios = <&portc 28 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_2>;
};
};

/* Joystick */
joystick: joystick {
compatible = "gpio-keys";
polling-mode;
debounce-interval-ms = <100>;
joy_sel: joystick_selection {
label = "joystick selection";
gpios = <&portd 10 GPIO_ACTIVE_LOW>;
Expand Down
1 change: 1 addition & 0 deletions samples/subsys/display/lvgl/boards/wio_terminal.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_INPUT=y
23 changes: 23 additions & 0 deletions samples/subsys/display/lvgl/boards/wio_terminal.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2024 Joel Guittet
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/lvgl/lvgl.h>

/ {
lvgl_button_input {
compatible = "zephyr,lvgl-button-input";
input = <&buttons>;
input-codes = <INPUT_KEY_0>;
coordinates = <160 120>;
};

lvgl_keypad_input {
compatible = "zephyr,lvgl-keypad-input";
input = <&joystick>;
input-codes = <INPUT_KEY_ENTER INPUT_KEY_DOWN INPUT_KEY_UP INPUT_KEY_LEFT INPUT_KEY_RIGHT>;
lvgl-codes = <LV_KEY_ENTER LV_KEY_DOWN LV_KEY_UP LV_KEY_LEFT LV_KEY_RIGHT>;
};
};
Loading