#include "Display.h" #include #include std::shared_ptr createDisplay() { auto configuration = std::make_unique( LCD_SPI_HOST, LCD_PIN_CS, LCD_PIN_DC, LCD_HORIZONTAL_RESOLUTION, LCD_VERTICAL_RESOLUTION, nullptr, true, true, false, true, 0, 53, // Should be 52 according to https://github.com/m5stack/M5GFX/blob/master/src/M5GFX.cpp but this leaves a gap at the bottom 40 ); configuration->resetPin = LCD_PIN_RESET; configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty; auto display = std::make_shared(std::move(configuration)); return std::reinterpret_pointer_cast(display); }