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

Function createTouch

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

Create the XPT2046 touch device (hardware/esp_lcd driver)

Source from the content-addressed store, hash-verified

7
8// Create the XPT2046 touch device (hardware/esp_lcd driver)
9static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
10 auto config = std::make_unique<Xpt2046Touch::Configuration>(
11 DISPLAY_SPI_HOST, // spi device / bus (SPI2_HOST)
12 TOUCH_CS_PIN, // touch CS (IO33)
13 (uint16_t)DISPLAY_HORIZONTAL_RESOLUTION, // x max
14 (uint16_t)DISPLAY_VERTICAL_RESOLUTION, // y max
15 false, // swapXy
16 true, // mirrorX
17 true // mirrorY
18 );
19
20 return std::make_shared<Xpt2046Touch>(std::move(config));
21}
22
23std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
24 // Create the ST7789 panel configuration

Callers 1

createDisplayFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected