# HG changeset patch # User David Douard # Date 1604265010 -3600 # Node ID 069bbd5ee3e4632215132128409f978875d984ce # Parent 63c6a720cb97a7184ba96ab91f543d4edddc3e45 SSD1322: add power off/on methods diff -r 63c6a720cb97 -r 069bbd5ee3e4 lib/unigraphic/SSD1322.cpp --- 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); +} diff -r 63c6a720cb97 -r 069bbd5ee3e4 lib/unigraphic/SSD1322.h --- 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/////////////////////////////////////////////////// /////// ----------------------------------------------------///////////////////////////////////////////////////