Merge develop into main (#337)

- Implement `UiScale` in `hal::Configuration`: small screens with no touch can now opt for a more optimized experience (e.g. Cardputer, Waveshare 1.47, Waveshare 1.3", etc.)
- Fix for Cardputer UART configuration and added I2C configuration
- Fix for software keyboard bug in Gui
- Removed deprecated fields from `hal::Configuration`
- Updated the simulator devices to use the new HAL config
- add `bool tt::hal::hasDevice(Device::Type)`
- Cleanup of `AppList` app code
- Improve `Gpio` app for small screen devices
- Added various ESP32 GCC wrappers to wrap LVGL functions (with manipulations for small screen devices)
- Moved `Launcher` assets to `assets/` subfolder
- Optimized `Toolbar` for small screen devices
- Stop showing `system/` partition in `FileBrowser` because it's read-only and not very useful. Created `config::SHOW_SYSTEM_PARTITION` to override this behaviour.
- Hide apps when their required hardware isn't available (I2C, UART, PowerDevice)
- Fix for `CYD-2432S032C` DPI setting
This commit is contained in:
Ken Van Hoeylandt
2025-09-15 22:46:12 +02:00
committed by GitHub
parent ce8ac61d42
commit 53b711584f
42 changed files with 394 additions and 189 deletions
+10 -23
View File
@@ -9,14 +9,6 @@ namespace tt::hal {
typedef bool (*InitBoot)();
namespace display { class DisplayDevice; }
namespace keyboard { class KeyboardDevice; }
namespace power { class PowerDevice; }
typedef std::shared_ptr<display::DisplayDevice> (*CreateDisplay)();
typedef std::shared_ptr<keyboard::KeyboardDevice> (*CreateKeyboard)();
typedef std::shared_ptr<power::PowerDevice> (*CreatePower)();
typedef std::vector<std::shared_ptr<Device>> DeviceVector;
typedef std::shared_ptr<Device> (*CreateDevice)();
@@ -26,6 +18,14 @@ enum class LvglInit {
None
};
/** Affects LVGL widget style */
enum class UiScale {
/** Ideal for very small non-touch screen devices (e.g. Waveshare S3 LCD 1.3") */
Smallest,
/** Nothing was changed in the LVGL UI/UX */
Default
};
struct Configuration {
/**
* Called before I2C/SPI/etc is initialized.
@@ -36,21 +36,8 @@ struct Configuration {
/** Init behaviour: default (esp_lvgl_port for ESP32, nothing for PC) or None (nothing on any platform). Only used in Tactility, not in TactilityHeadless. */
const LvglInit lvglInit = LvglInit::Default;
/** Display HAL functionality. */
[[deprecated("use createDevices")]]
const CreateDisplay _Nullable createDisplay = nullptr;
/** Keyboard HAL functionality. */
[[deprecated("use createDevices")]]
const CreateKeyboard _Nullable createKeyboard = nullptr;
/** An optional SD card interface. */
[[deprecated("use createDevices")]]
const std::shared_ptr<sdcard::SdCardDevice> _Nullable sdcard = nullptr;
/** An optional power interface for battery or other power delivery. */
[[deprecated("use createDevices")]]
const CreatePower _Nullable power = nullptr;
/** Modify LVGL widget size */
const UiScale uiScale = UiScale::Default;
std::function<DeviceVector()> createDevices = [] { return std::vector<std::shared_ptr<Device>>(); };
+3 -1
View File
@@ -8,7 +8,6 @@
#include <cassert>
namespace tt::hal {
/** Base class for HAL-related devices. */
class Device {
@@ -119,4 +118,7 @@ std::shared_ptr<DeviceType> findFirstDevice(Device::Type type) {
}
}
/** @return true if there are 1 or more devices of the specified type */
bool hasDevice(Device::Type type);
}