Module improvements: lvgl, gps, crypt (#585)

This commit is contained in:
Ken Van Hoeylandt
2026-07-25 23:04:39 +02:00
committed by GitHub
parent ca5b071859
commit db7468d0c8
92 changed files with 261 additions and 271 deletions
@@ -1,21 +1,13 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
/**
* @file lvgl_module.h
* @brief LVGL module for Tactility.
*
* This module manages the lifecycle of the LVGL library, including initialization,
* task management, and thread-safety.
*/
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
/** Affects LVGL widget style */
enum UiDensity {
/** Ideal for very small non-touch screen devices (e.g. Waveshare S3 LCD 1.3") */
@@ -24,47 +16,6 @@ enum UiDensity {
LVGL_UI_DENSITY_DEFAULT
};
/**
* @brief The LVGL module instance.
*/
extern struct Module lvgl_module;
/**
* @brief Configuration for the LVGL module.
*/
struct LvglModuleConfig {
/**
* @brief Callback invoked when the LVGL task starts.
* Use this to add devices (e.g. displays, pointers), start services, create widgets, etc.
*/
void (*on_start)(void);
/**
* @brief Callback invoked when the LVGL task stops.
* Use this to remove devices, stop services, etc.
*/
void (*on_stop)(void);
/** @brief Priority of the LVGL task. */
int task_priority;
/** @brief Stack size of the LVGL task in bytes. */
int task_stack_size;
#ifdef ESP_PLATFORM
/** @brief CPU affinity of the LVGL task (ESP32 specific). */
int task_affinity;
#endif
};
/**
* @brief Configures the LVGL module.
*
* @warning This must be called before starting the module.
* @param config The configuration to apply.
*/
void lvgl_module_configure(struct LvglModuleConfig config);
/**
* @brief Locks the LVGL mutex.
*
@@ -1,10 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
@@ -13,6 +9,10 @@ extern "C" {
#include <tactility/device.h>
#include <tactility/error.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Configuration for binding a kernel DisplayApi device to an lv_display_t.
*/
@@ -14,17 +14,17 @@ enum LvglFontSize {
FONT_SIZE_LARGE,
};
const lv_font_t* lvgl_get_shared_icon_font();
uint32_t lvgl_get_shared_icon_font_height();
const lv_font_t* lvgl_get_shared_icon_font(void);
uint32_t lvgl_get_shared_icon_font_height(void);
const lv_font_t* lvgl_get_text_font(enum LvglFontSize font_size);
uint32_t lvgl_get_text_font_height(enum LvglFontSize font_size);
const lv_font_t* lvgl_get_launcher_icon_font();
uint32_t lvgl_get_launcher_icon_font_height();
const lv_font_t* lvgl_get_launcher_icon_font(void);
uint32_t lvgl_get_launcher_icon_font_height(void);
const lv_font_t* lvgl_get_statusbar_icon_font();
uint32_t lvgl_get_statusbar_icon_font_height();
const lv_font_t* lvgl_get_statusbar_icon_font(void);
uint32_t lvgl_get_statusbar_icon_font_height(void);
#ifdef __cplusplus
}
@@ -1,15 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <lvgl.h>
#include <tactility/device.h>
#include <tactility/error.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Creates an lv_indev_t bound to the given KEYBOARD_TYPE device and registers a read callback
* that polls the device through its KeyboardApi.
@@ -1,15 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <lvgl.h>
#include <tactility/device.h>
#include <tactility/error.h>
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Linear per-axis calibration range for raw pointer coordinates.
*
+51
View File
@@ -0,0 +1,51 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief The LVGL module instance.
*/
extern struct Module lvgl_module;
/**
* @brief Configuration for the LVGL module.
*/
struct LvglModuleConfig {
/**
* @brief Callback invoked when the LVGL task starts.
* Use this to add devices (e.g. displays, pointers), start services, create widgets, etc.
*/
void (*on_start)(void);
/**
* @brief Callback invoked when the LVGL task stops.
* Use this to remove devices, stop services, etc.
*/
void (*on_stop)(void);
/** @brief Priority of the LVGL task. */
int task_priority;
/** @brief Stack size of the LVGL task in bytes. */
int task_stack_size;
#ifdef ESP_PLATFORM
/** @brief CPU affinity of the LVGL task (ESP32 specific). */
int task_affinity;
#endif
};
/**
* @brief Configures the LVGL module.
*
* @warning This must be called before starting the module.
* @param config The configuration to apply.
*/
void lvgl_module_configure(struct LvglModuleConfig config);
#ifdef __cplusplus
}
#endif