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

Function createDisplay

Devices/cyd-e32r28t/Source/devices/Display.cpp:24–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
25 Ili934xDisplay::Configuration panel_configuration = {
26 .horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
27 .verticalResolution = LCD_VERTICAL_RESOLUTION,
28 .gapX = 0,
29 .gapY = 0,
30 .swapXY = false,
31 .mirrorX = true,
32 .mirrorY = false,
33 .invertColor = false,
34 .swapBytes = true,
35 .bufferSize = LCD_BUFFER_SIZE,
36 .touch = createTouch(),
37 .backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
38 .resetPin = GPIO_NUM_NC,
39 .rgbElementOrder = LCD_RGB_ELEMENT_ORDER_BGR
40 };
41
42 auto spi_configuration = std::make_shared<Ili934xDisplay::SpiConfiguration>(Ili934xDisplay::SpiConfiguration {
43 .spiHostDevice = LCD_SPI_HOST,
44 .csPin = LCD_PIN_CS,
45 .dcPin = LCD_PIN_DC,
46 .pixelClockFrequency = 40'000'000,
47 .transactionQueueDepth = 10
48 });
49
50 return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
51}

Callers 1

createDevicesFunction · 0.50

Calls 1

createTouchFunction · 0.70

Tested by

no test coverage detected