summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-11-03 17:36:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-11-03 17:36:32 +0100
commit66fbc1f9035558d01fd9dcef1b5efc6d7d431d83 (patch)
tree1a56eb9c8eb76f376edd888496d277e63a2eb1c3 /include
parentae792d1aca94749dceb9f843ae8bc8dfc3b9dfdd (diff)
ssd1306: support both vertical and horizontal adress modes
Diffstat (limited to 'include')
-rw-r--r--include/driver/ssd1306.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/driver/ssd1306.h b/include/driver/ssd1306.h
index 37cee81..a3afc0f 100644
--- a/include/driver/ssd1306.h
+++ b/include/driver/ssd1306.h
@@ -49,16 +49,37 @@ class SSD1306 {
// Turn off power for configuration
SSD1306_SET_DISP | 0x00,
+#ifdef CONFIG_driver_ssd1306_mode_horizontal
/*
- * Enable Horizontal Addressing Mode. Assuming image data is
- * {A, B, C, ...}, each byte corresponds to a 1x8 column, starting
+ * Enable Horizontal Addressing Mode. Assuming image data is {A, B, C,
+ * ..., a, b, c, ...}, each byte corresponds to a 1x8 column, starting
* at the top left corner and proceeding to the right and then down:
*
* A7 B7 C7 ...
* .. .. .. ...
* A0 B0 C0 ...
+ * a7 b7 c7 ...
+ * .. .. .. ...
+ * a0 b0 c0 ...
*/
SSD1306_SET_MEM_ADDR, 0x00,
+#endif
+#ifdef CONFIG_driver_ssd1306_mode_vertical
+ /*
+ * Enable Vertical Addressing Mode. Assuming image data is {A, B, C,
+ * ..., a, b, c, ...}, each byte corresponds to a 1x8 column, starting
+ * at the top left corner and proceeding down and then to the right:
+ *
+ * A7 a7 ...
+ * .. .. ...
+ * A0 a0 ...
+ * B7 b7 ...
+ * .. .. ...
+ * B0 b0 ...
+ * .. .. ...
+ */
+ SSD1306_SET_MEM_ADDR, 0x01,
+#endif
// RAM line 0 == display line 0
SSD1306_SET_DISP_START_LINE | 0x00,