Fixes and improvements (#620)

- Standardized keyboard input using Unicode-based key codes across supported devices and the simulator. Keyboards don't emit `LV_KEY_*` anymore.
- Refactored lilygo encoder driver into a reusable GPIO rotary encoder driver (see `Drivers/gpio-encoder-module/`). Added more features to the config file.
- Improved LVGL keyboard device management, including duplicate prevention and reliable reconnects.
- LVGL file mutex now registers with lvgl start/stop
- Improved LVGL startup/shutdown stability and memory allocation reliability.
- Increased simulator LVGL memory capacity and improved USB device-class handling.
This commit is contained in:
Ken Van Hoeylandt
2026-08-23 17:21:16 +02:00
committed by GitHub
parent 4fea48f433
commit db48dfe812
51 changed files with 1219 additions and 602 deletions
@@ -1,7 +0,0 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <tactility/bindings/bindings.h>
#include <lilygo/drivers/tpager_encoder.h>
DEFINE_DEVICETREE(tpager_encoder, struct TpagerEncoderConfig)
@@ -1,59 +0,0 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <tactility/drivers/gpio.h>
#include <tactility/error.h>
#include <stdbool.h>
#include <stdint.h>
struct Device;
struct DeviceType;
struct TpagerEncoderConfig {
struct GpioPinSpec pin_a;
struct GpioPinSpec pin_b;
struct GpioPinSpec pin_enter;
};
/**
* @brief API for the T-Lora Pager encoder wheel driver.
* Reports raw, unscaled pulses: pulses-per-detent scaling and enter-press debounce are UI
* concerns layered on top by the consumer, not something this driver knows about.
*/
struct TpagerEncoderApi {
/**
* @brief Reads the accumulated pulse count since the last read, then resets it to zero.
* @param[in] device the encoder device
* @param[out] out_pulses accumulated quadrature pulses (positive/negative by direction)
* @retval ERROR_NONE when the operation was successful
*/
error_t (*read_delta)(struct Device* device, int32_t* out_pulses);
/**
* @brief Gets whether the enter button is currently pressed.
* @param[in] device the encoder device
* @param[out] out_pressed true when pressed
* @retval ERROR_NONE when the operation was successful
*/
error_t (*get_button_pressed)(struct Device* device, bool* out_pressed);
};
/**
* @brief Reads the accumulated pulse count using the specified encoder device.
*/
error_t tpager_encoder_read_delta(struct Device* device, int32_t* out_pulses);
/**
* @brief Gets whether the enter button is currently pressed on the specified encoder device.
*/
error_t tpager_encoder_get_button_pressed(struct Device* device, bool* out_pressed);
extern const struct DeviceType TPAGER_ENCODER_TYPE;
#ifdef __cplusplus
}
#endif
@@ -1,20 +0,0 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <lvgl.h>
namespace tpager_encoder {
/**
* @brief Initialize the encoder wheel as an LVGL input device, backed by the kernel
* tpager_encoder driver.
* @return LVGL input device pointer, or nullptr if the kernel device isn't found/started
*/
lv_indev_t* init();
/**
* @brief Deinitialize the encoder wheel's LVGL input device.
*/
void deinit();
}