Loading include/driver/ssd1306.h +3 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ class SSD1306 { SSD1306_SET_DISP_CLK_DIV, 0x80, SSD1306_SET_PRECHARGE, 0xf1, SSD1306_SET_VCOM_DESEL, 0x30, SSD1306_SET_CONTRAST, 0xff, SSD1306_SET_CONTRAST, 0x7f, SSD1306_SET_ENTIRE_ON, SSD1306_SET_NORM_INV, SSD1306_SET_CHARGE_PUMP, 0x14, Loading @@ -70,6 +70,8 @@ class SSD1306 { SSD1306() {} void init(); void setContrast(unsigned char contrast); void setInvert(bool invert); void showImage(unsigned char* data, uint16_t length); }; Loading src/driver/ssd1306.cc +11 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,17 @@ void SSD1306::init() } } void SSD1306::setContrast(unsigned char contrast) { writeCommand(SSD1306_SET_CONTRAST); writeCommand(contrast); } void SSD1306::setInvert(bool invert) { writeCommand(SSD1306_SET_NORM_INV | invert); } void SSD1306::showImage(unsigned char* data, uint16_t length) { uint8_t i; Loading Loading
include/driver/ssd1306.h +3 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ class SSD1306 { SSD1306_SET_DISP_CLK_DIV, 0x80, SSD1306_SET_PRECHARGE, 0xf1, SSD1306_SET_VCOM_DESEL, 0x30, SSD1306_SET_CONTRAST, 0xff, SSD1306_SET_CONTRAST, 0x7f, SSD1306_SET_ENTIRE_ON, SSD1306_SET_NORM_INV, SSD1306_SET_CHARGE_PUMP, 0x14, Loading @@ -70,6 +70,8 @@ class SSD1306 { SSD1306() {} void init(); void setContrast(unsigned char contrast); void setInvert(bool invert); void showImage(unsigned char* data, uint16_t length); }; Loading
src/driver/ssd1306.cc +11 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,17 @@ void SSD1306::init() } } void SSD1306::setContrast(unsigned char contrast) { writeCommand(SSD1306_SET_CONTRAST); writeCommand(contrast); } void SSD1306::setInvert(bool invert) { writeCommand(SSD1306_SET_NORM_INV | invert); } void SSD1306::showImage(unsigned char* data, uint16_t length) { uint8_t i; Loading