mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 02:43:15 +00:00
* Updated runtime gating to enable LilyGO T-Deck specific apps and services * New device compatibility and model-detection APIs * Added a buffer-overflow error code and message * Updated GitHub Actions checkout to v4 * Adjusted an LVGL-related library version * Device config now emits a T-Deck workaround flag when applicable * Removed internal developer comments and minor cleanups
47 lines
1.4 KiB
C++
47 lines
1.4 KiB
C++
#include "Display.h"
|
|
|
|
#include <Ft5x06Touch.h>
|
|
#include <PwmBacklight.h>
|
|
#include <St7789Display.h>
|
|
|
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
|
I2C_NUM_0,
|
|
LCD_HORIZONTAL_RESOLUTION,
|
|
LCD_VERTICAL_RESOLUTION,
|
|
false,
|
|
false,
|
|
false
|
|
);
|
|
|
|
return std::make_shared<Ft5x06Touch>(std::move(configuration));
|
|
}
|
|
|
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
St7789Display::Configuration panel_configuration = {
|
|
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
|
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
|
.gapX = 0,
|
|
.gapY = 0,
|
|
.swapXY = false,
|
|
.mirrorX = false,
|
|
.mirrorY = false,
|
|
.invertColor = true,
|
|
.bufferSize = LCD_BUFFER_SIZE,
|
|
.touch = createTouch(),
|
|
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
|
|
.resetPin = GPIO_NUM_NC,
|
|
.lvglSwapBytes = false
|
|
};
|
|
|
|
auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
|
|
.spiHostDevice = LCD_SPI_HOST,
|
|
.csPin = LCD_PIN_CS,
|
|
.dcPin = LCD_PIN_DC,
|
|
.pixelClockFrequency = 62'500'000,
|
|
.transactionQueueDepth = 10
|
|
});
|
|
|
|
return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
|
|
}
|