Tab5 audio, I2C improvements, UiDensity moved to lvgl-module and cleanup (#506)

- UiDensity moved to lvgl-module
- Deleted tt_hal and tt_hal_gpio (breaks apps, but will fix those right after merging)
- Added I2C 8 bit register operations
- Added device.properties to simulator
- Improved Tab5 hardware init, implement audio
- Add README.md to kernel
This commit is contained in:
Ken Van Hoeylandt
2026-02-15 19:45:12 +01:00
committed by GitHub
parent 3a24d058c9
commit d860ba1f34
54 changed files with 417 additions and 179 deletions
+4 -3
View File
@@ -12,6 +12,7 @@
#include <Tactility/settings/DisplaySettings.h>
#include <lvgl.h>
#include <tactility/lvgl_module.h>
namespace tt::app::display {
@@ -122,7 +123,7 @@ public:
void onShow(AppContext& app, lv_obj_t* parent) override {
displaySettings = settings::display::loadOrGetDefault();
auto ui_density = hal::getConfiguration()->uiDensity;
auto ui_density = lvgl_get_ui_density();
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
lv_obj_set_style_pad_row(parent, 0, LV_STATE_DEFAULT);
@@ -144,7 +145,7 @@ public:
lv_obj_set_size(brightness_wrapper, LV_PCT(100), LV_SIZE_CONTENT);
lv_obj_set_style_pad_hor(brightness_wrapper, 0, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(brightness_wrapper, 0, LV_STATE_DEFAULT);
if (ui_density != hal::UiDensity::Compact) {
if (ui_density != LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_ver(brightness_wrapper, 4, LV_STATE_DEFAULT);
}
@@ -168,7 +169,7 @@ public:
lv_obj_set_size(gamma_wrapper, LV_PCT(100), LV_SIZE_CONTENT);
lv_obj_set_style_pad_hor(gamma_wrapper, 0, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(gamma_wrapper, 0, LV_STATE_DEFAULT);
if (ui_density != hal::UiDensity::Compact) {
if (ui_density != LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_ver(gamma_wrapper, 4, LV_STATE_DEFAULT);
}
+5 -4
View File
@@ -12,13 +12,14 @@
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_launcher.h>
#include <tactility/lvgl_module.h>
namespace tt::app::launcher {
static const auto LOGGER = Logger("Launcher");
static uint32_t getButtonPadding(hal::UiDensity density, uint32_t buttonSize) {
if (density == hal::UiDensity::Compact) {
static uint32_t getButtonPadding(UiDensity density, uint32_t buttonSize) {
if (density == LVGL_UI_DENSITY_COMPACT) {
return 0;
} else {
return buttonSize / 8;
@@ -27,7 +28,7 @@ static uint32_t getButtonPadding(hal::UiDensity density, uint32_t buttonSize) {
class LauncherApp final : public App {
static lv_obj_t* createAppButton(lv_obj_t* parent, hal::UiDensity uiDensity, const char* imageFile, const char* appId, int32_t itemMargin, bool isLandscape) {
static lv_obj_t* createAppButton(lv_obj_t* parent, UiDensity uiDensity, const char* imageFile, const char* appId, int32_t itemMargin, bool isLandscape) {
const auto button_size = lvgl_get_launcher_icon_font_height();
const auto button_padding = getButtonPadding(uiDensity, button_size);
auto* apps_button = lv_button_create(parent);
@@ -119,7 +120,7 @@ public:
void onShow(AppContext& app, lv_obj_t* parent) override {
auto* buttons_wrapper = lv_obj_create(parent);
auto ui_density = hal::getConfiguration()->uiDensity;
auto ui_density = lvgl_get_ui_density();
const auto button_size = lvgl_get_launcher_icon_font_height();
const auto button_padding = getButtonPadding(ui_density, button_size);
const auto total_button_size = button_size + (button_padding * 2);
@@ -1,19 +1,20 @@
#include <Tactility/TactilityConfig.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/lvgl/Toolbar.h>
#include <Tactility/hal/sdcard/SdCardDevice.h>
#include <Tactility/Tactility.h>
#include <Tactility/Timer.h>
#include <algorithm>
#include <cstring>
#include <format>
#include <lvgl.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/hal/Device.h>
#include <tactility/lvgl_icon_shared.h>
#include <utility>
#include <cstring>
#include <tactility/hal/Device.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_shared.h>
#include <tactility/lvgl_module.h>
#ifdef ESP_PLATFORM
#include <esp_vfs_fat.h>
@@ -150,7 +151,7 @@ static MemoryBarWidgets createMemoryBar(lv_obj_t* parent, const char* label) {
lv_obj_set_width(bottom_label, LV_PCT(100));
lv_obj_set_style_text_align(bottom_label, LV_TEXT_ALIGN_RIGHT, 0);
if (hal::getConfiguration()->uiDensity == hal::UiDensity::Compact) {
if (lvgl_get_ui_density() == LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_bottom(bottom_label, 2, LV_STATE_DEFAULT);
} else {
lv_obj_set_style_pad_bottom(bottom_label, 12, LV_STATE_DEFAULT);
@@ -1,13 +1,13 @@
#ifdef ESP_PLATFORM
#include <Tactility/Tactility.h>
#include <Tactility/settings/TrackballSettings.h>
#include <Tactility/lvgl/Toolbar.h>
#include <lvgl.h>
#include <tactility/lvgl_icon_shared.h>
#include <tactility/lvgl_module.h>
#include <Tactility/Tactility.h>
#include <Tactility/settings/TrackballSettings.h>
#include <Tactility/lvgl/Toolbar.h>
// Forward declare driver functions
namespace trackball {
@@ -109,7 +109,7 @@ class TrackballSettingsApp final : public App {
public:
void onShow(AppContext& app, lv_obj_t* parent) override {
tbSettings = settings::trackball::loadOrGetDefault();
auto ui_density = hal::getConfiguration()->uiDensity;
auto ui_density = lvgl_get_ui_density();
updated = false;
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
@@ -154,7 +154,7 @@ public:
lv_obj_set_size(enc_sens_wrapper, LV_PCT(100), LV_SIZE_CONTENT);
lv_obj_set_style_pad_hor(enc_sens_wrapper, 0, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(enc_sens_wrapper, 0, LV_STATE_DEFAULT);
if (ui_density != hal::UiDensity::Compact) {
if (ui_density != LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_ver(enc_sens_wrapper, 4, LV_STATE_DEFAULT);
}
@@ -178,7 +178,7 @@ public:
lv_obj_set_size(ptr_sens_wrapper, LV_PCT(100), LV_SIZE_CONTENT);
lv_obj_set_style_pad_hor(ptr_sens_wrapper, 0, LV_STATE_DEFAULT);
lv_obj_set_style_border_width(ptr_sens_wrapper, 0, LV_STATE_DEFAULT);
if (ui_density != hal::UiDensity::Compact) {
if (ui_density != LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_ver(ptr_sens_wrapper, 4, LV_STATE_DEFAULT);
}
+7 -6
View File
@@ -1,5 +1,10 @@
#include <Tactility/network/HttpdReq.h>
#include <format>
#include <string>
#include <set>
#include <tactility/lvgl_module.h>
#include <Tactility/network/HttpdReq.h>
#include <Tactility/app/wifimanage/View.h>
#include <Tactility/app/wifimanage/WifiManagePrivate.h>
#include <Tactility/Logger.h>
@@ -9,10 +14,6 @@
#include <Tactility/service/wifi/WifiSettings.h>
#include <Tactility/Tactility.h>
#include <format>
#include <string>
#include <set>
namespace tt::app::wifimanage {
static const auto LOGGER = Logger("WifiManageView");
@@ -162,7 +163,7 @@ void View::updateNetworkList() {
lv_obj_add_event_cb(enable_on_boot_switch, onEnableOnBootSwitchChanged, LV_EVENT_VALUE_CHANGED, bindings);
lv_obj_add_event_cb(enable_on_boot_wrapper, onEnableOnBootParentClicked, LV_EVENT_SHORT_CLICKED, enable_on_boot_switch);
if (hal::getConfiguration()->uiDensity == hal::UiDensity::Compact) {
if (lvgl_get_ui_density() == LVGL_UI_DENSITY_COMPACT) {
lv_obj_set_style_pad_ver(enable_on_boot_wrapper, 2, LV_STATE_DEFAULT);
} else {
lv_obj_set_style_pad_ver(enable_on_boot_wrapper, 8, LV_STATE_DEFAULT);