consolidate sketches

This commit is contained in:
2026-02-16 17:53:06 -08:00
parent 75c3f5706b
commit 838afaa36f
42 changed files with 5655 additions and 817 deletions

View File

@@ -0,0 +1,46 @@
#pragma once
#include <KlubhausCore.h>
#include <Arduino_GFX_Library.h>
#include <Wire.h>
#include "board_config.h"
class DisplayDriverGFX : public IDisplayDriver {
public:
void begin() override;
void setBacklight(bool on) override;
void render(const ScreenState& state) override;
TouchEvent readTouch() override;
int dashboardTouch(int x, int y) override;
HoldState updateHold(unsigned long holdMs) override;
void updateHint() override;
int width() override { return DISPLAY_WIDTH; }
int height() override { return DISPLAY_HEIGHT; }
private:
// CH422G helpers
void ch422gInit();
void ch422gWrite(uint8_t val);
uint8_t _exioBits = 0;
void exioSet(uint8_t bit, bool on);
// GT911 helpers
void gt911Init();
bool gt911Read(int& x, int& y);
// Rendering
void drawBoot();
void drawAlert(const ScreenState& st);
void drawDashboard(const ScreenState& st);
Arduino_GFX* _gfx = nullptr;
// Hold-to-silence tracking
bool _holdActive = false;
uint32_t _holdStartMs = 0;
bool _lastTouched = false;
// Render-change tracking
ScreenID _lastScreen = ScreenID::BOOT;
bool _needsRedraw = true;
};