diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c50af25e63..ab1565d343 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -2376,6 +2376,11 @@ //#define VIKI2 //#define miniVIKI +// +// Alfawise Ex8 printer LCD marked as WYH L12864 COG +// +//#define WYH_L12864 + // // MakerLab Mini Panel with graphic // controller and SD support - https://reprap.org/wiki/Mini_panel diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6e44f009ed..8e1f673c87 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1603,7 +1603,7 @@ * Set STATUS_EXPIRE_SECONDS to zero to never clear the status. * This will prevent position updates from being displayed. */ - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 // Enable this option and reduce the value to optimize screen updates. // The normal delay is 10µs. Use the lowest value that still gives a reliable display. //#define DOGM_SPI_DELAY_US 5 diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp index 65bfd4f4e2..8268cf307e 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_st7920_sw_spi.cpp @@ -57,7 +57,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #include "../../../inc/MarlinConfig.h" #include "../../shared/Delay.h" @@ -182,5 +182,5 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va } #endif // LIGHTWEIGHT_UI -#endif // U8GLIB_ST7920 +#endif // IS_U8GLIB_ST7920 #endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp index 2b13c182d0..68e3e74a45 100644 --- a/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp +++ b/Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp @@ -57,7 +57,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) +#if HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920 #include "u8g_com_HAL_DUE_sw_spi_shared.h" @@ -141,5 +141,5 @@ uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void return 1; } -#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920 +#endif // HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920 #endif // ARDUINO_ARCH_SAM diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp index 039fa6769b..e159ebaa0c 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_st7920_sw_spi.cpp @@ -57,7 +57,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #include #include @@ -143,5 +143,5 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar return 1; } -#endif // U8GLIB_ST7920 +#endif // IS_U8GLIB_ST7920 #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp index 3308d03e79..f116a9b80a 100644 --- a/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp +++ b/Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp @@ -57,7 +57,7 @@ #include "../../../inc/MarlinConfigPre.h" -#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) +#if HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920 #include #include "../../shared/HAL_SPI.h" @@ -205,5 +205,5 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, return 1; } -#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920 +#endif // HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920 #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_st7920_sw_spi.cpp b/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_st7920_sw_spi.cpp index c77c3d30f0..c384cdd751 100644 --- a/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_st7920_sw_spi.cpp +++ b/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_st7920_sw_spi.cpp @@ -57,7 +57,7 @@ #include "../../../inc/MarlinConfig.h" -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #include #include "../../shared/Delay.h" @@ -167,5 +167,5 @@ uint8_t u8g_com_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void } #endif -#endif // U8GLIB_ST7920 +#endif // IS_U8GLIB_ST7920 #endif // TARGET_LPC1768 diff --git a/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_sw_spi.cpp b/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_sw_spi.cpp index 085954803c..7fd335d62e 100644 --- a/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_sw_spi.cpp +++ b/Marlin/src/HAL/NATIVE_SIM/u8g/u8g_com_sw_spi.cpp @@ -57,7 +57,7 @@ #include "../../../inc/MarlinConfig.h" -#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920) +#if HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920 #undef SPI_SPEED #define SPI_SPEED 2 // About 2 MHz @@ -211,5 +211,5 @@ uint8_t u8g_com_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_pt #elif !ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI, HAS_MARLINUI_HD44780) && HAS_MARLINUI_U8GLIB #include uint8_t u8g_com_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr) {return 0;} -#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920 +#endif // HAS_MARLINUI_U8GLIB && !IS_U8GLIB_ST7920 #endif // __PLAT_NATIVE_SIM__ diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 99b360f9f0..46b969a478 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -39,17 +39,17 @@ /** * General Flags that may be set below by specific LCDs * - * DOGLCD : Run a Graphical LCD through U8GLib (with MarlinUI) - * IS_ULTIPANEL : Define LCD_PINS_D5/6/7 for direct-connected "Ultipanel" LCDs - * IS_ULTRA_LCD : Ultra LCD, not necessarily Ultipanel. - * IS_RRD_SC : Common RRD Smart Controller digital interface pins - * IS_RRD_FG_SC : Common RRD Full Graphical Smart Controller digital interface pins - * U8GLIB_ST7920 : Most common DOGM display SPI interface, supporting a "lightweight" display mode. - * U8GLIB_SH1106 : SH1106 OLED with I2C interface via U8GLib - * IS_U8GLIB_SSD1306 : SSD1306 OLED with I2C interface via U8GLib - * U8GLIB_SSD1309 : SSD1309 OLED with I2C interface via U8GLib - * U8GLIB_ST7565_64128N : ST7565 128x64 LCD with SPI interface via U8GLib - * U8GLIB_LM6059_AF : LM6059 with Hardware SPI via U8GLib + * DOGLCD : Run a Graphical LCD through U8GLib (with MarlinUI) + * IS_ULTIPANEL : Define LCD_PINS_D5/6/7 for direct-connected "Ultipanel" LCDs + * IS_ULTRA_LCD : Ultra LCD, not necessarily Ultipanel. + * IS_RRD_SC : Common RRD Smart Controller digital interface pins + * IS_RRD_FG_SC : Common RRD Full Graphical Smart Controller digital interface pins + * IS_U8GLIB_ST7920 : Most common DOGM display SPI interface, supporting a "lightweight" display mode. + * U8GLIB_SH1106 : SH1106 OLED with I2C interface via U8GLib + * IS_U8GLIB_SSD1306 : SSD1306 OLED with I2C interface via U8GLib (U8GLIB_SSD1306) + * U8GLIB_SSD1309 : SSD1309 OLED with I2C interface via U8GLib (HAS_U8GLIB_I2C_OLED, IS_ULTRA_LCD, DOGLCD) + * IS_U8GLIB_ST7565_64128N : ST7565 128x64 LCD with SPI interface via U8GLib + * IS_U8GLIB_LM6059_AF : LM6059 with Hardware SPI via U8GLib */ #if EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) @@ -85,7 +85,7 @@ #elif ENABLED(ZONESTAR_12864LCD) #define DOGLCD #define IS_RRD_SC 1 - #define U8GLIB_ST7920 + #define IS_U8GLIB_ST7920 1 #elif ENABLED(ZONESTAR_12864OLED) #define IS_RRD_SC 1 @@ -99,19 +99,24 @@ #define IS_ULTIPANEL 1 #define ENCODER_PULSES_PER_STEP 2 -#elif ANY(miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) +#elif ANY(miniVIKI, VIKI2, WYH_L12864, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864) + + #define IS_DOGM_12864 1 #define DOGLCD #define IS_ULTIPANEL 1 #if ENABLED(miniVIKI) - #define U8GLIB_ST7565_64128N + #define IS_U8GLIB_ST7565_64128N 1 #elif ENABLED(VIKI2) - #define U8GLIB_ST7565_64128N + #define IS_U8GLIB_ST7565_64128N 1 + #elif ENABLED(WYH_L12864) + #define IS_U8GLIB_ST7565_64128N 1 + #define ST7565_XOFFSET 0x04 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) - #define U8GLIB_LM6059_AF + #define IS_U8GLIB_LM6059_AF 1 #elif ENABLED(AZSMZ_12864) - #define U8GLIB_ST7565_64128N + #define IS_U8GLIB_ST7565_64128N 1 #endif #elif ENABLED(OLED_PANEL_TINYBOY2) @@ -128,7 +133,7 @@ #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) #define DOGLCD - #define U8GLIB_ST7920 + #define IS_U8GLIB_ST7920 1 #define IS_ULTIPANEL 1 #elif ENABLED(MKS_12864OLED) @@ -144,7 +149,7 @@ #elif ENABLED(SAV_3DGLCD) #ifdef U8GLIB_SSD1306 - #define IS_U8GLIB_SSD1306 + #define IS_U8GLIB_SSD1306 // Allow for U8GLIB_SSD1306 + SAV_3DGLCD #endif #define IS_NEWPANEL 1 @@ -266,7 +271,7 @@ // ST7920-based graphical displays #if ANY(IS_RRD_FG_SC, LCD_FOR_MELZI, SILVER_GATE_GLCD_CONTROLLER) #define DOGLCD - #define U8GLIB_ST7920 + #define IS_U8GLIB_ST7920 1 #define IS_RRD_SC 1 #endif @@ -275,7 +280,7 @@ #define IS_ULTIPANEL 1 #define DOGLCD #if ENABLED(MAKRPANEL) - #define U8GLIB_ST7565_64128N + #define IS_U8GLIB_ST7565_64128N 1 #endif #endif @@ -373,25 +378,28 @@ * I2C Panels */ -#if EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) +#if ANY(IS_RRD_SC, IS_DOGM_12864, OLED_PANEL_TINYBOY2, LCD_I2C_PANELOLU2) - #define LCD_I2C_TYPE_PCF8575 - #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander + #define STD_ENCODER_PULSES_PER_STEP 4 + #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 + + #if ENABLED(LCD_I2C_PANELOLU2) // PANELOLU2 LCD with status LEDs, separate encoder and click inputs + #define LCD_I2C_TYPE_MCP23017 // I2C Character-based 12864 display + #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander + #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) + #define IS_ULTIPANEL 1 + #endif + +#elif EITHER(LCD_SAINSMART_I2C_1602, LCD_SAINSMART_I2C_2004) + + #define LCD_I2C_TYPE_PCF8575 // I2C Character-based 12864 display + #define LCD_I2C_ADDRESS 0x27 // I2C Address of the port expander #if ENABLED(LCD_SAINSMART_I2C_2004) #define LCD_WIDTH 20 #define LCD_HEIGHT 4 #endif -#elif ENABLED(LCD_I2C_PANELOLU2) - - // PANELOLU2 LCD with status LEDs, separate encoder and click inputs - - #define LCD_I2C_TYPE_MCP23017 - #define LCD_I2C_ADDRESS 0x20 // I2C Address of the port expander - #define LCD_USE_I2C_BUZZER // Enable buzzer on LCD (optional) - #define IS_ULTIPANEL 1 - #elif ENABLED(LCD_I2C_VIKI) /** @@ -417,11 +425,6 @@ #define STD_ENCODER_PULSES_PER_STEP 2 #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 -#elif ANY(IS_RRD_SC, miniVIKI, VIKI2, ELB_FULL_GRAPHIC_CONTROLLER, AZSMZ_12864, OLED_PANEL_TINYBOY2, BQ_LCD_SMART_CONTROLLER, LCD_I2C_PANELOLU2) - - #define STD_ENCODER_PULSES_PER_STEP 4 - #define STD_ENCODER_STEPS_PER_MENU_ITEM 1 - #endif #if EITHER(LCD_I2C_TYPE_MCP23017, LCD_I2C_TYPE_MCP23008) && DISABLED(NO_LCD_DETECT) diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 1db4208a1f..9dfc7b187a 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -358,6 +358,8 @@ #define _LCD_CONTRAST_MAX 115 #elif ENABLED(VIKI2) #define _LCD_CONTRAST_INIT 140 +#elif ENABLED(WYH_L12864) + #define _LCD_CONTRAST_INIT 190 #elif ENABLED(ELB_FULL_GRAPHIC_CONTROLLER) #define _LCD_CONTRAST_MIN 90 #define _LCD_CONTRAST_INIT 110 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 58c02e7ebd..8417292934 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -833,7 +833,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS /** * LCD Lightweight Screen Style */ -#if ENABLED(LIGHTWEIGHT_UI) && DISABLED(U8GLIB_ST7920) +#if ENABLED(LIGHTWEIGHT_UI) && !IS_U8GLIB_ST7920 #error "LIGHTWEIGHT_UI requires a U8GLIB_ST7920-based display." #endif @@ -2672,6 +2672,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + COUNT_ENABLED(MKS_TS35_V2_0, MKS_ROBIN_TFT24, MKS_ROBIN_TFT28, MKS_ROBIN_TFT32, MKS_ROBIN_TFT35, MKS_ROBIN_TFT43, MKS_ROBIN_TFT_V1_1R, ANET_ET4_TFT28, ANET_ET5_TFT35) \ + COUNT_ENABLED(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C) \ + COUNT_ENABLED(VIKI2, miniVIKI) \ + + ENABLED(WYH_L12864) \ + COUNT_ENABLED(ZONESTAR_12864LCD, ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) \ + COUNT_ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) \ + ENABLED(AZSMZ_12864) \ diff --git a/Marlin/src/lcd/dogm/marlinui_DOGM.h b/Marlin/src/lcd/dogm/marlinui_DOGM.h index 328b69b93b..050f147d62 100644 --- a/Marlin/src/lcd/dogm/marlinui_DOGM.h +++ b/Marlin/src/lcd/dogm/marlinui_DOGM.h @@ -43,7 +43,7 @@ #define U8G_PARAM LCD_PINS_D4, LCD_PINS_ENABLE, LCD_PINS_RS #endif -#elif ENABLED(U8GLIB_ST7920) +#elif IS_U8GLIB_ST7920 // RepRap Discount Full Graphics Smart Controller // and other variant LCDs using ST7920 @@ -72,7 +72,7 @@ #define U8G_CLASS U8GLIB_DOGM128_2X // 4 stripes (HW-SPI) #endif -#elif ENABLED(U8GLIB_LM6059_AF) +#elif IS_U8GLIB_LM6059_AF // Based on the Adafruit ST7565 (https://www.adafruit.com/products/250) @@ -82,7 +82,7 @@ #define U8G_CLASS U8GLIB_LM6059_2X // 4 stripes (HW-SPI) #endif -#elif ENABLED(U8GLIB_ST7565_64128N) +#elif IS_U8GLIB_ST7565_64128N // MaKrPanel, Mini Viki, Viki 2.0, AZSMZ 12864 ST7565 controller diff --git a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp index fda090338c..bfd44d08df 100644 --- a/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp +++ b/Marlin/src/lcd/dogm/u8g_dev_st7565_64128n_HAL.cpp @@ -63,6 +63,9 @@ #define WIDTH 128 #define HEIGHT 64 #define PAGE_HEIGHT 8 +#ifndef ST7565_XOFFSET + #define ST7565_XOFFSET 0x00 +#endif #define ST7565_ADC_REVERSE(N) ((N) ? 0xA1 : 0xA0) #define ST7565_BIAS_MODE(N) ((N) ? 0xA3 : 0xA2) @@ -123,7 +126,7 @@ static const uint8_t u8g_dev_st7565_64128n_HAL_init_seq[] PROGMEM = { static const uint8_t u8g_dev_st7565_64128n_HAL_data_start[] PROGMEM = { U8G_ESC_ADR(0), // instruction mode U8G_ESC_CS(1), // enable chip - ST7565_COLUMN_ADR(0x00), // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N + ST7565_COLUMN_ADR(ST7565_XOFFSET), // high 4 bits to 0, low 4 bits to 0. Changed for DisplayTech 64128N U8G_ESC_END // end of sequence }; diff --git a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp index 9367ed75a9..e844eee251 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -29,7 +29,7 @@ #include "../../inc/MarlinConfig.h" -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #include "ultralcd_st7920_u8glib_rrd_AVR.h" @@ -192,5 +192,5 @@ u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_rrd_st7920_128x64_fn, &u8 void ST7920_write_byte(const uint8_t val) { ST7920_WRITE_BYTE(val); } #endif -#endif // U8GLIB_ST7920 +#endif // IS_U8GLIB_ST7920 #endif // !U8G_HAL_LINKS && (__AVR__ || ARDUINO_ARCH_STM32 || ARDUINO_ARCH_ESP32) diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h index dc52a7c36d..ec8f31b854 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -220,12 +220,13 @@ #error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board." #elif ENABLED(ANET_FULL_GRAPHICS_LCD) + #error "CAUTION! ANET_FULL_GRAPHICS_LCD requires wiring modifications. See 'pins_BTT_SKR_V1_3.h' for details. Comment out this line to continue." /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) - * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.) + * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because it is open drain.) * 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board. * * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! @@ -252,6 +253,38 @@ #define LCD_PINS_ENABLE EXP1_05_PIN #define LCD_PINS_D4 EXP1_07_PIN + #elif ENABLED(WYH_L12864) + + #error "CAUTION! WYH_L12864 requires wiring modifications. Comment out this line to continue." + + /** + * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. + * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) + * 3. Swap the LCD's MOSI (Pin9) and empty (Pin10) wires because Pin9 is open drain. + * + * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! + * + * The WYH_L12864 connector plug: + * + * BEFORE AFTER + * ______ ______ + * GND | 1 2 | 5V 5V | 1 2 | GND + * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 + * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 + * SCK | 7 8 | BTN_ENC SCK | 7 8 | BTN_ENC + * MOSI | 9 10 | open | 9 10 | MOSI + * ------ ------ + * LCD LCD + */ + #define BTN_EN1 EXP1_06_PIN + #define BTN_EN2 EXP1_04_PIN + #define BTN_ENC EXP1_08_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_05_PIN + #define DOGLCD_SCK EXP1_07_PIN + #define DOGLCD_MOSI EXP1_10_PIN + #define LCD_BACKLIGHT_PIN -1 + #elif ENABLED(CR10_STOCKDISPLAY) #define LCD_PINS_RS EXP1_04_PIN diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h index 17daf176da..dc82a2857f 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -321,7 +321,7 @@ /** * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. (This is the critical part!) - * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because this pin is open drain.) + * 3. Rewire the CLK Signal (LCD Pin9) to LCD Pin7. (LCD Pin9 remains open because it is open drain.) * 4. A wire is needed to connect the Reset switch at J3 (LCD Pin7) to EXP2 (Pin3) on the board. * * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! diff --git a/Marlin/src/pins/mega/pins_SILVER_GATE.h b/Marlin/src/pins/mega/pins_SILVER_GATE.h index 7b4f53a764..c2ca5b3103 100644 --- a/Marlin/src/pins/mega/pins_SILVER_GATE.h +++ b/Marlin/src/pins/mega/pins_SILVER_GATE.h @@ -73,7 +73,7 @@ #define TEMP_BED_PIN 6 #if HAS_WIRED_LCD - #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 + #if IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920 #define LCD_PINS_RS 30 #define LCD_PINS_ENABLE 20 #define LCD_PINS_D4 25 diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index 0293da1dba..367432b1a9 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -49,7 +49,7 @@ #define IS_RAMPS_SF #endif -#if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, MINIPANEL, REPRAPWORLD_KEYPAD)) +#if !(BOTH(IS_ULTRA_LCD, IS_NEWPANEL) && ANY(PANEL_ONE, VIKI2, miniVIKI, WYH_L12864, MINIPANEL, REPRAPWORLD_KEYPAD)) #define HAS_FREE_AUX2_PINS 1 #endif diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index 4860e2d800..827e07e3f5 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -1366,7 +1366,7 @@ // // Default DOGLCD SPI delays // -#if DISABLED(U8GLIB_ST7920) +#if !IS_U8GLIB_ST7920 #undef ST7920_DELAY_1 #undef ST7920_DELAY_2 #undef ST7920_DELAY_3 diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index 25decbf035..a7d1a62820 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -205,7 +205,7 @@ #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_WIRED_LCD -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 250 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 48c68d55f9..45c09ae33e 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -201,7 +201,7 @@ #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 250 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index c496878908..ab25e2e692 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -193,7 +193,7 @@ #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 250 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index 8153103a38..41e59c1b22 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -270,7 +270,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 0 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index 5bd1667356..4ff6e2d7e5 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -166,7 +166,7 @@ #endif // IS_ULTRA_LCD && IS_NEWPANEL -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 188 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h index 7715eca7eb..64d881866b 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -106,7 +106,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 0 #define BOARD_ST7920_DELAY_3 189 diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h index 4bebd6ded6..ced66d80b8 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h @@ -40,7 +40,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 250 #define BOARD_ST7920_DELAY_3 250 diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index 94c4551fc2..f15c89e4f8 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -199,7 +199,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 200 #define BOARD_ST7920_DELAY_2 200 #define BOARD_ST7920_DELAY_3 200 diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h index 31583fd109..852ad5a34b 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -32,7 +32,7 @@ #define IS_MELZI 1 // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 0 #endif diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index 3c6dd901c0..36e26980f4 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -36,7 +36,7 @@ #define BOARD_INFO_NAME "Melzi (Creality)" // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h index 8abed5c30c..81bd78b7a0 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h @@ -28,7 +28,7 @@ #define BOARD_INFO_NAME "Melzi (Tronxy)" // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/sanguino/pins_MELZI_V2.h b/Marlin/src/pins/sanguino/pins_MELZI_V2.h index c3133432e0..a3ab5ff61b 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_V2.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_V2.h @@ -28,7 +28,7 @@ #define BOARD_INFO_NAME "Melzi V2" // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 0 #define BOARD_ST7920_DELAY_2 400 #define BOARD_ST7920_DELAY_3 0 diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index 8dd6171b92..02f4a6e985 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -165,7 +165,7 @@ #define KILL_PIN 10 #define BEEPER_PIN 27 - #elif ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 + #elif IS_U8GLIB_ST7920 // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 #if IS_MELZI #define LCD_PINS_RS 30 // CS chip select /SS chip slave select diff --git a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h index 650357ee9e..a6cc5ffa60 100644 --- a/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h +++ b/Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h @@ -202,7 +202,7 @@ #endif // !FYSETC_MINI_12864 // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index 77eb6aaf14..f8e3e76ada 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -155,7 +155,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 3f02d7082f..e4c741eae7 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -179,7 +179,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index b3da8d884e..520764a503 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -158,7 +158,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index 3650ffde5c..cb5200bc27 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -166,7 +166,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 56dda2b143..88aa35f2c0 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -163,7 +163,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715 diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index c9a20fd66e..12a6d5b84d 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -168,7 +168,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h index 489da08393..dd1008ee3a 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -221,7 +221,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 125 #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index 6388e1723c..3767748e53 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -113,7 +113,7 @@ #endif // !MKS_MINI_12864 // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h index d19343386e..3df6727d03 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -365,7 +365,7 @@ #endif - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index fdee796692..69fdd1da89 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -300,7 +300,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 125 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h index daacd0c124..ca6510c7d9 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h @@ -332,7 +332,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 125 #define BOARD_ST7920_DELAY_2 250 #define BOARD_ST7920_DELAY_3 125 diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h index e0b2f6adfc..817ad71752 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h @@ -305,7 +305,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 200 // Tclk_fall <200ns #define BOARD_ST7920_DELAY_2 250 // Tdata_width >200ns #define BOARD_ST7920_DELAY_3 200 // Tclk_rise <200ns diff --git a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h index 86851a7840..d054e354f7 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -285,7 +285,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index eb0c3bdbb9..bd483ecf0a 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -277,7 +277,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h index 68948f7de9..0715380e22 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -483,7 +483,7 @@ #endif // Alter timing for graphical display - #if ENABLED(U8GLIB_ST7920) + #if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h index ab0a7dd962..bb77285c01 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -478,7 +478,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 120 #define BOARD_ST7920_DELAY_2 80 #define BOARD_ST7920_DELAY_3 580 diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h index 72154be2ee..3314d0154d 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -453,6 +453,39 @@ #define BTN_EN1 EXP2_08_PIN #define BTN_EN2 EXP2_06_PIN + #elif ENABLED(WYH_L12864) + + #error "CAUTION! WYH_L12864 requires wiring modifications. Comment out this line to continue." + + /** + * 1. Cut the tab off the LCD connector so it can be plugged into the "EXP1" connector the other way. + * 2. Swap the LCD's +5V (Pin2) and GND (Pin1) wires. + * + * !!! If you are unsure, ask for help! Your motherboard may be damaged in some circumstances !!! + * + * The WYH_L12864 connector plug: + * + * BEFORE AFTER + * ______ ______ + * GND | 1 2 | 5V 5V | 1 2 | GND + * CS | 3 4 | BTN_EN2 CS | 3 4 | BTN_EN2 + * SID | 5 6 BTN_EN1 SID | 5 6 BTN_EN1 + * SCK | 7 8 | BTN_ENC SCK | 7 8 | BTN_ENC + * MOSI | 9 10 | MOSI | 9 10 | + * ------ ------ + * LCD LCD + */ + #undef BEEPER_PIN + #undef BTN_ENC + #define BTN_EN1 EXP1_06_PIN + #define BTN_EN2 EXP1_04_PIN + #define BTN_ENC EXP1_08_PIN + #define DOGLCD_CS EXP1_03_PIN + #define DOGLCD_A0 EXP1_05_PIN + #define DOGLCD_SCK EXP1_07_PIN + #define DOGLCD_MOSI EXP1_09_PIN + #define LCD_BACKLIGHT_PIN -1 + #else #define LCD_PINS_RS EXP1_07_PIN @@ -499,7 +532,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 125 #endif diff --git a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h index a05f4fb5b9..95cfb1234d 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h @@ -483,7 +483,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 120 #endif diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 8a9ac56e9e..794649e416 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -305,7 +305,7 @@ #define FIL_RUNOUT_PIN PA3 // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h index 3fe7449330..a604a71c4b 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -245,7 +245,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 600 diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 6b6f644159..e2454b578d 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -314,7 +314,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 640 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 4c0e3515f6..00f49acbeb 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -172,7 +172,7 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 640 diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index f936df2c2c..bb5507b29a 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -183,7 +183,7 @@ #endif // Alter timing for graphical display -#if ENABLED(U8GLIB_ST7920) +#if IS_U8GLIB_ST7920 #define BOARD_ST7920_DELAY_1 96 #define BOARD_ST7920_DELAY_2 48 #define BOARD_ST7920_DELAY_3 715