Merge develop into main (#316)

- Updated all boards to use `hal::Configuration.createDevices`
- Updated all boards to use new directory structure and file naming convention
- Refactored `Xpt2046SoftSpi` driver.
- Created `Axp2101Power` device in `Drivers/AXP2101`
- Removed global static instances from some drivers (instances that kept a reference to the Device*)
- Improved `SystemInfoApp` UI: better memory labels, hide external memory bar when there's no PSRAM
- Fix for HAL: register touch devices after displays are registered
- Fix for Boot splash hanging on WiFi init: unlock file lock after using it
This commit is contained in:
Ken Van Hoeylandt
2025-09-03 22:05:28 +02:00
committed by GitHub
parent 1deaf4c426
commit 1627b9fa85
135 changed files with 543 additions and 577 deletions
+11 -6
View File
@@ -1,20 +1,25 @@
#include "CYD4848S040C.h"
#include "hal/CydDisplay.h"
#include "hal/CydSdCard.h"
#include "devices/St7701Display.h"
#include "devices/SdCard.h"
#include <PwmBacklight.h>
using namespace tt::hal;
bool initBoot() {
static bool initBoot() {
return driver::pwmbacklight::init(GPIO_NUM_38, 1000);
}
static DeviceVector createDevices() {
return {
std::reinterpret_pointer_cast<Device>(std::make_shared<St7701Display>()),
createSdCard()
};
}
const Configuration cyd_4848s040c_config = {
.initBoot = initBoot,
.createDisplay = createDisplay,
.sdcard = createSdCard(),
.power = nullptr,
.createDevices = createDevices,
.i2c = {
//Touch
i2c::Configuration {
@@ -1,4 +1,4 @@
#include "CydSdCard.h"
#include "SdCard.h"
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -1,4 +1,4 @@
#include "CydDisplay.h"
#include "St7701Display.h"
#include <Gt911Touch.h>
#include <PwmBacklight.h>
@@ -11,7 +11,7 @@
#include <esp_lcd_panel_io_additions.h>
#include <esp_lcd_st7701.h>
constexpr auto TAG = "ST7701";
constexpr auto TAG = "St7701Display";
static const st7701_lcd_init_cmd_t st7701_lcd_init_cmds[] = {
// {cmd, { data }, data_size, delay_ms}
@@ -56,7 +56,7 @@ static const st7701_lcd_init_cmd_t st7701_lcd_init_cmds[] = {
{0x29, (uint8_t[]) {0x00}, 0, 0}, //Display On
};
bool CydDisplay::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
bool St7701Display::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
spi_line_config_t line_config = {
.cs_io_type = IO_TYPE_GPIO,
.cs_gpio_num = GPIO_NUM_39,
@@ -70,7 +70,7 @@ bool CydDisplay::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
return esp_lcd_new_panel_io_3wire_spi(&panel_io_config, &outHandle) == ESP_OK;
}
bool CydDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
bool St7701Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
const esp_lcd_rgb_panel_config_t rgb_config = {
.clk_src = LCD_CLK_SRC_DEFAULT,
.timings = {
@@ -180,7 +180,7 @@ bool CydDisplay::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_p
return true;
}
lvgl_port_display_cfg_t CydDisplay::getLvglPortDisplayConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
lvgl_port_display_cfg_t St7701Display::getLvglPortDisplayConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
return {
.io_handle = ioHandle,
.panel_handle = panelHandle,
@@ -208,7 +208,7 @@ lvgl_port_display_cfg_t CydDisplay::getLvglPortDisplayConfig(esp_lcd_panel_io_ha
};
}
lvgl_port_display_rgb_cfg_t CydDisplay::getLvglPortDisplayRgbConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
lvgl_port_display_rgb_cfg_t St7701Display::getLvglPortDisplayRgbConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
return {
.flags = {
.bb_mode = true,
@@ -217,7 +217,7 @@ lvgl_port_display_rgb_cfg_t CydDisplay::getLvglPortDisplayRgbConfig(esp_lcd_pane
};
}
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable CydDisplay::getTouchDevice() {
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable St7701Display::getTouchDevice() {
if (touchDevice == nullptr) {
auto configuration = std::make_unique<Gt911Touch::Configuration>(
I2C_NUM_0,
@@ -231,11 +231,6 @@ std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable CydDisplay::getTouchDevic
return touchDevice;
}
void CydDisplay::setBacklightDuty(uint8_t backlightDuty) {
void St7701Display::setBacklightDuty(uint8_t backlightDuty) {
driver::pwmbacklight::setBacklightDuty(backlightDuty);
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto display = std::make_shared<CydDisplay>();
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
}
@@ -5,7 +5,7 @@
#include <EspLcdDisplay.h>
#include <lvgl.h>
class CydDisplay final : public EspLcdDisplay {
class St7701Display final : public EspLcdDisplay {
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable touchDevice;
@@ -21,7 +21,7 @@ class CydDisplay final : public EspLcdDisplay {
public:
CydDisplay() : EspLcdDisplay(std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive)) {}
St7701Display() : EspLcdDisplay(std::make_shared<tt::Mutex>(tt::Mutex::Type::Recursive)) {}
std::string getName() const override { return "ST7701S"; }
@@ -33,5 +33,3 @@ public:
bool supportsBacklightDuty() const override { return true; }
};
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();