Create the XPT2046 touch device (hardware/esp_lcd driver)
| 7 | |
| 8 | // Create the XPT2046 touch device (hardware/esp_lcd driver) |
| 9 | static 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 | |
| 23 | std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() { |
| 24 | // Create the ST7789 panel configuration |