Implement SD card for WaveShare S3 Touch LCD 4.3" (#546)

This commit is contained in:
Ken Van Hoeylandt
2026-07-04 09:28:31 +02:00
committed by GitHub
parent 05720821f8
commit a323f8e148
4 changed files with 20 additions and 5 deletions
@@ -2,8 +2,22 @@
#include <Tactility/hal/Configuration.h> #include <Tactility/hal/Configuration.h>
#include <tactility/drivers/i2c_controller.h>
using namespace tt::hal; using namespace tt::hal;
static bool init() {
auto* i2c = device_find_by_name("i2c0");
check(i2c);
uint8_t write_buf = 0x01;
i2c_controller_write(i2c, 0x24, &write_buf, 1, 200 / portTICK_PERIOD_MS);
write_buf = 0x0E; // Pin 2, 3 and 4 high, pin 1 and 5 low
i2c_controller_write(i2c, 0x38, &write_buf, 1, 200 / portTICK_PERIOD_MS);
return true;
}
static DeviceVector createDevices() { static DeviceVector createDevices() {
return { return {
createDisplay(), createDisplay(),
@@ -11,5 +25,6 @@ static DeviceVector createDevices() {
} }
extern const Configuration hardwareConfiguration = { extern const Configuration hardwareConfiguration = {
.initBoot = init,
.createDevices = createDevices .createDevices = createDevices
}; };
@@ -12,7 +12,7 @@ static error_t stop() {
return ERROR_NONE; return ERROR_NONE;
} }
struct Module waveshare_s3_touch_lcd_43_module = { Module waveshare_s3_touch_lcd_43_module = {
.name = "waveshare-s3-touch-lcd-43", .name = "waveshare-s3-touch-lcd-43",
.start = start, .start = start,
.stop = stop, .stop = stop,
@@ -13,7 +13,7 @@ hardware.tinyUsb=true
hardware.esptoolFlashFreq=120M hardware.esptoolFlashFreq=120M
hardware.bluetooth=true hardware.bluetooth=true
storage.userDataLocation=Internal storage.userDataLocation=SD
display.size=4.3" display.size=4.3"
display.shape=rectangle display.shape=rectangle
@@ -26,8 +26,8 @@
compatible = "espressif,esp32-i2c"; compatible = "espressif,esp32-i2c";
port = <I2C_NUM_0>; port = <I2C_NUM_0>;
clock-frequency = <400000>; clock-frequency = <400000>;
pin-sda = <&gpio0 8 GPIO_FLAG_NONE>; pin-sda = <&gpio0 8 GPIO_FLAG_PULL_UP>;
pin-scl = <&gpio0 9 GPIO_FLAG_NONE>; pin-scl = <&gpio0 9 GPIO_FLAG_PULL_UP>;
}; };
spi0 { spi0 {