89 lines
1.8 KiB
Plaintext
89 lines
1.8 KiB
Plaintext
/*
|
|
* Copyright (c) 2022, Basalte bv
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/dt-bindings/input/input-event-codes.h>
|
|
#include <zephyr/dt-bindings/lvgl/lvgl.h>
|
|
|
|
/ {
|
|
aliases {
|
|
sw0 = &button0;
|
|
};
|
|
|
|
qdec {
|
|
compatible = "gpio-qdec";
|
|
gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>, <&gpio0 5 GPIO_ACTIVE_HIGH>;
|
|
steps-per-period = <4>;
|
|
zephyr,axis = <INPUT_REL_WHEEL>;
|
|
sample-time-us = <2000>;
|
|
idle-timeout-ms = <200>;
|
|
};
|
|
|
|
keys: keys {
|
|
compatible = "gpio-keys";
|
|
button0: button0 {
|
|
/* gpio0 pin 0 is already aliased to led0 */
|
|
gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
|
|
zephyr,code = <INPUT_KEY_R>;
|
|
};
|
|
|
|
button1: button1 {
|
|
gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
|
|
zephyr,code = <INPUT_KEY_B>;
|
|
};
|
|
|
|
encoder_button: encoder_button {
|
|
gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
|
|
zephyr,code = <INPUT_KEY_0>;
|
|
};
|
|
|
|
button_left: button_left {
|
|
gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
|
|
zephyr,code = <INPUT_KEY_LEFT>;
|
|
};
|
|
|
|
button_right: button_right {
|
|
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
|
|
zephyr,code = <INPUT_KEY_RIGHT>;
|
|
};
|
|
|
|
button_enter: button_enter {
|
|
gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
|
zephyr,code = <INPUT_KEY_ENTER>;
|
|
};
|
|
};
|
|
|
|
lvgl_button_input {
|
|
compatible = "zephyr,lvgl-button-input";
|
|
input = <&keys>;
|
|
input-codes = <INPUT_KEY_B>;
|
|
coordinates = <160 120>;
|
|
};
|
|
|
|
lvgl_encoder_input {
|
|
compatible = "zephyr,lvgl-encoder-input";
|
|
rotation-input-code = <INPUT_REL_WHEEL>;
|
|
button-input-code = <INPUT_KEY_0>;
|
|
};
|
|
|
|
lvgl_keypad_input {
|
|
compatible = "zephyr,lvgl-keypad-input";
|
|
input = <&keys>;
|
|
input-codes = <INPUT_KEY_LEFT INPUT_KEY_RIGHT INPUT_KEY_ENTER>;
|
|
lvgl-codes = <LV_KEY_LEFT LV_KEY_RIGHT LV_KEY_ENTER>;
|
|
};
|
|
};
|
|
|
|
&gpio0 {
|
|
ngpios = <9>;
|
|
|
|
sdl_gpio {
|
|
status = "okay";
|
|
compatible = "zephyr,gpio-emul-sdl";
|
|
/* Skip pin 0 with the unknown code 0 */
|
|
scancodes = <0 21 5 30 31 32 80 79 40>;
|
|
};
|
|
};
|