Add support for SH1106 in the SSD1306 driver
This commit is contained in:
parent
4eb0dbb1e3
commit
0ab2228364
@ -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
|
||||
|
@ -150,6 +150,12 @@ 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user