#include "Display.h" #include #include #include static std::shared_ptr createTouch() { auto configuration = std::make_unique( I2C_NUM_0, 240, // xMax (native portrait width) 320, // yMax (native portrait height) true, // swapXy true, // mirrorX false, // mirrorY GPIO_NUM_18, // Touch Reset (RST) GPIO_NUM_17 // Touch Interrupt (INT) ); return std::make_shared(std::move(configuration)); } std::shared_ptr createDisplay() { Ili934xDisplay::Configuration panel_configuration = { .horizontalResolution = LCD_HORIZONTAL_RESOLUTION, .verticalResolution = LCD_VERTICAL_RESOLUTION, .gapX = 0, .gapY = 0, .swapXY = true, .mirrorX = false, .mirrorY = false, .invertColor = false, .swapBytes = true, .bufferSize = LCD_BUFFER_SIZE, .touch = createTouch(), .backlightDutyFunction = driver::pwmbacklight::setBacklightDuty, .resetPin = GPIO_NUM_NC, .rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR }; auto spi_configuration = std::make_shared(Ili934xDisplay::SpiConfiguration { .spiHostDevice = LCD_SPI_HOST, .csPin = LCD_PIN_CS, .dcPin = LCD_PIN_DC, .pixelClockFrequency = 40'000'000, .transactionQueueDepth = 10 }); return std::make_shared(panel_configuration, spi_configuration, true); }