* new ui/DisplayDriver classes (just SSD1306Display impl for now)
* companion radio: now with optional UITask (enabled by DISPLAY_CLASS config in target/env)
This commit is contained in:
27
src/helpers/ui/DisplayDriver.h
Normal file
27
src/helpers/ui/DisplayDriver.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
class DisplayDriver {
|
||||
int _w, _h;
|
||||
protected:
|
||||
DisplayDriver(int w, int h) { _w = w; _h = h; }
|
||||
public:
|
||||
enum Color { DARK, LIGHT };
|
||||
|
||||
int width() const { return _w; }
|
||||
int height() const { return _h; }
|
||||
|
||||
virtual bool isOn() = 0;
|
||||
virtual void turnOn() = 0;
|
||||
virtual void turnOff() = 0;
|
||||
virtual void startFrame(Color bkg = DARK) = 0;
|
||||
virtual void setTextSize(int sz) = 0;
|
||||
virtual void setColor(Color c) = 0;
|
||||
virtual void setCursor(int x, int y) = 0;
|
||||
virtual void print(const char* str) = 0;
|
||||
virtual void fillRect(int x, int y, int w, int h) = 0;
|
||||
virtual void drawRect(int x, int y, int w, int h) = 0;
|
||||
virtual void drawXbm(int x, int y, const uint8_t* bits, int w, int h) = 0;
|
||||
virtual void endFrame() = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user