Ken Van Hoeylandt 9f721e6655
Refactor LVGL code into kernel module (#472)
* **New Features**
  * Added a standalone LVGL module and enabled LVGL support in the simulator for richer local UI testing.

* **Refactor**
  * HAL and LVGL split into distinct modules; startup and device attach/detach flows reorganized for clearer lifecycle management.
  * Public APIs tightened with clearer nullability/documentation.

* **Bug Fixes**
  * More consistent LVGL start/stop and device attach/detach behavior for improved stability.
2026-02-01 22:57:45 +01:00

46 lines
1.1 KiB
C++

#include "Display.h"
#include <Cst816Touch.h>
#include <PwmBacklight.h>
#include <Gc9a01Display.h>
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
auto configuration = std::make_unique<Cst816sTouch::Configuration>(
I2C_NUM_0,
240,
240,
false,
true,
true,
GPIO_NUM_13,
GPIO_NUM_5
);
return std::make_shared<Cst816sTouch>(std::move(configuration));
}
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
auto touch = createTouch();
auto configuration = std::make_unique<Gc9a01Display::Configuration>(
SPI2_HOST,
GPIO_NUM_9,
GPIO_NUM_8,
240,
240,
touch,
false,
false,
true,
true,
0,
LCD_RGB_ELEMENT_ORDER_BGR
);
configuration->resetPin = GPIO_NUM_14;
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
auto display = std::make_shared<Gc9a01Display>(std::move(configuration));
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
}