30 lines
786 B
C++
30 lines
786 B
C++
#pragma once
|
|
|
|
#include <IDisplayDriver.h>
|
|
#include <Arduino_GFX_Library.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;
|
|
int height() override;
|
|
|
|
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;
|
|
};
|
|
|