| 21 | } |
| 22 | |
| 23 | std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() { |
| 24 | // Create the ST7789 panel configuration |
| 25 | St7789Display::Configuration panel_configuration = { |
| 26 | .horizontalResolution = DISPLAY_HORIZONTAL_RESOLUTION, |
| 27 | .verticalResolution = DISPLAY_VERTICAL_RESOLUTION, |
| 28 | .gapX = 0, |
| 29 | .gapY = 0, |
| 30 | .swapXY = false, |
| 31 | .mirrorX = false, |
| 32 | .mirrorY = false, |
| 33 | .invertColor = false, |
| 34 | .bufferSize = DISPLAY_DRAW_BUFFER_SIZE, // 0 -> default 1/10 screen |
| 35 | .touch = createTouch(), |
| 36 | .backlightDutyFunction = driver::pwmbacklight::setBacklightDuty, |
| 37 | .resetPin = GPIO_NUM_NC, |
| 38 | .lvglSwapBytes = false, |
| 39 | .rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR // BGR for this display |
| 40 | }; |
| 41 | |
| 42 | // Create the SPI configuration (from EspLcdSpiDisplay base class) |
| 43 | auto spi_configuration = std::make_shared<EspLcdSpiDisplay::SpiConfiguration>(EspLcdSpiDisplay::SpiConfiguration { |
| 44 | .spiHostDevice = DISPLAY_SPI_HOST, |
| 45 | .csPin = DISPLAY_PIN_CS, |
| 46 | .dcPin = DISPLAY_PIN_DC, |
| 47 | .pixelClockFrequency = 40'000'000, |
| 48 | .transactionQueueDepth = 10 |
| 49 | }); |
| 50 | |
| 51 | return std::make_shared<St7789Display>(panel_configuration, spi_configuration); |
| 52 | } |
no test coverage detected