mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Refactor `Ili934xDisplay` to use `EspLcdSpiDisplay` as base class - Update `St7789Display` for changes to `EspLcdDisplayV2` related to ILI934x driver - Updated all board driver implementations for ILI934x driver changes - Simplified board configurations: - All boards now have a `Configuration.cpp` - All board config's headers are removed - Removed `Boards.h` - Fix for untar-ing large files - Increase main task stack size to avoid stackoverflow when downloading apps in App Hub - Reduce SPI frequency for ST7789 displays (according to spec)
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
#include "Display.h"
|
|
|
|
#include <PwmBacklight.h>
|
|
#include <St7789Display.h>
|
|
|
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
St7789Display::Configuration panel_configuration = {
|
|
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
|
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
|
.gapX = 53, // Should be 52 according to https://github.com/m5stack/M5GFX/blob/master/src/M5GFX.cpp but this leaves a gap at the bottom
|
|
.gapY = 40,
|
|
.swapXY = true,
|
|
.mirrorX = true,
|
|
.mirrorY = false,
|
|
.invertColor = true,
|
|
.bufferSize = LCD_BUFFER_SIZE,
|
|
.touch = nullptr,
|
|
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
|
|
.resetPin = LCD_PIN_RESET
|
|
};
|
|
|
|
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);
|
|
}
|