mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Implement SPI devices in dts files for all devices - Removed `tt::hal::spi` HAL and its configurations - Fix for devicetree generator "boolean" support - Remove unused custom locks in all `DisplayDevice` implementations - Fixed some bugs with devices - Updated XPT2046 driver - Fix for `WifiEsp` deadlock - Export a lot of new `math.h` symbols with `tt_init.cpp` - Created `SpiDeviceLock` in `TactilityCore` as a wrapper for kernel SPI locking - Improved `TactilityKernel` SPI driver.
43 lines
1019 B
C++
43 lines
1019 B
C++
#include "devices/Power.h"
|
|
#include "devices/Display.h"
|
|
|
|
#include "PwmBacklight.h"
|
|
#include "Tactility/kernel/SystemEvents.h"
|
|
#include <Tactility/TactilityCore.h>
|
|
|
|
#define TAG "tdisplay-s3"
|
|
|
|
static bool powerOn() {
|
|
gpio_config_t power_signal_config = {
|
|
.pin_bit_mask = BIT64(TDISPLAY_S3_POWERON_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(TDISPLAY_S3_POWERON_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;
|
|
} |