Created
September 17, 2015 14:31
-
-
Save ObKo/4877222ed06855b6dfec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/drivers/gdisp/SSD1306/SSD1306.h b/drivers/gdisp/SSD1306/SSD1306.h | |
index 7d7010e..8ec8b3a 100644 | |
--- a/drivers/gdisp/SSD1306/SSD1306.h | |
+++ b/drivers/gdisp/SSD1306/SSD1306.h | |
@@ -44,6 +44,9 @@ | |
#define SSD1306_EXTERNALVCC 0x1 | |
#define SSD1306_SWITCHCAPVCC 0x2 | |
+#define SSD1306_SETLOWCOLUMN 0x00 | |
+#define SSD1306_SETHIGHCOLUMN 0x10 | |
+ | |
// Scrolling #defines | |
#define SSD1306_SCROLL_ACTIVATE 0x2F | |
#define SSD1306_SCROLL_DEACTIVATE 0x2E | |
diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | |
index 2313e76..0a8658e 100644 | |
--- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | |
+++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | |
@@ -150,6 +150,11 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { | |
write_cmd(g, SSD1306_SETSTARTLINE | 0); | |
while (pages--) { | |
+#if SSD1306_SH1106 | |
+ write_cmd(g, SSD1306_PAM_PAGE_START + (7 - pages)); | |
+ write_cmd(g, SSD1306_SETLOWCOLUMN + 2); | |
+ write_cmd(g, SSD1306_SETHIGHCOLUMN); | |
+#endif | |
write_data(g, ram, SSD1306_PAGE_WIDTH); | |
ram += SSD1306_PAGE_WIDTH; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment