Device migrations, driver migrations and more (#575)

This commit is contained in:
Ken Van Hoeylandt
2026-07-20 23:43:17 +02:00
committed by GitHub
parent 2d768ef3a1
commit 2fbc44466a
221 changed files with 8824 additions and 3652 deletions
@@ -1,7 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "Source"
REQUIRES Tactility esp_lvgl_port GC9A01 CST816S PwmBacklight driver
INCLUDE_DIRS "source"
REQUIRES TactilityKernel
)
@@ -1,21 +0,0 @@
#include "devices/Display.h"
#include <Tactility/hal/Configuration.h>
#include <PwmBacklight.h>
using namespace tt::hal;
static DeviceVector createDevices() {
return {
createDisplay(),
};
}
static bool initBoot() {
return driver::pwmbacklight::init(GPIO_NUM_2, 256);
}
extern const Configuration hardwareConfiguration = {
.initBoot = initBoot,
.createDevices = createDevices
};
@@ -1,45 +0,0 @@
#include "Display.h"
#include <Cst816Touch.h>
#include <PwmBacklight.h>
#include <Gc9a01Display.h>
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Cst816sTouch::Configuration>(
I2C_NUM_0,
240,
240,
false,
true,
true,
GPIO_NUM_13,
GPIO_NUM_5
);
return std::make_shared<Cst816sTouch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto touch = createTouch();
auto configuration = std::make_unique<Gc9a01Display::Configuration>(
SPI2_HOST,
GPIO_NUM_9,
GPIO_NUM_8,
240,
240,
touch,
false,
false,
true,
true,
0,
LCD_RGB_ELEMENT_ORDER_BGR
);
configuration->resetPin = GPIO_NUM_14;
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
auto display = std::make_shared<Gc9a01Display>(std::move(configuration));
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
}
@@ -1,5 +0,0 @@
#pragma once
#include "Tactility/hal/display/DisplayDevice.h"
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
@@ -1,23 +0,0 @@
#include <tactility/module.h>
extern "C" {
static error_t start() {
// Empty for now
return ERROR_NONE;
}
static error_t stop() {
// Empty for now
return ERROR_NONE;
}
struct Module waveshare_s3_touch_lcd_128_module = {
.name = "waveshare-s3-touch-lcd-128",
.start = start,
.stop = stop,
.symbols = nullptr,
.internal = nullptr
};
}
@@ -14,7 +14,9 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M
hardware.bluetooth=true
storage.userDataLocation=SD
dependencies.useDeprecatedHal=false
storage.userDataLocation=Internal
display.size=1.28"
display.shape=circle
@@ -1,4 +1,6 @@
dependencies:
- Platforms/platform-esp32
- Drivers/qmi8658-module
- Drivers/cst816t-module
- Drivers/gc9a01-module
dts: waveshare,s3-touch-lcd-128.dts
@@ -0,0 +1,14 @@
#include <tactility/error.h>
#include <tactility/module.h>
extern "C" {
Module waveshare_s3_touch_lcd_128_module = {
.name = "waveshare-s3-touch-lcd-128",
.start = [] -> error_t { return ERROR_NONE; },
.stop = [] -> error_t { return ERROR_NONE; },
.symbols = nullptr,
.internal = nullptr
};
}
@@ -8,7 +8,10 @@
#include <tactility/bindings/esp32_spi.h>
#include <bindings/qmi8658.h>
#include <tactility/bindings/esp32_sdspi.h>
#include <tactility/bindings/display_placeholder.h>
#include <tactility/bindings/esp32_pwm_ledc.h>
#include <tactility/bindings/pwm_backlight.h>
#include <bindings/cst816t.h>
#include <bindings/gc9a01.h>
// Reference: https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-1.28
/ {
@@ -41,6 +44,33 @@
compatible = "qst,qmi8658";
reg = <0x6B>;
};
touch0 {
compatible = "hynitron,cst816t";
reg = <0x15>;
x-max = <240>;
y-max = <240>;
mirror-x;
mirror-y;
pin-reset = <&gpio0 13 GPIO_FLAG_NONE>;
pin-interrupt = <&gpio0 5 GPIO_FLAG_NONE>;
};
};
display_backlight_pwm {
compatible = "espressif,esp32-pwm-ledc";
pin = <&gpio0 2 GPIO_FLAG_NONE>;
period-ns = <3906250>;
ledc-timer = <0>;
ledc-channel = <0>;
};
display_backlight {
compatible = "pwm-backlight";
// Off by default so display power-on won't show the screen from before the last power loss.
// The display backlight is turned on during the boot process.
status = "disabled";
pwm = <&display_backlight_pwm>;
};
spi0 {
@@ -50,23 +80,17 @@
pin-mosi = <&gpio0 11 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 12 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 10 GPIO_FLAG_NONE>;
display {
compatible = "display-placeholder";
};
};
spi1 {
compatible = "espressif,esp32-spi";
host = <SPI3_HOST>;
cs-gpios = <&gpio0 18 GPIO_FLAG_NONE>;
pin-mosi = <&gpio0 16 GPIO_FLAG_NONE>;
pin-miso = <&gpio0 15 GPIO_FLAG_NONE>;
pin-sclk = <&gpio0 17 GPIO_FLAG_NONE>;
sdcard@0 {
compatible = "espressif,esp32-sdspi";
frequency-khz = <20000>;
display@0 {
compatible = "galaxycore,gc9a01";
horizontal-resolution = <240>;
vertical-resolution = <240>;
mirror-y;
invert-color;
bgr-order;
pin-dc = <&gpio0 8 GPIO_FLAG_NONE>;
pin-reset = <&gpio0 14 GPIO_FLAG_NONE>;
backlight = <&display_backlight>;
};
};
};