MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / createDisplay

Function createDisplay

Devices/lilygo-tdeck/Source/devices/Display.cpp:26–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
27 St7789Display::Configuration panel_configuration = {
28 .horizontalResolution = 320,
29 .verticalResolution = 240,
30 .gapX = 0,
31 .gapY = 0,
32 .swapXY = true,
33 .mirrorX = true,
34 .mirrorY = false,
35 .invertColor = true,
36 .bufferSize = LCD_BUFFER_SIZE,
37 .touch = createTouch(),
38 .backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
39 .resetPin = GPIO_NUM_NC,
40 .lvglSwapBytes = false,
41 .buffSpiram = false // Enabling leads to crashes when refreshing App Hub list
42 };
43
44 auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
45 .spiHostDevice = LCD_SPI_HOST,
46 .csPin = LCD_PIN_CS,
47 .dcPin = LCD_PIN_DC,
48 .pixelClockFrequency = 62'500'000,
49 .transactionQueueDepth = 10
50 });
51
52 return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
53}

Callers 1

createDevicesFunction · 0.50

Calls 1

createTouchFunction · 0.70

Tested by

no test coverage detected