#include "Core2Display.h" #include #include std::shared_ptr createTouch() { auto configuration = std::make_unique( I2C_NUM_0, GPIO_NUM_39, CORE2_LCD_HORIZONTAL_RESOLUTION, CORE2_LCD_VERTICAL_RESOLUTION ); auto touch = std::make_shared(std::move(configuration)); return std::reinterpret_pointer_cast(touch); } std::shared_ptr createDisplay() { auto touch = createTouch(); auto configuration = std::make_unique( CORE2_LCD_SPI_HOST, CORE2_LCD_PIN_CS, CORE2_LCD_PIN_DC, CORE2_LCD_HORIZONTAL_RESOLUTION, CORE2_LCD_VERTICAL_RESOLUTION, touch, false, false, false, true ); auto display = std::make_shared(std::move(configuration)); return std::reinterpret_pointer_cast(display); }