From e6a81133dd3d0d4076a08be76340f905fdbf7c7f Mon Sep 17 00:00:00 2001
From: Michael F. Lamb
Date: Tue, 11 Jun 2019 15:27:17 -0700
Subject: Add SH1106 OLED support (#5787)
* modify oled_driver to support SH1106
also:
- improve mechanism to specify which OLED IC we use
- comment calc_bounds()
- give OLED_COLUMN_OFFSET a default value
- inline comment re: OLED MEMORY_MODE and SH1106
- update docs/feature_oled_driver.h for SH1106 support and related changes
- docs: OLED: note we have tested SSD1306 on ARM boards (per @XScorpion2)
- define out MEMORY_MODE when using SH1106 OLED driver
* document that SSD1306 128x64 on AVR works
Per @XScorpion2: https://github.com/qmk/qmk_firmware/pull/5787#discussion_r291837842
---
drivers/oled/oled_driver.h | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
(limited to 'drivers/oled/oled_driver.h')
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index abbdde57ed..03dda2e64a 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -19,6 +19,9 @@ along with this program. If not, see .
#include
#include
+// an enumeration of the chips this driver supports
+#define OLED_IC_SSD1306 0
+#define OLED_IC_SH1106 1
#if defined(OLED_DISPLAY_CUSTOM)
// Expected user to implement the necessary defines
@@ -100,7 +103,16 @@ along with this program. If not, see .
// #define OLED_TARGET_MAP { 48, 32, 16, 0, 56, 40, 24, 8 }
#endif // defined(OLED_DISPLAY_CUSTOM)
-// Address to use for tthe i2d oled communication
+#if !defined(OLED_IC)
+ #define OLED_IC OLED_IC_SSD1306
+#endif
+
+// the column address corresponding to the first column in the display hardware
+#if !defined(OLED_COLUMN_OFFSET)
+ #define OLED_COLUMN_OFFSET 0
+#endif
+
+// Address to use for the i2c oled communication
#if !defined(OLED_DISPLAY_ADDRESS)
#define OLED_DISPLAY_ADDRESS 0x3C
#endif
--
cgit v1.2.3