-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SW-SPI over Patch Method. #1291
Open
dAjaY85
wants to merge
2
commits into
tbnobody:master
Choose a base branch
from
dAjaY85:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include "Display_helper.h" | ||
#include "defaults.h" | ||
#include <Arduino.h> | ||
|
||
class DisplayClass { | ||
public: | ||
void init(DisplayType_t _type, uint8_t _data, uint8_t _clk, uint8_t _cs, uint8_t _reset, uint8_t _busy, uint8_t _dc); | ||
void loop(); | ||
|
||
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); | ||
|
||
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 was deleted.
Oops, something went wrong.
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,48 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include "Display_helper.h" | ||
#include "defaults.h" | ||
#include <U8g2lib.h> | ||
|
||
class DisplayMonoClass { | ||
public: | ||
DisplayMonoClass(); | ||
~DisplayMonoClass(); | ||
|
||
void init(DisplayType_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI); | ||
void loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod); | ||
|
||
void setContrast(uint8_t contrast); | ||
void setOrientation(uint8_t rotation); | ||
void setLanguage(uint8_t language); | ||
void setStartupDisplay(); | ||
|
||
bool enablePowerSafe = true; | ||
bool enableScreensaver = true; | ||
|
||
private: | ||
void calcLineHeights(); | ||
void setFont(uint8_t line); | ||
void printText(const char* text, uint8_t line, uint8_t dispX); | ||
|
||
U8G2* _display; | ||
|
||
bool _mIsLarge = false; | ||
uint8_t mLoopCnt; | ||
uint32_t* mUtcTs; | ||
uint8_t mLineOffsets[5]; | ||
|
||
uint16_t _dispY = 0; | ||
uint32_t _previousMillis = 0; | ||
uint8_t _display_language = DISPLAY_LANGUAGE; | ||
|
||
uint8_t _mExtra; | ||
uint16_t _mTimeout; // interval at which to power save (milliseconds) | ||
char _fmtText[32]; | ||
|
||
const u8g2_cb_t* disp_rotation = U8G2_R2; | ||
uint8_t contrast = 60; | ||
}; | ||
|
||
extern DisplayMonoClass DisplayMono; |
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,53 @@ | ||
// 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 <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 "Display_helper.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(DisplayType_t type, uint8_t _CS, uint8_t _DC, uint8_t _RST, uint8_t _BUSY, uint8_t _SCK, uint8_t _MOSI); | ||
void loop(float totalPower, float totalYieldDay, float totalYieldTotal, uint8_t isprod); | ||
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(); | ||
|
||
bool _changed = false; | ||
char _fmtText[35]; | ||
const char* _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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
enum DisplayType_t | ||
{ | ||
None, | ||
PCD8544, | ||
SSD1306, | ||
SH1106, | ||
SSD1309, | ||
dummy5, | ||
dummy6, | ||
dummy7, | ||
dummy8, | ||
dummy9, | ||
ePaper154 | ||
}; |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot tell whether or not memory is limited. If memory is limited the different display classes could go into a union and get initialized with a placement new.