Created Drivers folder with ILI934x subproject (#209)

Refactored all existing boards to re-use the ILI934x driver code.
This commit is contained in:
Ken Van Hoeylandt
2025-02-08 18:54:09 +01:00
committed by GitHub
parent 8ccba15c25
commit c74006f8b6
27 changed files with 355 additions and 610 deletions
+4 -7
View File
@@ -22,13 +22,14 @@ static uint8_t gamma = 255;
#define ROTATION_270 2
#define ROTATION_90 3
static std::shared_ptr<tt::hal::Display> getHalDisplay() {
return hal::findFirstDevice<hal::Display>(hal::Device::Type::Display);
}
static void onBacklightSliderEvent(lv_event_t* event) {
auto* slider = static_cast<lv_obj_t*>(lv_event_get_target(event));
auto* lvgl_display = lv_display_get_default();
assert(lvgl_display != nullptr);
auto* hal_display = (tt::hal::Display*)lv_display_get_user_data(lvgl_display);
auto hal_display = getHalDisplay();
assert(hal_display != nullptr);
if (hal_display->supportsBacklightDuty()) {
@@ -57,10 +58,6 @@ static void onGammaSliderEvent(lv_event_t* event) {
}
}
static std::shared_ptr<tt::hal::Display> getHalDisplay() {
return hal::findFirstDevice<hal::Display>(hal::Device::Type::Display);
}
static lv_display_rotation_t orientationSettingToDisplayRotation(uint32_t setting) {
if (setting == ROTATION_180) {
return LV_DISPLAY_ROTATION_180;