summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-04-16 20:25:24 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-04-16 20:25:24 +0200
commitaa728fb0daeba1c4c15b2514acbbd0fadb8f9cda (patch)
treee91d784642da8b84f6742d83161df3e036d6bfcb /include/driver
parent080067b5ee69d9d9a7524b7eac249c158506e9bd (diff)
ssd1306: reset column and page pointer on initialization
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/ssd1306.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/driver/ssd1306.h b/include/driver/ssd1306.h
index e439ca6..1c2ff1a 100644
--- a/include/driver/ssd1306.h
+++ b/include/driver/ssd1306.h
@@ -96,7 +96,7 @@ class SSD1306 {
// height == 32? 0x02 : 0x12
- const unsigned char init3[13] = {
+ const unsigned char init3[19] = {
/*
* Set clock to recommended values: 370 kHz (bits 7..4),
* no divider (bits 3..0). Increase divider for glitchy effects.
@@ -133,7 +133,13 @@ class SSD1306 {
SSD1306_SET_CHARGE_PUMP, 0x14,
// turn on display
- SSD1306_SET_DISP | 0x01
+ SSD1306_SET_DISP | 0x01,
+
+ // reset column pointer
+ SSD1306_SET_COL_ADDR, 0, 127,
+
+ // reset page pointer
+ SSD1306_SET_PAGE_ADDR, 0, 7
};
void writeCommand(uint8_t command);