-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Waveshare 1.54" ePaper
BREAKING CHANGE: The display type id for the Waveshare 1.54" ePaper changed from 5 to 6. Co-authored-by: dAjaY85 <[email protected]>
- Loading branch information
1 parent
21ec72f
commit 64b7640
Showing
20 changed files
with
2,057 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include "defaults.h" | ||
#include <Arduino.h> | ||
#include <TaskSchedulerDeclarations.h> | ||
|
||
enum DisplayType_t { | ||
None, | ||
PCD8544, | ||
SSD1306, | ||
SH1106, | ||
SSD1309, | ||
ST7567_GM12864I_59N, | ||
ePaper154, | ||
DisplayType_Max, | ||
}; | ||
|
||
enum DiagramMode_t { | ||
Off, | ||
Small, | ||
Fullscreen, | ||
DisplayMode_Max, | ||
}; | ||
|
||
class DisplayClass { | ||
public: | ||
void init(Scheduler& scheduler, DisplayType_t _type, uint8_t _data, uint8_t _clk, uint8_t _cs, uint8_t _reset, uint8_t _busy, uint8_t _dc); | ||
|
||
void setContrast(uint8_t contrast); | ||
void setStatus(bool turnOn); | ||
void setOrientation(uint8_t rotation = DISPLAY_ROTATION); | ||
void setLanguage(uint8_t language); | ||
void setUpdatePeriod(uint16_t updatePeriod); | ||
void setEnablePowerSafe(bool display_PowerSafe); | ||
void setEnableScreensaver(bool display_ScreenSaver); | ||
void setDiagramMode(DiagramMode_t mode); | ||
void setStartupDisplay(); | ||
void DiagramUpdatePeriod(); | ||
|
||
private: | ||
bool _displayTurnedOn; | ||
|
||
DisplayType_t _display_type = DisplayType_t::None; | ||
uint32_t _lastDisplayUpdate = 0; | ||
uint16_t _counterEPaper; | ||
uint16_t _settedUpdatePeriod = 10000; // Achtung, max 65535 | ||
}; | ||
|
||
extern DisplayClass Display; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
/// uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX, to use less code and ram | ||
// #include <GFX.h> | ||
// base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code | ||
// enable GxEPD2_GFX base class | ||
#define ENABLE_GxEPD2_GFX 1 | ||
|
||
#include "Display.h" | ||
#include <GxEPD2_3C.h> | ||
#include <GxEPD2_BW.h> | ||
#include <SPI.h> | ||
#include <map> | ||
|
||
// FreeFonts from Adafruit_GFX | ||
#include <Fonts/FreeSans12pt7b.h> | ||
#include <Fonts/FreeSans18pt7b.h> | ||
#include <Fonts/FreeSans24pt7b.h> | ||
#include <Fonts/FreeSans9pt7b.h> | ||
|
||
#include "defaults.h" | ||
#include "imagedata.h" | ||
|
||
// GDEW027C44 2.7 " b/w/r 176x264, IL91874 | ||
// GDEH0154D67 1.54" b/w 200x200 | ||
|
||
class DisplayEPaperClass { | ||
public: | ||
DisplayEPaperClass(); | ||
~DisplayEPaperClass(); | ||
|
||
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); | ||
void loop(); | ||
void fullRefresh(); | ||
void setOrientation(uint8_t rotation); | ||
void setLanguage(uint8_t language); | ||
|
||
private: | ||
void headlineIP(); | ||
void actualPowerPaged(float _totalPower, float _totalYieldDay, float _totalYieldTotal, uint8_t _isprod); | ||
void lastUpdatePaged(); | ||
|
||
Task _loopTask; | ||
|
||
const uint16_t _period = 10000; | ||
uint16_t _counterEPaper; | ||
|
||
bool _changed = false; | ||
char _fmtText[35]; | ||
String _settedIP; | ||
uint8_t _headfootline = 16; | ||
uint8_t _displayRotation = DISPLAY_ROTATION; | ||
uint8_t _display_language = DISPLAY_LANGUAGE; | ||
GxEPD2_GFX* _display; | ||
}; | ||
|
||
extern DisplayEPaperClass DisplayEPaper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
extern const unsigned char AhoyLogo[]; | ||
extern const unsigned char OpenDTULogo[]; | ||
extern const unsigned char myHoy[]; | ||
extern const unsigned char mySigma[]; | ||
extern const unsigned char mySun[]; | ||
extern const unsigned char myToday[]; | ||
extern const unsigned char myWR[]; | ||
|
||
extern const unsigned char gImage_1in54[]; |
Oops, something went wrong.