1+ // SPDX-License-Identifier: GPL-2.0-or-later
2+ #pragma once
3+
4+ // / uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX, to use less code and ram
5+ // #include <GFX.h>
6+ // base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code
7+ // enable GxEPD2_GFX base class
8+ #define ENABLE_GxEPD2_GFX 1
9+
10+ #include " Display.h"
11+ #include < GxEPD2_3C.h>
12+ #include < GxEPD2_BW.h>
13+ #include < SPI.h>
14+ #include < map>
15+
16+ // FreeFonts from Adafruit_GFX
17+ #include < Fonts/FreeSans12pt7b.h>
18+ #include < Fonts/FreeSans18pt7b.h>
19+ #include < Fonts/FreeSans24pt7b.h>
20+ #include < Fonts/FreeSans9pt7b.h>
21+
22+ #include " defaults.h"
23+ #include " imagedata.h"
24+
25+ // GDEW027C44 2.7 " b/w/r 176x264, IL91874
26+ // GDEH0154D67 1.54" b/w 200x200
27+
28+ class DisplayEPaperClass {
29+ public:
30+ DisplayEPaperClass ();
31+ ~DisplayEPaperClass ();
32+
33+ void init (Scheduler& scheduler, DisplayType_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI);
34+ void loop ();
35+ void fullRefresh ();
36+ void setOrientation (uint8_t rotation);
37+ void setLanguage (uint8_t language);
38+
39+ private:
40+ void headlineIP ();
41+ void actualPowerPaged (float _totalPower, float _totalYieldDay, float _totalYieldTotal, uint8_t _isprod);
42+ void lastUpdatePaged ();
43+
44+ Task _loopTask;
45+
46+ const uint16_t _period = 10000 ;
47+ uint16_t _counterEPaper;
48+
49+ bool _changed = false ;
50+ char _fmtText[35 ];
51+ String _settedIP;
52+ uint8_t _headfootline = 16 ;
53+ uint8_t _displayRotation = DISPLAY_ROTATION;
54+ uint8_t _display_language = DISPLAY_LANGUAGE;
55+ GxEPD2_GFX* _display;
56+ };
57+
58+ extern DisplayEPaperClass DisplayEPaper;
0 commit comments