summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/driver/ssd1306.h25
-rw-r--r--src/driver/Kconfig12
2 files changed, 35 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,
diff --git a/src/driver/Kconfig b/src/driver/Kconfig
index dbcf9dd..4e630d2 100644
--- a/src/driver/Kconfig
+++ b/src/driver/Kconfig
@@ -102,6 +102,18 @@ int "Display height"
default 64
depends on driver_ssd1306
+choice driver_ssd1306_mode
+bool "Addressing Mode"
+depends on driver_ssd1306
+
+config driver_ssd1306_mode_vertical
+bool "Vertical"
+
+config driver_ssd1306_mode_horizontal
+bool "Horizontal bytes, Vertical bits"
+
+endchoice
+
config driver_softi2c
bool "Software I2C"
#depends on !driver_i2c