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:
committed by
GitHub
parent
ce8ac61d42
commit
53b711584f
@@ -25,7 +25,27 @@ static DeviceVector createDevices() {
|
||||
|
||||
extern const Configuration m5stack_cardputer = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.createDevices = createDevices,
|
||||
.i2c {
|
||||
i2c::Configuration {
|
||||
.name = "Port A", // Grove
|
||||
.port = I2C_NUM_1,
|
||||
.initMode = i2c::InitMode::Disabled,
|
||||
.isMutable = true,
|
||||
.config = (i2c_config_t) {
|
||||
.mode = I2C_MODE_MASTER,
|
||||
.sda_io_num = GPIO_NUM_2,
|
||||
.scl_io_num = GPIO_NUM_1,
|
||||
.sda_pullup_en = true,
|
||||
.scl_pullup_en = true,
|
||||
.master = {
|
||||
.clk_speed = 400000
|
||||
},
|
||||
.clk_flags = 0
|
||||
}
|
||||
},
|
||||
},
|
||||
.spi {
|
||||
// Display
|
||||
spi::Configuration {
|
||||
@@ -79,10 +99,10 @@ extern const Configuration m5stack_cardputer = {
|
||||
},
|
||||
.uart {
|
||||
uart::Configuration {
|
||||
.name = "Grove",
|
||||
.name = "Port A",
|
||||
.port = UART_NUM_1,
|
||||
.rxPin = GPIO_NUM_32,
|
||||
.txPin = GPIO_NUM_33,
|
||||
.rxPin = GPIO_NUM_2,
|
||||
.txPin = GPIO_NUM_1,
|
||||
.rtsPin = GPIO_NUM_NC,
|
||||
.ctsPin = GPIO_NUM_NC,
|
||||
.rxBufferSize = 1024,
|
||||
@@ -100,6 +120,6 @@ extern const Configuration m5stack_cardputer = {
|
||||
.backup_before_sleep = 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,12 +28,18 @@ TT_UNUSED static void deinitPower() {
|
||||
#endif
|
||||
}
|
||||
|
||||
static std::vector<std::shared_ptr<Device>> createDevices() {
|
||||
return {
|
||||
std::make_shared<SdlDisplay>(),
|
||||
std::make_shared<SdlKeyboard>(),
|
||||
std::make_shared<SimulatorPower>(),
|
||||
std::make_shared<SimulatorSdCard>()
|
||||
};
|
||||
}
|
||||
|
||||
extern const Configuration hardware = {
|
||||
.initBoot = initBoot,
|
||||
.createDisplay = createDisplay,
|
||||
.createKeyboard = createKeyboard,
|
||||
.sdcard = std::make_shared<SimulatorSdCard>(),
|
||||
.power = simulatorPower,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
i2c::Configuration {
|
||||
.name = "Internal",
|
||||
|
||||
@@ -26,8 +26,3 @@ public:
|
||||
bool supportsDisplayDriver() const override { return false; }
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable getDisplayDriver() override { return nullptr; }
|
||||
};
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
return std::make_shared<SdlDisplay>();
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,3 @@ public:
|
||||
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return handle; }
|
||||
};
|
||||
|
||||
std::shared_ptr<tt::hal::keyboard::KeyboardDevice> createKeyboard() {
|
||||
return std::make_shared<SdlKeyboard>();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "SimulatorPower.h"
|
||||
|
||||
#define TAG "simulator_power"
|
||||
constexpr auto* TAG = "SimulatorPower";
|
||||
|
||||
bool SimulatorPower::supportsMetric(MetricType type) const {
|
||||
switch (type) {
|
||||
@@ -34,13 +34,3 @@ bool SimulatorPower::getMetric(MetricType type, MetricData& data) {
|
||||
|
||||
return false; // Safety guard for when new enum values are introduced
|
||||
}
|
||||
|
||||
static std::shared_ptr<PowerDevice> power;
|
||||
|
||||
std::shared_ptr<PowerDevice> simulatorPower() {
|
||||
if (power == nullptr) {
|
||||
power = std::make_shared<SimulatorPower>();
|
||||
}
|
||||
return power;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/power/PowerDevice.h"
|
||||
#include <Tactility/hal/power/PowerDevice.h>
|
||||
#include <memory>
|
||||
|
||||
using tt::hal::power::PowerDevice;
|
||||
@@ -14,8 +14,8 @@ public:
|
||||
SimulatorPower() = default;
|
||||
~SimulatorPower() override = default;
|
||||
|
||||
std::string getName() const final { return "Power Mock"; }
|
||||
std::string getDescription() const final { return ""; }
|
||||
std::string getName() const override { return "Power Mock"; }
|
||||
std::string getDescription() const override { return ""; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(MetricType type, MetricData& data) override;
|
||||
@@ -24,5 +24,3 @@ public:
|
||||
bool isAllowedToCharge() const override { return allowedToCharge; }
|
||||
void setAllowedToCharge(bool canCharge) override { allowedToCharge = canCharge; }
|
||||
};
|
||||
|
||||
std::shared_ptr<PowerDevice> simulatorPower();
|
||||
|
||||
@@ -20,6 +20,7 @@ static bool initBoot() {
|
||||
|
||||
extern const Configuration waveshare_s3_lcd_13 = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
//IMU
|
||||
|
||||
@@ -13,6 +13,7 @@ static DeviceVector createDevices() {
|
||||
}
|
||||
|
||||
extern const Configuration waveshare_s3_touch_43 = {
|
||||
.uiScale = UiScale::Smallest,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
||||
|
||||
@@ -22,6 +22,7 @@ static bool initBoot() {
|
||||
|
||||
extern const Configuration waveshare_s3_touch_lcd_128 = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
i2c::Configuration {
|
||||
|
||||
@@ -19,6 +19,7 @@ static std::vector<std::shared_ptr<Device>> createDevices() {
|
||||
|
||||
extern const Configuration waveshare_s3_touch_lcd_147 = {
|
||||
.initBoot = initBoot,
|
||||
.uiScale = UiScale::Smallest,
|
||||
.createDevices = createDevices,
|
||||
.i2c = {
|
||||
i2c::Configuration {
|
||||
|
||||
Reference in New Issue
Block a user