Adaptions for upstreamed libinput driver
This commit is contained in:
parent
38180ee306
commit
9e7ae24fe3
10 changed files with 47 additions and 503 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -7,6 +7,3 @@
|
||||||
[submodule "unl0kr/lvgl"]
|
[submodule "unl0kr/lvgl"]
|
||||||
path = unl0kr/lvgl
|
path = unl0kr/lvgl
|
||||||
url = https://github.com/littlevgl/lvgl.git
|
url = https://github.com/littlevgl/lvgl.git
|
||||||
[submodule "unl0kr/lv_drivers"]
|
|
||||||
path = unl0kr/lv_drivers
|
|
||||||
url = https://github.com/calebccff/lv_drivers.git
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ For an example configuration file, see [unl0kr.conf].
|
||||||
|
|
||||||
- [inih]
|
- [inih]
|
||||||
- [lvgl] (git submodule / linked statically)
|
- [lvgl] (git submodule / linked statically)
|
||||||
- [lv_drivers] (git submodule / linked statically)
|
|
||||||
- [squeek2lvgl] (git submodule / linked statically)
|
- [squeek2lvgl] (git submodule / linked statically)
|
||||||
- [libinput]
|
- [libinput]
|
||||||
- [libudev]
|
- [libudev]
|
||||||
|
|
@ -209,7 +208,6 @@ The [FontAwesome] font is licensed under the Open Font License version 1.1.
|
||||||
[libudev]: https://github.com/systemd/systemd/tree/main/src/libudev
|
[libudev]: https://github.com/systemd/systemd/tree/main/src/libudev
|
||||||
[libxkbcommon]: https://github.com/xkbcommon/libxkbcommon
|
[libxkbcommon]: https://github.com/xkbcommon/libxkbcommon
|
||||||
[libdrm]: https://gitlab.freedesktop.org/mesa/drm
|
[libdrm]: https://gitlab.freedesktop.org/mesa/drm
|
||||||
[lv_drivers]: https://github.com/lvgl/lv_drivers
|
|
||||||
[lv_port_linux_frame_buffer]: https://github.com/lvgl/lv_port_linux_frame_buffer
|
[lv_port_linux_frame_buffer]: https://github.com/lvgl/lv_port_linux_frame_buffer
|
||||||
[lvgl]: https://github.com/lvgl/lvgl
|
[lvgl]: https://github.com/lvgl/lvgl
|
||||||
[online font converter]: https://lvgl.io/tools/fontconverter
|
[online font converter]: https://lvgl.io/tools/fontconverter
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
||||||
find lv_drivers -name '*.c'
|
|
||||||
find lvgl/src -name 'lv_init.c'
|
find lvgl/src -name 'lv_init.c'
|
||||||
find lvgl/src/core -name '*.c'
|
find lvgl/src/core -name '*.c'
|
||||||
find lvgl/src/dev -name '*.c'
|
find lvgl/src/dev -name '*.c'
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "lvgl/src/indev/lv_indev_private.h"
|
#include "lvgl/src/indev/lv_indev_private.h"
|
||||||
#include "lv_drivers/indev/libinput_drv.h"
|
|
||||||
|
|
||||||
#include <libinput.h>
|
#include <libinput.h>
|
||||||
#include <libudev.h>
|
#include <libudev.h>
|
||||||
|
|
@ -37,7 +36,7 @@
|
||||||
* Static variables
|
* Static variables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static libinput_capability allowed_capability = LIBINPUT_CAPABILITY_NONE;
|
static lv_libinput_capability allowed_capability = LV_LIBINPUT_CAPABILITY_NONE;
|
||||||
|
|
||||||
static struct udev *context = NULL;
|
static struct udev *context = NULL;
|
||||||
static struct udev_monitor *monitor = NULL;
|
static struct udev_monitor *monitor = NULL;
|
||||||
|
|
@ -45,8 +44,7 @@ static int monitor_fd = -1;
|
||||||
|
|
||||||
struct input_device {
|
struct input_device {
|
||||||
char *node;
|
char *node;
|
||||||
libinput_capability capability;
|
lv_libinput_capability capability;
|
||||||
libinput_drv_state_t drv_state;
|
|
||||||
lv_indev_t *indev;
|
lv_indev_t *indev;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -92,7 +90,7 @@ static bool is_touch_device(struct input_device *device);
|
||||||
* @param capability input device capability
|
* @param capability input device capability
|
||||||
* @return textual description
|
* @return textual description
|
||||||
*/
|
*/
|
||||||
static char *capability_to_str(libinput_capability capability);
|
static char *capability_to_str(lv_libinput_capability capability);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect a specific input device using its udev device.
|
* Connect a specific input device using its udev device.
|
||||||
|
|
@ -122,14 +120,6 @@ static void disconnect_devnode(const char *node);
|
||||||
*/
|
*/
|
||||||
static void disconnect_idx(int idx);
|
static void disconnect_idx(int idx);
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform an input read on a device using the libinput driver.
|
|
||||||
*
|
|
||||||
* @param indev input device
|
|
||||||
* @param data input device data to write into
|
|
||||||
*/
|
|
||||||
static void libinput_read_cb(lv_indev_t *indev, lv_indev_data_t *data);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up the input group for a keyboard device.
|
* Set up the input group for a keyboard device.
|
||||||
*
|
*
|
||||||
|
|
@ -150,25 +140,25 @@ static void set_mouse_cursor(struct input_device *device);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool is_keyboard_device(struct input_device *device) {
|
static bool is_keyboard_device(struct input_device *device) {
|
||||||
return (device->capability & LIBINPUT_CAPABILITY_KEYBOARD) != LIBINPUT_CAPABILITY_NONE;
|
return (device->capability & LV_LIBINPUT_CAPABILITY_KEYBOARD) != LV_LIBINPUT_CAPABILITY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_pointer_device(struct input_device *device) {
|
static bool is_pointer_device(struct input_device *device) {
|
||||||
return (device->capability & LIBINPUT_CAPABILITY_POINTER) != LIBINPUT_CAPABILITY_NONE;
|
return (device->capability & LV_LIBINPUT_CAPABILITY_POINTER) != LV_LIBINPUT_CAPABILITY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_touch_device(struct input_device *device) {
|
static bool is_touch_device(struct input_device *device) {
|
||||||
return (device->capability & LIBINPUT_CAPABILITY_TOUCH) != LIBINPUT_CAPABILITY_NONE;
|
return (device->capability & LV_LIBINPUT_CAPABILITY_TOUCH) != LV_LIBINPUT_CAPABILITY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *capability_to_str(libinput_capability capability) {
|
static char *capability_to_str(lv_libinput_capability capability) {
|
||||||
if (capability == LIBINPUT_CAPABILITY_KEYBOARD) {
|
if (capability == LV_LIBINPUT_CAPABILITY_KEYBOARD) {
|
||||||
return "keyboard";
|
return "keyboard";
|
||||||
}
|
}
|
||||||
if (capability == LIBINPUT_CAPABILITY_POINTER) {
|
if (capability == LV_LIBINPUT_CAPABILITY_POINTER) {
|
||||||
return "pointer";
|
return "pointer";
|
||||||
}
|
}
|
||||||
if (capability == LIBINPUT_CAPABILITY_TOUCH) {
|
if (capability == LV_LIBINPUT_CAPABILITY_TOUCH) {
|
||||||
return "touch";
|
return "touch";
|
||||||
}
|
}
|
||||||
return "none";
|
return "none";
|
||||||
|
|
@ -217,17 +207,18 @@ static void connect_devnode(const char *node) {
|
||||||
lv_memzero(device, sizeof(struct input_device));
|
lv_memzero(device, sizeof(struct input_device));
|
||||||
devices[num_connected_devices] = device;
|
devices[num_connected_devices] = device;
|
||||||
|
|
||||||
/* Get pointer to driver state */
|
|
||||||
libinput_drv_state_t *drv_state = &(device->drv_state);
|
|
||||||
|
|
||||||
/* Copy the node path so that it can be used beyond the caller's scope */
|
/* Copy the node path so that it can be used beyond the caller's scope */
|
||||||
device->node = strdup(node);
|
device->node = strdup(node);
|
||||||
|
|
||||||
/* Initialise the driver state and obtain the libinput device */
|
/* Initialise the indev and obtain the libinput device */
|
||||||
libinput_init_state(drv_state, device->node);
|
device->indev = lv_libinput_create(LV_INDEV_TYPE_NONE, device->node);
|
||||||
struct libinput_device *device_libinput = drv_state->libinput_device;
|
if (!device->indev) {
|
||||||
|
ul_log(UL_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node);
|
||||||
/* If libinput failed to connect the device, exit */
|
disconnect_idx(num_connected_devices);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lv_libinput_t *dsc = lv_indev_get_driver_data(device->indev);
|
||||||
|
struct libinput_device *device_libinput = dsc->libinput_device;
|
||||||
if (!device_libinput) {
|
if (!device_libinput) {
|
||||||
ul_log(UL_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node);
|
ul_log(UL_LOG_LEVEL_WARNING, "Aborting connection of input device %s because libinput failed to connect it", node);
|
||||||
disconnect_idx(num_connected_devices);
|
disconnect_idx(num_connected_devices);
|
||||||
|
|
@ -235,20 +226,15 @@ static void connect_devnode(const char *node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Obtain device capabilities */
|
/* Obtain device capabilities */
|
||||||
device->capability = libinput_query_capability(device_libinput);
|
device->capability = lv_libinput_query_capability(device_libinput);
|
||||||
|
|
||||||
/* If the device doesn't have any supported capabilities, exit */
|
/* If the device doesn't have any supported capabilities, exit */
|
||||||
if ((device->capability & allowed_capability) == LIBINPUT_CAPABILITY_NONE) {
|
if ((device->capability & allowed_capability) == LV_LIBINPUT_CAPABILITY_NONE) {
|
||||||
ul_log(UL_LOG_LEVEL_WARNING, "Aborting connection of input device %s because it has no allowed capabilities", node);
|
ul_log(UL_LOG_LEVEL_WARNING, "Aborting connection of input device %s because it has no allowed capabilities", node);
|
||||||
disconnect_idx(num_connected_devices);
|
disconnect_idx(num_connected_devices);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialise indev */
|
|
||||||
device->indev = lv_indev_create();
|
|
||||||
device->indev->read_cb = libinput_read_cb;
|
|
||||||
device->indev->user_data = drv_state;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up indev type and related properties
|
* Set up indev type and related properties
|
||||||
*
|
*
|
||||||
|
|
@ -335,7 +321,7 @@ static void disconnect_devnode(const char *node) {
|
||||||
static void disconnect_idx(int idx) {
|
static void disconnect_idx(int idx) {
|
||||||
/* Delete LVGL indev */
|
/* Delete LVGL indev */
|
||||||
if (devices[idx]->indev) {
|
if (devices[idx]->indev) {
|
||||||
lv_indev_delete(devices[idx]->indev);
|
lv_libinput_delete(devices[idx]->indev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free previously copied node path */
|
/* Free previously copied node path */
|
||||||
|
|
@ -343,18 +329,11 @@ static void disconnect_idx(int idx) {
|
||||||
free(devices[idx]->node);
|
free(devices[idx]->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* De-initialise driver state */
|
|
||||||
libinput_deinit_state(&(devices[idx]->drv_state));
|
|
||||||
|
|
||||||
/* Deallocate memory and zero out freed array element */
|
/* Deallocate memory and zero out freed array element */
|
||||||
free(devices[idx]);
|
free(devices[idx]);
|
||||||
lv_memzero(devices + idx, sizeof(struct input_device *));
|
lv_memzero(devices + idx, sizeof(struct input_device *));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void libinput_read_cb(lv_indev_t *indev, lv_indev_data_t *data) {
|
|
||||||
libinput_read_state(indev->user_data, indev, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_keyboard_input_group(struct input_device *device) {
|
static void set_keyboard_input_group(struct input_device *device) {
|
||||||
/* Ignore non-keyboard devices */
|
/* Ignore non-keyboard devices */
|
||||||
if (!is_keyboard_device(device)) {
|
if (!is_keyboard_device(device)) {
|
||||||
|
|
@ -387,15 +366,15 @@ static void set_mouse_cursor(struct input_device *device) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void ul_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool touchscreen) {
|
void ul_indev_set_allowed_device_capability(bool keyboard, bool pointer, bool touchscreen) {
|
||||||
allowed_capability = LIBINPUT_CAPABILITY_NONE;
|
allowed_capability = LV_LIBINPUT_CAPABILITY_NONE;
|
||||||
if (keyboard) {
|
if (keyboard) {
|
||||||
allowed_capability |= LIBINPUT_CAPABILITY_KEYBOARD;
|
allowed_capability |= LV_LIBINPUT_CAPABILITY_KEYBOARD;
|
||||||
}
|
}
|
||||||
if (pointer) {
|
if (pointer) {
|
||||||
allowed_capability |= LIBINPUT_CAPABILITY_POINTER;
|
allowed_capability |= LV_LIBINPUT_CAPABILITY_POINTER;
|
||||||
}
|
}
|
||||||
if (touchscreen) {
|
if (touchscreen) {
|
||||||
allowed_capability |= LIBINPUT_CAPABILITY_TOUCH;
|
allowed_capability |= LV_LIBINPUT_CAPABILITY_TOUCH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -520,6 +520,23 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
|
||||||
/*Interface for TFT_eSPI*/
|
/*Interface for TFT_eSPI*/
|
||||||
#define LV_USE_TFT_ESPI 0
|
#define LV_USE_TFT_ESPI 0
|
||||||
|
|
||||||
|
/*Driver for libinput input devices*/
|
||||||
|
#define LV_USE_LIBINPUT 1
|
||||||
|
|
||||||
|
#if LV_USE_LIBINPUT
|
||||||
|
#define LV_LIBINPUT_BSD 0
|
||||||
|
|
||||||
|
/*Full keyboard support*/
|
||||||
|
#define LV_LIBINPUT_XKB 1
|
||||||
|
#if LV_LIBINPUT_XKB
|
||||||
|
#define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, \
|
||||||
|
.model = "pc101", \
|
||||||
|
.layout = "us", \
|
||||||
|
.variant = NULL, \
|
||||||
|
.options = NULL } /*"setxkbmap -query" can help find the right values for your keyboard*/
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*==================
|
/*==================
|
||||||
* EXAMPLES
|
* EXAMPLES
|
||||||
*==================*/
|
*==================*/
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 924af8301ccb669a5f0976a9ef1ab52d39ae4d0b
|
|
||||||
|
|
@ -1,441 +0,0 @@
|
||||||
/**
|
|
||||||
* Copyright 2021 Johannes Marbach
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#if 1 /*Set it to "1" to enable the content*/
|
|
||||||
|
|
||||||
#ifndef LV_DRV_CONF_H
|
|
||||||
#define LV_DRV_CONF_H
|
|
||||||
|
|
||||||
#include "lv_conf.h"
|
|
||||||
|
|
||||||
/*********************
|
|
||||||
* DELAY INTERFACE
|
|
||||||
*********************/
|
|
||||||
#define LV_DRV_DELAY_INCLUDE <stdint.h> /*Dummy include by default*/
|
|
||||||
#define LV_DRV_DELAY_US(us) /*delay_us(us)*/ /*Delay the given number of microseconds*/
|
|
||||||
#define LV_DRV_DELAY_MS(ms) /*delay_ms(ms)*/ /*Delay the given number of milliseconds*/
|
|
||||||
|
|
||||||
/*********************
|
|
||||||
* DISPLAY INTERFACE
|
|
||||||
*********************/
|
|
||||||
|
|
||||||
/*------------
|
|
||||||
* Common
|
|
||||||
*------------*/
|
|
||||||
#define LV_DRV_DISP_INCLUDE <stdint.h> /*Dummy include by default*/
|
|
||||||
#define LV_DRV_DISP_CMD_DATA(val) /*pin_x_set(val)*/ /*Set the command/data pin to 'val'*/
|
|
||||||
#define LV_DRV_DISP_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/
|
|
||||||
|
|
||||||
/*---------
|
|
||||||
* SPI
|
|
||||||
*---------*/
|
|
||||||
#define LV_DRV_DISP_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/
|
|
||||||
#define LV_DRV_DISP_SPI_WR_BYTE(data) /*spi_wr(data)*/ /*Write a byte the SPI bus*/
|
|
||||||
#define LV_DRV_DISP_SPI_WR_ARRAY(adr, n) /*spi_wr_mem(adr, n)*/ /*Write 'n' bytes to SPI bus from 'adr'*/
|
|
||||||
|
|
||||||
/*------------------
|
|
||||||
* Parallel port
|
|
||||||
*-----------------*/
|
|
||||||
#define LV_DRV_DISP_PAR_CS(val) /*par_cs_set(val)*/ /*Set the Parallel port's Chip select to 'val'*/
|
|
||||||
#define LV_DRV_DISP_PAR_SLOW /*par_slow()*/ /*Set low speed on the parallel port*/
|
|
||||||
#define LV_DRV_DISP_PAR_FAST /*par_fast()*/ /*Set high speed on the parallel port*/
|
|
||||||
#define LV_DRV_DISP_PAR_WR_WORD(data) /*par_wr(data)*/ /*Write a word to the parallel port*/
|
|
||||||
#define LV_DRV_DISP_PAR_WR_ARRAY(adr, n) /*par_wr_mem(adr,n)*/ /*Write 'n' bytes to Parallel ports from 'adr'*/
|
|
||||||
|
|
||||||
/***************************
|
|
||||||
* INPUT DEVICE INTERFACE
|
|
||||||
***************************/
|
|
||||||
|
|
||||||
/*----------
|
|
||||||
* Common
|
|
||||||
*----------*/
|
|
||||||
#define LV_DRV_INDEV_INCLUDE <stdint.h> /*Dummy include by default*/
|
|
||||||
#define LV_DRV_INDEV_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/
|
|
||||||
#define LV_DRV_INDEV_IRQ_READ 0 /*pn_x_read()*/ /*Read the IRQ pin*/
|
|
||||||
|
|
||||||
/*---------
|
|
||||||
* SPI
|
|
||||||
*---------*/
|
|
||||||
#define LV_DRV_INDEV_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/
|
|
||||||
#define LV_DRV_INDEV_SPI_XCHG_BYTE(data) 0 /*spi_xchg(val)*/ /*Write 'val' to SPI and give the read value*/
|
|
||||||
|
|
||||||
/*---------
|
|
||||||
* I2C
|
|
||||||
*---------*/
|
|
||||||
#define LV_DRV_INDEV_I2C_START /*i2c_start()*/ /*Make an I2C start*/
|
|
||||||
#define LV_DRV_INDEV_I2C_STOP /*i2c_stop()*/ /*Make an I2C stop*/
|
|
||||||
#define LV_DRV_INDEV_I2C_RESTART /*i2c_restart()*/ /*Make an I2C restart*/
|
|
||||||
#define LV_DRV_INDEV_I2C_WR(data) /*i2c_wr(data)*/ /*Write a byte to the I1C bus*/
|
|
||||||
#define LV_DRV_INDEV_I2C_READ(last_read) 0 /*i2c_rd()*/ /*Read a byte from the I2C bud*/
|
|
||||||
|
|
||||||
|
|
||||||
/*********************
|
|
||||||
* DISPLAY DRIVERS
|
|
||||||
*********************/
|
|
||||||
|
|
||||||
/*-------------------
|
|
||||||
* Monitor of PC
|
|
||||||
*-------------------*/
|
|
||||||
#ifndef USE_MONITOR
|
|
||||||
# define USE_MONITOR 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_MONITOR
|
|
||||||
# define MONITOR_HOR_RES 480
|
|
||||||
# define MONITOR_VER_RES 320
|
|
||||||
|
|
||||||
/* Scale window by this factor (useful when simulating small screens) */
|
|
||||||
# define MONITOR_ZOOM 1
|
|
||||||
|
|
||||||
/* Used to test true double buffering with only address changing.
|
|
||||||
* Use 2 draw buffers, bith with MONITOR_HOR_RES x MONITOR_VER_RES size*/
|
|
||||||
# define MONITOR_DOUBLE_BUFFERED 0
|
|
||||||
|
|
||||||
/*Eclipse: <SDL2/SDL.h> Visual Studio: <SDL.h>*/
|
|
||||||
# define MONITOR_SDL_INCLUDE_PATH <SDL2/SDL.h>
|
|
||||||
|
|
||||||
/*Open two windows to test multi display support*/
|
|
||||||
# define MONITOR_DUAL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-----------------------------------
|
|
||||||
* Native Windows (including mouse)
|
|
||||||
*----------------------------------*/
|
|
||||||
#ifndef USE_WINDOWS
|
|
||||||
# define USE_WINDOWS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_WINDOWS
|
|
||||||
# define WINDOW_HOR_RES 480
|
|
||||||
# define WINDOW_VER_RES 320
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------
|
|
||||||
* Native Windows (win32drv)
|
|
||||||
*---------------------------*/
|
|
||||||
#ifndef USE_WIN32DRV
|
|
||||||
# define USE_WIN32DRV 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_WIN32DRV
|
|
||||||
/* Scale window by this factor (useful when simulating small screens) */
|
|
||||||
# define WIN32DRV_MONITOR_ZOOM 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------
|
|
||||||
* GTK drivers (monitor, mouse, keyboard
|
|
||||||
*---------------------------------------*/
|
|
||||||
#ifndef USE_GTK
|
|
||||||
# define USE_GTK 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------
|
|
||||||
* Wayland drivers (monitor, mouse, keyboard, touchscreen)
|
|
||||||
*---------------------------------------*/
|
|
||||||
#ifndef USE_WAYLAND
|
|
||||||
# define USE_WAYLAND 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_WAYLAND
|
|
||||||
# define WAYLAND_HOR_RES 480
|
|
||||||
# define WAYLAND_VER_RES 320
|
|
||||||
# define WAYLAND_SURF_TITLE "LVGL"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------
|
|
||||||
* SSD1963
|
|
||||||
*--------------*/
|
|
||||||
#ifndef USE_SSD1963
|
|
||||||
# define USE_SSD1963 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_SSD1963
|
|
||||||
# define SSD1963_HOR_RES LV_HOR_RES
|
|
||||||
# define SSD1963_VER_RES LV_VER_RES
|
|
||||||
# define SSD1963_HT 531
|
|
||||||
# define SSD1963_HPS 43
|
|
||||||
# define SSD1963_LPS 8
|
|
||||||
# define SSD1963_HPW 10
|
|
||||||
# define SSD1963_VT 288
|
|
||||||
# define SSD1963_VPS 12
|
|
||||||
# define SSD1963_FPS 4
|
|
||||||
# define SSD1963_VPW 10
|
|
||||||
# define SSD1963_HS_NEG 0 /*Negative hsync*/
|
|
||||||
# define SSD1963_VS_NEG 0 /*Negative vsync*/
|
|
||||||
# define SSD1963_ORI 0 /*0, 90, 180, 270*/
|
|
||||||
# define SSD1963_COLOR_DEPTH 16
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------
|
|
||||||
* R61581
|
|
||||||
*--------------*/
|
|
||||||
#ifndef USE_R61581
|
|
||||||
# define USE_R61581 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_R61581
|
|
||||||
# define R61581_HOR_RES LV_HOR_RES
|
|
||||||
# define R61581_VER_RES LV_VER_RES
|
|
||||||
# define R61581_HSPL 0 /*HSYNC signal polarity*/
|
|
||||||
# define R61581_HSL 10 /*HSYNC length (Not Implemented)*/
|
|
||||||
# define R61581_HFP 10 /*Horitontal Front poarch (Not Implemented)*/
|
|
||||||
# define R61581_HBP 10 /*Horitontal Back poarch (Not Implemented */
|
|
||||||
# define R61581_VSPL 0 /*VSYNC signal polarity*/
|
|
||||||
# define R61581_VSL 10 /*VSYNC length (Not Implemented)*/
|
|
||||||
# define R61581_VFP 8 /*Vertical Front poarch*/
|
|
||||||
# define R61581_VBP 8 /*Vertical Back poarch */
|
|
||||||
# define R61581_DPL 0 /*DCLK signal polarity*/
|
|
||||||
# define R61581_EPL 1 /*ENABLE signal polarity*/
|
|
||||||
# define R61581_ORI 0 /*0, 180*/
|
|
||||||
# define R61581_LV_COLOR_DEPTH 16 /*Fix 16 bit*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------
|
|
||||||
* ST7565 (Monochrome, low res.)
|
|
||||||
*-----------------------------*/
|
|
||||||
#ifndef USE_ST7565
|
|
||||||
# define USE_ST7565 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_ST7565
|
|
||||||
/*No settings*/
|
|
||||||
#endif /*USE_ST7565*/
|
|
||||||
|
|
||||||
/*------------------------------
|
|
||||||
* GC9A01 (color, low res.)
|
|
||||||
*-----------------------------*/
|
|
||||||
#ifndef USE_GC9A01
|
|
||||||
# define USE_GC9A01 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_GC9A01
|
|
||||||
/*No settings*/
|
|
||||||
#endif /*USE_GC9A01*/
|
|
||||||
|
|
||||||
/*------------------------------------------
|
|
||||||
* UC1610 (4 gray 160*[104|128])
|
|
||||||
* (EA DOGXL160 160x104 tested)
|
|
||||||
*-----------------------------------------*/
|
|
||||||
#ifndef USE_UC1610
|
|
||||||
# define USE_UC1610 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_UC1610
|
|
||||||
# define UC1610_HOR_RES LV_HOR_RES
|
|
||||||
# define UC1610_VER_RES LV_VER_RES
|
|
||||||
# define UC1610_INIT_CONTRAST 33 /* init contrast, values in [%] */
|
|
||||||
# define UC1610_INIT_HARD_RST 0 /* 1 : hardware reset at init, 0 : software reset */
|
|
||||||
# define UC1610_TOP_VIEW 0 /* 0 : Bottom View, 1 : Top View */
|
|
||||||
#endif /*USE_UC1610*/
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
|
||||||
* SHARP memory in pixel monochrome display series
|
|
||||||
* LS012B7DD01 (184x38 pixels.)
|
|
||||||
* LS013B7DH03 (128x128 pixels.)
|
|
||||||
* LS013B7DH05 (144x168 pixels.)
|
|
||||||
* LS027B7DH01 (400x240 pixels.) (tested)
|
|
||||||
* LS032B7DD02 (336x536 pixels.)
|
|
||||||
* LS044Q7DH01 (320x240 pixels.)
|
|
||||||
*------------------------------------------------*/
|
|
||||||
#ifndef USE_SHARP_MIP
|
|
||||||
# define USE_SHARP_MIP 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_SHARP_MIP
|
|
||||||
# define SHARP_MIP_HOR_RES LV_HOR_RES
|
|
||||||
# define SHARP_MIP_VER_RES LV_VER_RES
|
|
||||||
# define SHARP_MIP_SOFT_COM_INVERSION 0
|
|
||||||
# define SHARP_MIP_REV_BYTE(b) /*((uint8_t) __REV(__RBIT(b)))*/ /*Architecture / compiler dependent byte bits order reverse*/
|
|
||||||
#endif /*USE_SHARP_MIP*/
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
|
||||||
* ILI9341 240X320 TFT LCD
|
|
||||||
*------------------------------------------------*/
|
|
||||||
#ifndef USE_ILI9341
|
|
||||||
# define USE_ILI9341 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_ILI9341
|
|
||||||
# define ILI9341_HOR_RES LV_HOR_RES
|
|
||||||
# define ILI9341_VER_RES LV_VER_RES
|
|
||||||
# define ILI9341_GAMMA 1
|
|
||||||
# define ILI9341_TEARING 0
|
|
||||||
#endif /*USE_ILI9341*/
|
|
||||||
|
|
||||||
/*-----------------------------------------
|
|
||||||
* Linux frame buffer device (/dev/fbx)
|
|
||||||
*-----------------------------------------*/
|
|
||||||
#ifndef USE_FBDEV
|
|
||||||
# define USE_FBDEV 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_FBDEV
|
|
||||||
# define FBDEV_PATH "/dev/fb0"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-----------------------------------------
|
|
||||||
* FreeBSD frame buffer device (/dev/fbx)
|
|
||||||
*.........................................*/
|
|
||||||
#ifndef USE_BSD_FBDEV
|
|
||||||
# define USE_BSD_FBDEV 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_BSD_FBDEV
|
|
||||||
# define FBDEV_PATH "/dev/fb0"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-----------------------------------------
|
|
||||||
* DRM/KMS device (/dev/dri/cardX)
|
|
||||||
*-----------------------------------------*/
|
|
||||||
#ifndef USE_DRM
|
|
||||||
# define USE_DRM 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_DRM
|
|
||||||
# define DRM_CARD "/dev/dri/card0"
|
|
||||||
# define DRM_CONNECTOR_ID -1 /* -1 for the first connected one */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*********************
|
|
||||||
* INPUT DEVICES
|
|
||||||
*********************/
|
|
||||||
|
|
||||||
/*--------------
|
|
||||||
* XPT2046
|
|
||||||
*--------------*/
|
|
||||||
#ifndef USE_XPT2046
|
|
||||||
# define USE_XPT2046 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_XPT2046
|
|
||||||
# define XPT2046_HOR_RES 480
|
|
||||||
# define XPT2046_VER_RES 320
|
|
||||||
# define XPT2046_X_MIN 200
|
|
||||||
# define XPT2046_Y_MIN 200
|
|
||||||
# define XPT2046_X_MAX 3800
|
|
||||||
# define XPT2046_Y_MAX 3800
|
|
||||||
# define XPT2046_AVG 4
|
|
||||||
# define XPT2046_X_INV 0
|
|
||||||
# define XPT2046_Y_INV 0
|
|
||||||
# define XPT2046_XY_SWAP 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-----------------
|
|
||||||
* FT5406EE8
|
|
||||||
*-----------------*/
|
|
||||||
#ifndef USE_FT5406EE8
|
|
||||||
# define USE_FT5406EE8 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_FT5406EE8
|
|
||||||
# define FT5406EE8_I2C_ADR 0x38 /*7 bit address*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------
|
|
||||||
* AD TOUCH
|
|
||||||
*--------------*/
|
|
||||||
#ifndef USE_AD_TOUCH
|
|
||||||
# define USE_AD_TOUCH 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_AD_TOUCH
|
|
||||||
/*No settings*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------
|
|
||||||
* Mouse or touchpad on PC (using SDL)
|
|
||||||
*-------------------------------------*/
|
|
||||||
#ifndef USE_MOUSE
|
|
||||||
# define USE_MOUSE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_MOUSE
|
|
||||||
/*No settings*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-------------------------------------------
|
|
||||||
* Mousewheel as encoder on PC (using SDL)
|
|
||||||
*------------------------------------------*/
|
|
||||||
#ifndef USE_MOUSEWHEEL
|
|
||||||
# define USE_MOUSEWHEEL 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_MOUSEWHEEL
|
|
||||||
/*No settings*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
|
||||||
* Touchscreen as libinput interface (for Linux based systems)
|
|
||||||
*------------------------------------------------*/
|
|
||||||
#ifndef USE_LIBINPUT
|
|
||||||
# define USE_LIBINPUT 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef USE_BSD_LIBINPUT
|
|
||||||
# define USE_BSD_LIBINPUT 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_LIBINPUT || USE_BSD_LIBINPUT
|
|
||||||
# define LIBINPUT_NAME "/dev/input/event4" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
|
|
||||||
#endif /*USE_LIBINPUT*/
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
|
||||||
* Mouse or touchpad as evdev interface (for Linux based systems)
|
|
||||||
*------------------------------------------------*/
|
|
||||||
#ifndef USE_EVDEV
|
|
||||||
# define USE_EVDEV 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef USE_BSD_EVDEV
|
|
||||||
# define USE_BSD_EVDEV 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_EVDEV || USE_BSD_EVDEV
|
|
||||||
# define EVDEV_NAME "/dev/input/event4" /*You can use the "evtest" Linux tool to get the list of devices and test them*/
|
|
||||||
# define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/
|
|
||||||
|
|
||||||
# define EVDEV_CALIBRATE 1 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
|
|
||||||
|
|
||||||
# if EVDEV_CALIBRATE
|
|
||||||
# define EVDEV_HOR_MIN -3600 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/
|
|
||||||
# define EVDEV_HOR_MAX 3866 /*"evtest" Linux tool can help to get the correct calibraion values>*/
|
|
||||||
# define EVDEV_VER_MIN -2444
|
|
||||||
# define EVDEV_VER_MAX 2550
|
|
||||||
# endif /*EVDEV_CALIBRATE*/
|
|
||||||
#endif /*USE_EVDEV*/
|
|
||||||
|
|
||||||
/*-------------------------------------------------
|
|
||||||
* Full keyboard support for evdev and libinput interface
|
|
||||||
*------------------------------------------------*/
|
|
||||||
#if USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV
|
|
||||||
# ifndef USE_XKB
|
|
||||||
# define USE_XKB 1
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if USE_XKB
|
|
||||||
# define XKB_KEY_MAP { .rules = NULL, \
|
|
||||||
.model = "pc101", \
|
|
||||||
.layout = "us", \
|
|
||||||
.variant = NULL, \
|
|
||||||
.options = NULL } /*"setxkbmap -query" can help find the right values for your keyboard*/
|
|
||||||
# endif /*USE_XKB*/
|
|
||||||
#endif /*USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV*/
|
|
||||||
|
|
||||||
/*-------------------------------
|
|
||||||
* Keyboard of a PC (using SDL)
|
|
||||||
*------------------------------*/
|
|
||||||
#ifndef USE_KEYBOARD
|
|
||||||
# define USE_KEYBOARD 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_KEYBOARD
|
|
||||||
/*No settings*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /*LV_DRV_CONF_H*/
|
|
||||||
|
|
||||||
#endif /*End of "Content enable"*/
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit da3ff11bd5e56a46e67aa15cae004b9877a8f377
|
Subproject commit 4f9c16f1774b466b55e1dd819313431098521735
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
#include "themes.h"
|
#include "themes.h"
|
||||||
|
|
||||||
#include "lv_drv_conf.h"
|
|
||||||
|
|
||||||
#include "lvgl/lvgl.h"
|
#include "lvgl/lvgl.h"
|
||||||
|
|
||||||
#include "../squeek2lvgl/sq2lv.h"
|
#include "../squeek2lvgl/sq2lv.h"
|
||||||
|
|
@ -348,7 +346,7 @@ static void print_password_and_exit(lv_obj_t *textarea) {
|
||||||
lv_obj_set_pos(rect, 0, 0);
|
lv_obj_set_pos(rect, 0, 0);
|
||||||
lv_obj_set_style_bg_opa(rect, LV_OPA_COVER, LV_PART_MAIN);
|
lv_obj_set_style_bg_opa(rect, LV_OPA_COVER, LV_PART_MAIN);
|
||||||
lv_obj_set_style_bg_color(rect , lv_color_hex(get_theme(is_alternate_theme)->window.bg_color), LV_PART_MAIN);
|
lv_obj_set_style_bg_color(rect , lv_color_hex(get_theme(is_alternate_theme)->window.bg_color), LV_PART_MAIN);
|
||||||
lv_refr_now(lv_disp_get_default()); /* Force the screen to be drawn */
|
lv_refr_now(lv_display_get_default()); /* Force the screen to be drawn */
|
||||||
|
|
||||||
/* Trigger SIGTERM to exit */
|
/* Trigger SIGTERM to exit */
|
||||||
sigaction_handler(SIGTERM);
|
sigaction_handler(SIGTERM);
|
||||||
|
|
|
||||||
|
|
@ -51,14 +51,12 @@ endif
|
||||||
|
|
||||||
lvgl_sources = run_command('find-lvgl-sources.sh', 'lvgl', check: true).stdout().strip().split('\n')
|
lvgl_sources = run_command('find-lvgl-sources.sh', 'lvgl', check: true).stdout().strip().split('\n')
|
||||||
|
|
||||||
lv_drivers_sources = run_command('find-lvgl-sources.sh', 'lv_drivers', check: true).stdout().strip().split('\n')
|
|
||||||
|
|
||||||
install_data(sources: 'unl0kr.conf', install_dir : get_option('sysconfdir'))
|
install_data(sources: 'unl0kr.conf', install_dir : get_option('sysconfdir'))
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
'unl0kr',
|
'unl0kr',
|
||||||
sources: unl0kr_sources + squeek2lvgl_sources + lvgl_sources + lv_drivers_sources,
|
sources: unl0kr_sources + squeek2lvgl_sources + lvgl_sources,
|
||||||
include_directories: ['lvgl', 'lv_drivers'],
|
include_directories: ['lvgl'],
|
||||||
dependencies: unl0kr_dependencies,
|
dependencies: unl0kr_dependencies,
|
||||||
install: true
|
install: true
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue