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

Function createDisplay

Devices/lilygo-thmi/Source/devices/Display.cpp:23–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
24 // Create configuration
25 auto config = St7789i8080Display::Configuration(
26 DISPLAY_CS, // CS
27 DISPLAY_DC, // DC
28 DISPLAY_WR, // WR
29 DISPLAY_RD, // RD
30 { DISPLAY_I80_D0, DISPLAY_I80_D1, DISPLAY_I80_D2, DISPLAY_I80_D3,
31 DISPLAY_I80_D4, DISPLAY_I80_D5, DISPLAY_I80_D6, DISPLAY_I80_D7 }, // D0..D7
32 DISPLAY_RST, // RST
33 DISPLAY_BL // BL
34 );
35
36 // Set resolution explicitly
37 config.horizontalResolution = DISPLAY_HORIZONTAL_RESOLUTION;
38 config.verticalResolution = DISPLAY_VERTICAL_RESOLUTION;
39 config.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
40 config.touch = createTouch();
41 config.invertColor = false;
42
43 auto display = std::make_shared<St7789i8080Display>(config);
44 return display;
45}

Callers 1

createDevicesFunction · 0.50

Calls 2

createTouchFunction · 0.70
ConfigurationClass · 0.50

Tested by

no test coverage detected