merged old Esp Verison with better FileManagement
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#ifndef DISPLAYMANAGER_H
|
||||
#define DISPLAYMANAGER_H
|
||||
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_ST7789.h>
|
||||
|
||||
enum DisplayState {
|
||||
STATE_FACE,
|
||||
STATE_MENU
|
||||
};
|
||||
|
||||
class DisplayManager {
|
||||
public:
|
||||
DisplayManager(int8_t cs, int8_t dc, int8_t rst);
|
||||
|
||||
void begin();
|
||||
void update();
|
||||
|
||||
void drawCenteredText(const char* text, uint16_t color);
|
||||
void setState(DisplayState state);
|
||||
void toggleState(); // Switches between Face and Menu
|
||||
|
||||
// Lopaka-generated screen renderers
|
||||
void drawFaceScreen();
|
||||
void drawMenuScreen();
|
||||
void clear();
|
||||
|
||||
private:
|
||||
Adafruit_ST7789 _tft;
|
||||
DisplayState _currentState = STATE_FACE;
|
||||
unsigned long _lastScreenUpdate = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user