chore(examples): add submodule and remove LVGL examples

This commit is contained in:
2026-02-16 23:09:37 -08:00
parent 257bc9aa82
commit 9f0e603215
8 changed files with 435 additions and 282 deletions

View File

@@ -1,29 +1,42 @@
#pragma once
#include <IDisplayDriver.h>
#include <Arduino_GFX_Library.h>
#include <Arduino.h>
#include "ScreenState.h"
#include "IDisplayDriver.h"
struct TouchEvent {
bool pressed = false;
int x = 0;
int y = 0;
};
struct HoldState {
bool active = false;
bool completed = false;
float progress = 0.0f; // 0.0 1.0
};
class DisplayDriverGFX : public IDisplayDriver {
public:
// ── IDisplayDriver ──
void begin() override;
void setBacklight(bool on) override;
void render(const ScreenState& state) override;
TouchEvent readTouch() override;
int dashboardTouch(int x, int y) override;
int dashboardTouch(int x, int y) override;
HoldState updateHold(unsigned long holdMs) override;
void updateHint() override;
int width() override;
int height() override;
int width() override;
int height() override;
// ── Internal ──
static DisplayDriverGFX& instance();
private:
void expanderInit();
void touchInit();
void drawBoot();
void drawDashboard(const ScreenState& state);
void drawAlert(const ScreenState& state);
void drawOff();
Arduino_RGB_Display* _gfx = nullptr;
bool _lastTouched = false;
unsigned long _holdStart = 0;
// Touch handling
TouchEvent _lastTouch = {false, 0, 0};
unsigned long _pressStartMs = 0;
bool _isHolding = false;
};