Add initial support for LilyGO T-HMI S3 with device configuration and… (#509)

This commit is contained in:
Rivair Sabino dos Santos
2026-03-03 18:38:42 -03:00
committed by GitHub
parent 33caf09856
commit 2426c387eb
14 changed files with 292 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
#include "devices/Power.h"
#include "devices/Display.h"
#include "PwmBacklight.h"
#include "Tactility/kernel/SystemEvents.h"
#include <Tactility/TactilityCore.h>
#define TAG "thmi-s3"
static bool powerOn() {
gpio_config_t power_signal_config = {
.pin_bit_mask = (1ULL << THMI_S3_POWERON_GPIO) | (1ULL << THMI_S3_POWEREN_GPIO),
.mode = GPIO_MODE_OUTPUT,
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.intr_type = GPIO_INTR_DISABLE,
};
if (gpio_config(&power_signal_config) != ESP_OK) {
return false;
}
if (gpio_set_level(THMI_S3_POWERON_GPIO, 1) != ESP_OK) {
return false;
}
if (gpio_set_level(THMI_S3_POWEREN_GPIO, 1) != ESP_OK) {
return false;
}
return true;
}
bool initBoot() {
ESP_LOGI(TAG, "Powering on the board...");
if (!powerOn()) {
ESP_LOGE(TAG, "Failed to power on the board.");
return false;
}
if (!driver::pwmbacklight::init(DISPLAY_BL, 30000)) {
ESP_LOGE(TAG, "Failed to initialize backlight.");
return false;
}
return true;
}