Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Devices/lilygo-tdeck-plus/source/module.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <tactility/delay.h>
#include <tactility/error.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <tactility/module.h>

#include <Tactility/SystemEvents.h>
Expand Down
2 changes: 1 addition & 1 deletion Devices/lilygo-tdeck/source/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <tactility/error.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>

#include <Tactility/SystemEvents.h>
#include <Tactility/LogMessages.h>
Expand Down
2 changes: 1 addition & 1 deletion Devices/lilygo-tlora-pager/source/module.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <tactility/module.h>

#include <Tactility/SystemEvents.h>
Expand Down
2 changes: 1 addition & 1 deletion Devices/m5stack-tab5/Source/devices/tab5_keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <tactility/drivers/i2c_controller.h>
#include <tactility/drivers/keyboard.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <tactility/module.h>

#include <driver/gpio.h>
Expand Down
1 change: 1 addition & 0 deletions Documentation/ideas.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

## Higher Priority

- Improve kernel_init.cpp (and other modules): create driver_ensure_added() and driver_ensure_destructed()
- Remove and migrate `Include/Tactility/kernel/Kernel.h` into `tactility/delay.h`
- Drivers/audio-codec-module is not a module. Move it somewhere else. Or make it an actual module.
- LilyGO T-Dongle S3: 1 button control, stop auto-launching web server
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#include <tactility/module.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
2 changes: 1 addition & 1 deletion Modules/crypt-module/source/crypt.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Modules/crypt-module/source/hash.cpp
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Modules/crypt-module/source/module.cpp
Original file line number Diff line number Diff line change
@@ -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" {

Expand Down
2 changes: 1 addition & 1 deletion Modules/gps-module/source/module.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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") */
Expand All @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>

Expand All @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down
51 changes: 51 additions & 0 deletions Modules/lvgl-module/include/lvgl/module.h
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions Modules/lvgl-module/source/arch/lvgl_esp32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion Modules/lvgl-module/source/arch/lvgl_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions Modules/lvgl-module/source/lvgl.c
Original file line number Diff line number Diff line change
@@ -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;
}
8 changes: 4 additions & 4 deletions Modules/lvgl-module/source/lvgl_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
4 changes: 2 additions & 2 deletions Modules/lvgl-module/source/lvgl_display.c
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion Modules/lvgl-module/source/lvgl_fonts.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Modules/lvgl-module/source/lvgl_keyboard.c
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion Modules/lvgl-module/source/lvgl_pointer.c
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
2 changes: 1 addition & 1 deletion Modules/lvgl-module/source/lvgl_ppa.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
#include <tactility/lvgl_ppa.h>
#include <lvgl/lvgl_ppa.h>

#include <tactility/log.h>

Expand Down
Loading
Loading