* 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:
Scott Powell 2025-03-04 23:09:43 +11:00
parent 68770d7728
commit 372c228210
8 changed files with 291 additions and 3 deletions

View 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;
};