mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-05-11 06:26:55 +00:00
42 lines
1.0 KiB
C++
42 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "DisplayDriver.h"
|
|
|
|
#include <SPI.h>
|
|
#include <Wire.h>
|
|
#include <heltec-eink-modules.h>
|
|
|
|
// Display driver for E213 e-ink display
|
|
class E213Display : public DisplayDriver {
|
|
BaseDisplay* display=NULL;
|
|
bool _init = false;
|
|
bool _isOn = false;
|
|
|
|
public:
|
|
E213Display() : DisplayDriver(250, 122) {}
|
|
~E213Display(){
|
|
if(display!=NULL) {
|
|
delete display;
|
|
}
|
|
}
|
|
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;
|
|
|
|
private:
|
|
BaseDisplay* detectEInk();
|
|
void powerOn();
|
|
void powerOff();
|
|
}; |