mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- 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
41 lines
995 B
C++
41 lines
995 B
C++
#include "Display.h"
|
|
|
|
#include <Gt911Touch.h>
|
|
#include <Ili934xDisplay.h>
|
|
#include <PwmBacklight.h>
|
|
|
|
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
I2C_NUM_0,
|
|
240,
|
|
320
|
|
);
|
|
|
|
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
}
|
|
|
|
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
|
|
auto touch = createTouch();
|
|
|
|
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
|
|
SPI2_HOST,
|
|
GPIO_NUM_15,
|
|
GPIO_NUM_2,
|
|
240,
|
|
320,
|
|
touch,
|
|
true,
|
|
true,
|
|
true,
|
|
true,
|
|
0,
|
|
LCD_RGB_ELEMENT_ORDER_RGB
|
|
);
|
|
|
|
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
|
|
auto display = std::make_shared<Ili934xDisplay>(std::move(configuration));
|
|
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
|
|
}
|