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

Function createDisplay

Devices/cyd-e32r32p/Source/devices/Display.cpp:23–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23std::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}

Callers 1

createDevicesFunction · 0.50

Calls 1

createTouchFunction · 0.70

Tested by

no test coverage detected