Added the sleep and wakeUp methods for the ssd1306 oled driver

This commit is contained in:
Anatole SCHRAMM 2019-05-02 17:21:41 +02:00
parent cfa7192f5f
commit e013103fd1
2 changed files with 17 additions and 0 deletions

View File

@ -1075,6 +1075,21 @@ void Adafruit_SSD1306::invertDisplay(boolean i) {
TRANSACTION_END
}
void Adafruit_SSD1306::sleep()
{
TRANSACTION_START
ssd1306_command1(SSD1306_DISPLAYOFF);
TRANSACTION_END
}
void Adafruit_SSD1306::wakeUp()
{
TRANSACTION_START
ssd1306_command1(SSD1306_DISPLAYON);
TRANSACTION_END
}
/*!
@brief Dim the display.
@param dim

View File

@ -136,6 +136,8 @@ class Adafruit_SSD1306 : public Adafruit_GFX {
void display(void);
void clearDisplay(void);
void invertDisplay(boolean i);
void sleep();
void wakeUp();
void dim(boolean dim);
void drawPixel(int16_t x, int16_t y, uint16_t color);
virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);