- Updated all boards to use `hal::Configuration.createDevices` - Updated all boards to use new directory structure and file naming convention - Refactored `Xpt2046SoftSpi` driver. - Created `Axp2101Power` device in `Drivers/AXP2101` - Removed global static instances from some drivers (instances that kept a reference to the Device*) - Improved `SystemInfoApp` UI: better memory labels, hide external memory bar when there's no PSRAM - Fix for HAL: register touch devices after displays are registered - Fix for Boot splash hanging on WiFi init: unlock file lock after using it
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#include "Display.h"
|
|
|
|
#include <Gt911Touch.h>
|
|
#include <PwmBacklight.h>
|
|
#include <Ili9488Display.h>
|
|
|
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
|
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
I2C_NUM_0,
|
|
320,
|
|
480
|
|
);
|
|
|
|
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
}
|
|
|
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
auto touch = createTouch();
|
|
|
|
auto configuration = std::make_unique<Ili9488Display::Configuration>(
|
|
CROWPANEL_LCD_SPI_HOST,
|
|
CROWPANEL_LCD_PIN_CS,
|
|
CROWPANEL_LCD_PIN_DC,
|
|
CROWPANEL_LCD_HORIZONTAL_RESOLUTION,
|
|
CROWPANEL_LCD_VERTICAL_RESOLUTION,
|
|
touch,
|
|
false,
|
|
false,
|
|
false,
|
|
true
|
|
);
|
|
|
|
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
|
|
auto display = std::make_shared<Ili9488Display>(std::move(configuration));
|
|
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
|
|
}
|