Sun, 01 Nov 2020 22:10:10 +0100
SSD1322: add power off/on methods
lib/unigraphic/SSD1322.cpp | file | annotate | diff | comparison | revisions | |
lib/unigraphic/SSD1322.h | file | annotate | diff | comparison | revisions |
--- a/lib/unigraphic/SSD1322.cpp Tue Oct 27 21:48:28 2020 +0100 +++ b/lib/unigraphic/SSD1322.cpp Sun Nov 01 22:10:10 2020 +0100 @@ -428,12 +428,22 @@ // reset and init the lcd controller void SSD1322::init() { - /* Start Initial Sequence ----------------------------------------------------*/ - for (uint16_t ind=0; ind < sizeof(oledInit); ) { + /* Start Initial Sequence ----------------------------------------------------*/ + for (uint16_t ind=0; ind < sizeof(oledInit); ) { wr_cmd8(oledInit[ind++]); uint8_t dataSize = oledInit[ind++]; while (dataSize--) { wr_data8(oledInit[ind++]); } - } - } + } +} + +void SSD1322::power_off() +{ + wr_cmd8(SSD1322_CMD_SET_DISPLAY_OFF); +} + +void SSD1322::power_on() +{ + wr_cmd8(SSD1322_CMD_SET_DISPLAY_ON); +}
--- a/lib/unigraphic/SSD1322.h Tue Oct 27 21:48:28 2020 +0100 +++ b/lib/unigraphic/SSD1322.h Sun Nov 01 22:10:10 2020 +0100 @@ -44,7 +44,8 @@ */ virtual ~SSD1322() {}; - + void power_off(); + void power_on(); /////// functions that come for free, but can be overwritten/////////////////////////////////////////////////// /////// ----------------------------------------------------///////////////////////////////////////////////////