added ePaper (for ESP32 only!), thx @dAjaY85 #735

improved `/live` margins #732
renamed `var` to `VAr` #732
This commit is contained in:
lumapu 2023-03-06 22:53:38 +01:00
parent 501daf04bc
commit 6dbb88e27e
19 changed files with 2685 additions and 3009 deletions

View file

@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#if defined(ESP32)
// uncomment next line to use HSPI for EPD (and VSPI for SD), e.g. with Waveshare ESP32 Driver Board
#define USE_HSPI_FOR_EPD
@ -21,31 +23,29 @@
#include <Fonts/FreeSans24pt7b.h>
#include <Fonts/FreeSans9pt7b.h>
#include "imagedata.h"
// GDEW027C44 2.7 " b/w/r 176x264, IL91874
// GDEH0154D67 1.54" b/w 200x200
class DisplayEPaperClass {
class DisplayEPaper {
public:
DisplayEPaperClass();
~DisplayEPaperClass();
void fullRefresh();
void init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI, const char* version);
void loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod);
DisplayEPaper();
void fullRefresh();
void init(uint8_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI, const char* version);
void config(uint8_t rotation);
void loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod);
uint8_t displayRotation = 2;
private:
void headlineIP();
void actualPowerPaged(float _totalPower, float _totalYieldDay, float _totalYieldTotal, uint8_t _isprod);
void lastUpdatePaged();
void headlineIP();
void actualPowerPaged(float _totalPower, float _totalYieldDay, float _totalYieldTotal, uint8_t _isprod);
void lastUpdatePaged();
bool _changed = false;
char _fmtText[35];
const char* _settedIP;
uint8_t headfootline = 16;
GxEPD2_GFX* _display;
uint8_t mDisplayRotation;
bool _changed = false;
char _fmtText[35];
const char* _settedIP;
uint8_t mHeadFootPadding;
GxEPD2_GFX* _display;
};
extern DisplayEPaperClass DisplayEPaper;
#endif // ESP32