From 65324957496d814820b38624dc67358de620146a Mon Sep 17 00:00:00 2001 From: thisiskeithb Date: Tue, 10 Dec 2019 22:57:14 -0800 Subject: [PATCH 1/4] Add MKS_12864OLED_SSD1306 pins --- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 96 +++++++++++++---------- 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index e1b4169e035c..839a41d4913e 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -203,60 +203,76 @@ #define LCD_PINS_D4 P0_17 #else - #define LCD_PINS_RS P0_16 #define BTN_EN1 P3_25 #define BTN_EN2 P3_26 - #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 - #define LCD_SDSS P0_28 #define SD_DETECT_PIN P0_27 - #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P0_18 - #define DOGLCD_A0 P0_16 - #define DOGLCD_SCK P0_07 - #define DOGLCD_MOSI P1_20 - - #define LCD_BACKLIGHT_PIN -1 - - #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems - // results in LCD soft SPI mode 3, SD soft SPI mode 0 + #if ENABLED(MKS_12864OLED_SSD1306) + #define LCD_PINS_DC P0_17 + #define DOGLCD_CS P0_16 + #define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_SCK P0_15 + #define DOGLCD_MOSI P0_18 + + #define LCD_PINS_RS P1_00 + #define LCD_PINS_D7 P1_22 + #define KILL_PIN -1 // NC + + #else + + #define LCD_PINS_RS P0_16 + + #define LCD_PINS_ENABLE P0_18 + #define LCD_PINS_D4 P0_15 + + #if ENABLED(FYSETC_MINI_12864) + #define DOGLCD_CS P0_18 + #define DOGLCD_A0 P0_16 + #define DOGLCD_SCK P0_07 + #define DOGLCD_MOSI P1_20 + + #define LCD_BACKLIGHT_PIN -1 + + #define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems + // results in LCD soft SPI mode 3, SD soft SPI mode 0 + + #define LCD_RESET_PIN P0_15 // Must be high or open for LCD to operate normally. + + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN P0_17 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN P1_00 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN P1_22 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN P0_17 + #endif - #define LCD_RESET_PIN P0_15 // Must be high or open for LCD to operate normally. + #else // !FYSETC_MINI_12864 - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN P0_17 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN P1_00 + #if ENABLED(MKS_MINI_12864) + #define DOGLCD_CS P0_17 + #define DOGLCD_A0 P1_00 #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN P1_22 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN P0_17 - #endif - - #else // !FYSETC_MINI_12864 - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS P0_17 - #define DOGLCD_A0 P1_00 - #endif + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 P0_17 + #define LCD_PINS_D6 P1_00 + #define LCD_PINS_D7 P1_22 + #endif - #if ENABLED(ULTIPANEL) - #define LCD_PINS_D5 P0_17 - #define LCD_PINS_D6 P1_00 - #define LCD_PINS_D7 P1_22 - #endif + #endif // !FYSETC_MINI_12864 - #endif // !FYSETC_MINI_12864 + #endif //MKS_12864OLED_SSD1306 - #endif + #endif // !CR10_STOCKDISPLAY #endif // HAS_SPI_LCD From aeee71dd99dc5b3a788aca90ff3a5e0238194905 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Dec 2019 02:10:43 -0600 Subject: [PATCH 2/4] Update pins_MKS_SGEN_L.h --- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 839a41d4913e..11e69f2edfea 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -211,15 +211,16 @@ #define SD_DETECT_PIN P0_27 #if ENABLED(MKS_12864OLED_SSD1306) - #define LCD_PINS_DC P0_17 - #define DOGLCD_CS P0_16 - #define DOGLCD_A0 LCD_PINS_DC - #define DOGLCD_SCK P0_15 - #define DOGLCD_MOSI P0_18 - - #define LCD_PINS_RS P1_00 - #define LCD_PINS_D7 P1_22 - #define KILL_PIN -1 // NC + + #define LCD_PINS_DC P0_17 + #define DOGLCD_CS P0_16 + #define DOGLCD_A0 LCD_PINS_DC + #define DOGLCD_SCK P0_15 + #define DOGLCD_MOSI P0_18 + + #define LCD_PINS_RS P1_00 + #define LCD_PINS_D7 P1_22 + #define KILL_PIN -1 // NC #else From 668d4752fe00692cf50bd547c97b6884a4b5ddb0 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Dec 2019 02:11:36 -0600 Subject: [PATCH 3/4] Update pins_MKS_SGEN_L.h --- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 11e69f2edfea..a17ccc67f9ca 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -222,7 +222,7 @@ #define LCD_PINS_D7 P1_22 #define KILL_PIN -1 // NC - #else + #else // !MKS_12864OLED_SSD1306 #define LCD_PINS_RS P0_16 @@ -271,7 +271,7 @@ #endif // !FYSETC_MINI_12864 - #endif //MKS_12864OLED_SSD1306 + #endif // !MKS_12864OLED_SSD1306 #endif // !CR10_STOCKDISPLAY From 522b21deeba6e05e700e837a70360414adb721c3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 11 Dec 2019 02:16:36 -0600 Subject: [PATCH 4/4] Update pins_MKS_SGEN_L.h --- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index a17ccc67f9ca..8d4adca34bdb 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -224,16 +224,17 @@ #else // !MKS_12864OLED_SSD1306 - #define LCD_PINS_RS P0_16 + #define LCD_PINS_RS P0_16 #define LCD_PINS_ENABLE P0_18 - #define LCD_PINS_D4 P0_15 + #define LCD_PINS_D4 P0_15 #if ENABLED(FYSETC_MINI_12864) - #define DOGLCD_CS P0_18 - #define DOGLCD_A0 P0_16 - #define DOGLCD_SCK P0_07 - #define DOGLCD_MOSI P1_20 + + #define DOGLCD_CS P0_18 + #define DOGLCD_A0 P0_16 + #define DOGLCD_SCK P0_07 + #define DOGLCD_MOSI P1_20 #define LCD_BACKLIGHT_PIN -1