24 lines
795 B
C++
24 lines
795 B
C++
#include "Display.h"
|
|
#include <St7305Display.h>
|
|
|
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
auto configuration = std::make_unique<St7305Display::Configuration>(
|
|
SPI2_HOST,
|
|
GPIO_NUM_40, // CS
|
|
GPIO_NUM_5, // DC
|
|
400, // Width
|
|
300, // Height
|
|
nullptr, // Touch device
|
|
false, // swapXY
|
|
false, // mirrorX
|
|
false, // mirrorY
|
|
false, // invertColor
|
|
0 // bufferSize (0 = default, which is full screen = 120,000 pixels)
|
|
);
|
|
|
|
configuration->resetPin = GPIO_NUM_41;
|
|
|
|
auto display = std::make_shared<St7305Display>(std::move(configuration));
|
|
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
|
|
}
|