Skip to content

Commit 380bfc0

Browse files
committed
samples: subsys: display: lvgl: Add native_posix overlay for SDL input
Enable SDL keyboard events using the zephyr,gpio-emul-sdl driver and alias key to sw0. Pressing 'r' on the keyboard resets the counter. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 14d1753 commit 380bfc0

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_LV_COLOR_DEPTH_32=y
2+
CONFIG_GPIO=y
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2022, Basalte bv
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
8+
/ {
9+
aliases {
10+
sw0 = &button0;
11+
};
12+
13+
keys {
14+
compatible = "gpio-keys";
15+
button0: button0 {
16+
/* gpio0 pin 0 is already aliased to led0 */
17+
gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
18+
};
19+
};
20+
};
21+
22+
&gpio0 {
23+
ngpios = <2>;
24+
25+
sdl_gpio {
26+
status = "okay";
27+
compatible = "zephyr,gpio-emul-sdl";
28+
/* Skip pin 0 with the unknown code 0 */
29+
scancodes = <0 21>;
30+
};
31+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_LV_COLOR_DEPTH_32=y
2+
CONFIG_GPIO=y
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Copyright (c) 2022, Basalte bv
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include "native_posix.overlay"

0 commit comments

Comments
 (0)