mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
sensecap_indicator: initial espnow support
This commit is contained in:
parent
5ae574b426
commit
45ab0e8cf7
6 changed files with 433 additions and 0 deletions
44
src/helpers/ui/LGFXDisplay.h
Normal file
44
src/helpers/ui/LGFXDisplay.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
|
||||
/*
|
||||
* Base class for LovyanGFX supported display (works on ESP32 mainly)
|
||||
* You can extend this class to support your display, providing your own LGFX
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ui/DisplayDriver.h>
|
||||
|
||||
#define LGFX_USE_V1
|
||||
#include <LovyanGFX.hpp>
|
||||
|
||||
#ifndef UI_ZOOM
|
||||
#define UI_ZOOM 1
|
||||
#endif
|
||||
|
||||
class LGFXDisplay : public DisplayDriver {
|
||||
protected:
|
||||
LGFX_Device* display;
|
||||
LGFX_Sprite buffer;
|
||||
|
||||
bool _isOn;
|
||||
int _color = TFT_WHITE;
|
||||
|
||||
public:
|
||||
LGFXDisplay(int w, int h):DisplayDriver(w/UI_ZOOM, h/UI_ZOOM) {_isOn = false;}
|
||||
bool begin();
|
||||
bool isOn() override { return _isOn; }
|
||||
void turnOn() override;
|
||||
void turnOff() override;
|
||||
void clear() override;
|
||||
void startFrame(Color bkg = DARK) override;
|
||||
void setTextSize(int sz) override;
|
||||
void setColor(Color c) override;
|
||||
void setCursor(int x, int y) override;
|
||||
void print(const char* str) override;
|
||||
void fillRect(int x, int y, int w, int h) override;
|
||||
void drawRect(int x, int y, int w, int h) override;
|
||||
void drawXbm(int x, int y, const uint8_t* bits, int w, int h) override;
|
||||
uint16_t getTextWidth(const char* str) override;
|
||||
void endFrame() override;
|
||||
virtual bool getTouch(int *x, int *y);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue