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,6 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <tactility/module.h>
#ifdef __cplusplus
extern "C" {
#endif
+1 -1
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/crypt.h>
#include <crypt/crypt.h>
#include <tactility/check.h>
#include <tactility/log.h>
+1 -1
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/hash.h>
#include <crypt/hash.h>
uint32_t djb2_str(const char* str) {
uint32_t hash = 5381;
+3 -3
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/crypt.h>
#include <tactility/hash.h>
#include <tactility/module.h>
#include <crypt/crypt.h>
#include <crypt/hash.h>
#include <crypt/module.h>
extern "C" {
+1 -1
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <gps/gps_module.h>
#include <gps/module.h>
#include <gps/private/gps_ledger.h>
#include <tactility/error.h>
@@ -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
+3 -2
View File
@@ -3,9 +3,10 @@
#include <esp_lvgl_port.h>
#include <tactility/time.h>
#include <lvgl/lvgl.h>
#include <lvgl/module.h>
#include <tactility/error.h>
#include <tactility/lvgl_module.h>
#include <tactility/time.h>
extern struct LvglModuleConfig lvgl_module_config;
extern void lvgl_devices_attach();
+2 -1
View File
@@ -10,7 +10,8 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <lvgl/module.h>
extern struct LvglModuleConfig lvgl_module_config;
extern void lvgl_devices_attach();
+6
View File
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#include <lvgl/lvgl.h>
enum UiDensity lvgl_get_ui_density(void) {
return TT_LVGL_UI_DENSITY;
}
+4 -4
View File
@@ -3,10 +3,10 @@
#include <tactility/drivers/keyboard.h>
#include <tactility/drivers/pointer.h>
#include <tactility/log.h>
#include <tactility/lvgl_display.h>
#include <tactility/lvgl_keyboard.h>
#include <tactility/lvgl_module.h>
#include <tactility/lvgl_pointer.h>
#include <lvgl/lvgl_display.h>
#include <lvgl/lvgl_keyboard.h>
#include <lvgl/lvgl.h>
#include <lvgl/lvgl_pointer.h>
#include <lvgl.h>
+2 -2
View File
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/lvgl_display.h>
#include <lvgl/lvgl_display.h>
#include <tactility/lvgl_ppa.h>
#include <lvgl/lvgl_ppa.h>
#include <tactility/device.h>
#include <tactility/driver.h>
+1 -1
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#include <lvgl.h>
#include <tactility/lvgl_fonts.h>
#include <lvgl/lvgl_fonts.h>
#include <tactility/check.h>
// The preprocessor definitions that are used below are defined in the CMakeLists.txt from this module.
+1 -1
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/lvgl_keyboard.h>
#include <lvgl/lvgl_keyboard.h>
#include <tactility/drivers/keyboard.h>
+1 -1
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/lvgl_pointer.h>
#include <lvgl/lvgl_pointer.h>
#include <tactility/drivers/pointer.h>
+1 -1
View File
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/lvgl_ppa.h>
#include <lvgl/lvgl_ppa.h>
#include <tactility/log.h>
+2 -6
View File
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
#include <lvgl.h>
#include <lvgl/module.h>
#include <string.h>
#include <tactility/module.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
extern const struct ModuleSymbol lvgl_module_symbols[];
error_t lvgl_arch_start();
@@ -60,10 +60,6 @@ bool lvgl_is_running() {
return is_running;
}
enum UiDensity lvgl_get_ui_density(void) {
return TT_LVGL_UI_DENSITY;
}
struct Module lvgl_module = {
.name = "lvgl",
.start = start,
+2 -2
View File
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/lvgl_module.h>
#include <tactility/lvgl_fonts.h>
#include <lvgl/lvgl.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl.h>
#include <tactility/module.h>