Parcourir la source

[2.0.x] Adding support for using the MKS_12864OLED with the SSD1306 controller (#8814)

* Adding support for using the MKS_12864OLED with the SSD1306 controller

* Update comment for correct controller type
Dan Delaney il y a 7 ans
Parent
révision
b055d8c39c

+ 5
- 3
Marlin/Configuration.h Voir le fichier

@@ -1625,12 +1625,14 @@
1625 1625
 //#define CR10_STOCKDISPLAY
1626 1626
 
1627 1627
 //
1628
-// MKS OLED 1.3" 128 × 64 FULL GRAPHICS CONTROLLER
1628
+// MKS OLED 1.3" 128x64 FULL GRAPHICS CONTROLLER
1629 1629
 // http://reprap.org/wiki/MKS_12864OLED
1630 1630
 //
1631 1631
 // Tiny, but very sharp OLED display
1632
-//
1633
-//#define MKS_12864OLED
1632
+// If there is a pixel shift, try the other controller.
1633
+
1634
+//#define MKS_12864OLED          // Uses the SH1106 controller (default)
1635
+//#define MKS_12864OLED_SSD1306  // Uses the SSD1306 controller
1634 1636
 
1635 1637
 //
1636 1638
 // AZSMZ 12864 LCD with SD

+ 5
- 0
Marlin/src/inc/Conditionals_LCD.h Voir le fichier

@@ -130,6 +130,11 @@
130 130
   #define REPRAP_DISCOUNT_SMART_CONTROLLER
131 131
   #define U8GLIB_SH1106
132 132
 
133
+#elif ENABLED(MKS_12864OLED_SSD1306)
134
+
135
+  #define REPRAP_DISCOUNT_SMART_CONTROLLER
136
+  #define U8GLIB_SSD1306
137
+
133 138
 #elif ENABLED(MKS_MINI_12864)
134 139
 
135 140
   #define MINIPANEL

+ 9
- 3
Marlin/src/inc/SanityCheck.h Voir le fichier

@@ -1289,6 +1289,7 @@ static_assert(1 >= 0
1289 1289
  *       REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER => REPRAP_DISCOUNT_SMART_CONTROLLER
1290 1290
  *       SAV_3DGLCD => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
1291 1291
  *       MKS_12864OLED => U8GLIB_SH1106 => ULTIMAKERCONTROLLER
1292
+ *       MKS_12864OLED_SSD1306 => U8GLIB_SSD1306 => ULTIMAKERCONTROLLER
1292 1293
  *       miniVIKI => ULTIMAKERCONTROLLER
1293 1294
  *       VIKI2 => ULTIMAKERCONTROLLER
1294 1295
  *       ELB_FULL_GRAPHIC_CONTROLLER => ULTIMAKERCONTROLLER
@@ -1303,14 +1304,16 @@ static_assert(1 >= 0
1303 1304
       && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) \
1304 1305
       && DISABLED(AZSMZ_12864) \
1305 1306
       && DISABLED(PANEL_ONE) \
1306
-      && DISABLED(MKS_12864OLED)
1307
+      && DISABLED(MKS_12864OLED) \
1308
+      && DISABLED(MKS_12864OLED_SSD1306)
1307 1309
     + 1
1308 1310
   #endif
1309 1311
   #if ENABLED(REPRAP_DISCOUNT_SMART_CONTROLLER) \
1310 1312
       && DISABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
1311 1313
       && DISABLED(LCD_FOR_MELZI) \
1312 1314
       && DISABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602) \
1313
-      && DISABLED(MKS_12864OLED)
1315
+      && DISABLED(MKS_12864OLED) \
1316
+      && DISABLED(MKS_12864OLED_SSD1306)
1314 1317
     + 1
1315 1318
   #endif
1316 1319
   #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) \
@@ -1323,6 +1326,9 @@ static_assert(1 >= 0
1323 1326
   #if ENABLED(MKS_12864OLED)
1324 1327
     + 1
1325 1328
   #endif
1329
+  #if ENABLED(MKS_12864OLED_SSD1306)
1330
+    + 1
1331
+  #endif
1326 1332
   #if ENABLED(MAKEBOARD_MINI_2_LINE_DISPLAY_1602)
1327 1333
     + 1
1328 1334
   #endif
@@ -1382,7 +1388,7 @@ static_assert(1 >= 0
1382 1388
   #if ENABLED(LCD_I2C_VIKI)
1383 1389
     + 1
1384 1390
   #endif
1385
-  #if ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2)
1391
+  #if ENABLED(U8GLIB_SSD1306) && DISABLED(OLED_PANEL_TINYBOY2) && DISABLED(MKS_12864OLED_SSD1306)
1386 1392
     + 1
1387 1393
   #endif
1388 1394
   #if ENABLED(SAV_3DLCD)

+ 5
- 0
Marlin/src/lcd/ultralcd_impl_DOGM.h Voir le fichier

@@ -195,6 +195,11 @@
195 195
     //U8GLIB_64128N_2X_HAL u8g(DOGLCD_CS, DOGLCD_A0);  // using HW-SPI
196 196
     U8GLIB_64128N_2X_HAL u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0);  // using SW-SPI
197 197
 
198
+#elif ENABLED(MKS_12864OLED_SSD1306)
199
+  // MKS 128x64 (SSD1306) OLED I2C LCD
200
+    U8GLIB_SSD1306_128X64 u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0);      // 8 stripes
201
+    //U8GLIB_SSD1306_128X64_2X u8g(DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0); // 4 stripes
202
+
198 203
 #elif ENABLED(U8GLIB_SSD1306)
199 204
   // Generic support for SSD1306 OLED I2C LCDs
200 205
     //U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE  u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST); // 4 stripes

+ 1
- 1
Marlin/src/pins/pins_RAMPS.h Voir le fichier

@@ -339,7 +339,7 @@
339 339
 
340 340
     #else
341 341
 
342
-      #if ENABLED(MKS_12864OLED)
342
+      #if ENABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
343 343
         #define LCD_PINS_DC     25 // Set as output on init
344 344
         #define LCD_PINS_RS     27 // Pull low for 1s to init
345 345
         // DOGM SPI LCD Support

+ 1
- 1
Marlin/src/pins/pins_RAMPS_PLUS.h Voir le fichier

@@ -76,7 +76,7 @@
76 76
 #undef E1_CS_PIN
77 77
 
78 78
 #if ENABLED(ULTRA_LCD) && DISABLED(REPRAPWORLD_GRAPHICAL_LCD) && (DISABLED(NEWPANEL) || DISABLED(PANEL_ONE)) && DISABLED(CR10_STOCKDISPLAY)
79
-  #if DISABLED(MKS_12864OLED)
79
+  #if DISABLED(MKS_12864OLED) || ENABLED(MKS_12864OLED_SSD1306)
80 80
     #undef LCD_PINS_RS
81 81
     #define LCD_PINS_RS     42   // 3DYMY boards pin 16 -> 42
82 82
     #undef LCD_PINS_ENABLE

Chargement…
Annuler
Enregistrer