From 7704d844198deb50feb74326f94385c67eb44aba Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 28 Aug 2021 15:27:52 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20EXP=20headers,=20ST7920=20delays?= =?UTF-8?q?=20(#22641)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/HAL/AVR/HAL.h | 13 ++ Marlin/src/HAL/LINUX/HAL.h | 6 +- Marlin/src/HAL/LPC1768/HAL.h | 12 +- Marlin/src/HAL/NATIVE_SIM/HAL.h | 6 +- Marlin/src/HAL/STM32/HAL.h | 7 + Marlin/src/HAL/STM32F1/HAL.h | 7 + Marlin/src/HAL/TEENSY31_32/HAL.h | 6 +- Marlin/src/HAL/TEENSY35_36/HAL.h | 6 +- Marlin/src/HAL/TEENSY40_41/HAL.h | 6 +- Marlin/src/inc/Conditionals_LCD.h | 15 ++- .../dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp | 54 -------- Marlin/src/pins/esp32/pins_MRR_ESPE.h | 2 +- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h | 1 - Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h | 17 ++- Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h | 19 ++- Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h | 1 - .../src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h | 1 - Marlin/src/pins/mega/pins_OVERLORD.h | 2 +- Marlin/src/pins/mega/pins_SILVER_GATE.h | 5 +- Marlin/src/pins/pins_postprocess.h | 38 +++++- Marlin/src/pins/rambo/pins_EINSY_RAMBO.h | 6 + Marlin/src/pins/rambo/pins_EINSY_RETRO.h | 7 + Marlin/src/pins/rambo/pins_MINIRAMBO.h | 8 +- Marlin/src/pins/rambo/pins_RAMBO.h | 7 + Marlin/src/pins/ramps/pins_3DRAG.h | 7 + Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h | 6 +- Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h | 7 + Marlin/src/pins/ramps/pins_DAGOMA_F5.h | 6 +- .../src/pins/ramps/pins_FORMBOT_TREX2PLUS.h | 15 +-- Marlin/src/pins/ramps/pins_K8600.h | 21 --- Marlin/src/pins/ramps/pins_MKS_GEN_13.h | 69 ++++------ Marlin/src/pins/ramps/pins_RAMPS.h | 124 ++++++++++------- Marlin/src/pins/sanguino/pins_MELZI.h | 13 ++ .../src/pins/sanguino/pins_MELZI_CREALITY.h | 28 ++-- Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h | 13 -- Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h | 15 +-- Marlin/src/pins/sanguino/pins_MELZI_V2.h | 15 +-- .../src/pins/sanguino/pins_SANGUINOLOLU_11.h | 23 ---- Marlin/src/pins/sanguino/pins_ZMIB_V2.h | 7 +- .../src/pins/stm32f1/pins_BTT_SKR_MINI_V1_1.h | 126 ++++++++++-------- .../src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h | 54 ++++---- Marlin/src/pins/stm32f1/pins_FLY_MINI.h | 109 ++++++++------- Marlin/src/pins/stm32f1/pins_GTM32_MINI.h | 15 +-- Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h | 15 +-- Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h | 15 +-- Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h | 15 +-- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 12 +- .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 123 ++++++++++------- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h | 15 +-- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 6 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h | 15 +-- Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h | 3 +- Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h | 3 +- .../src/pins/stm32f4/pins_BTT_BTT002_V1_0.h | 15 +-- Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h | 14 +- Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h | 14 +- .../pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h | 32 ++--- .../pins/stm32f4/pins_BTT_SKR_PRO_common.h | 24 ++-- .../pins/stm32f4/pins_BTT_SKR_V2_0_common.h | 5 +- Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 19 +-- .../pins/stm32f4/pins_FYSETC_CHEETAH_V20.h | 14 +- Marlin/src/pins/stm32f4/pins_FYSETC_S6.h | 14 +- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 1 - Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 19 +-- Marlin/src/pins/stm32f4/pins_VAKE403D.h | 14 +- 65 files changed, 633 insertions(+), 699 deletions(-) diff --git a/Marlin/src/HAL/AVR/HAL.h b/Marlin/src/HAL/AVR/HAL.h index a5896a0e97..dc0a4f2074 100644 --- a/Marlin/src/HAL/AVR/HAL.h +++ b/Marlin/src/HAL/AVR/HAL.h @@ -39,6 +39,19 @@ #include #include +// +// Default graphical display delays +// +#if F_CPU >= 20000000 + #define CPU_ST7920_DELAY_1 DELAY_NS(150) + #define CPU_ST7920_DELAY_2 DELAY_NS( 0) + #define CPU_ST7920_DELAY_3 DELAY_NS(150) +#elif F_CPU == 16000000 + #define CPU_ST7920_DELAY_1 DELAY_NS(125) + #define CPU_ST7920_DELAY_2 DELAY_NS( 0) + #define CPU_ST7920_DELAY_3 DELAY_NS(188) +#endif + #ifndef pgm_read_ptr // Compatibility for avr-libc 1.8.0-4.1 included with Ubuntu for // Windows Subsystem for Linux on Windows 10 as of 10/18/2019 diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index 36906bffc8..07ab85a9a0 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -63,9 +63,9 @@ uint8_t _getc(); extern MSerialT usb_serial; #define MYSERIAL1 usb_serial -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) +#define CPU_ST7920_DELAY_1 DELAY_NS(600) +#define CPU_ST7920_DELAY_2 DELAY_NS(750) +#define CPU_ST7920_DELAY_3 DELAY_NS(750) // // Interrupts diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index 3f9cd2dfbd..f0a1185ff2 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -50,15 +50,9 @@ extern "C" volatile uint32_t _millis; // // Default graphical display delays // -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(600) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(750) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(750) -#endif +#define CPU_ST7920_DELAY_1 DELAY_NS(600) +#define CPU_ST7920_DELAY_2 DELAY_NS(750) +#define CPU_ST7920_DELAY_3 DELAY_NS(750) typedef ForwardSerial1Class< decltype(UsbSerial) > DefaultSerial1; extern DefaultSerial1 USBSerial; diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index d5c5782c36..400fafd711 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -99,9 +99,9 @@ extern MSerialT serial_stream_3; #endif -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) +#define CPU_ST7920_DELAY_1 DELAY_NS(600) +#define CPU_ST7920_DELAY_2 DELAY_NS(750) +#define CPU_ST7920_DELAY_3 DELAY_NS(750) // // Interrupts diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index 02bee57ba3..d73f8b2d54 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -37,6 +37,13 @@ #include +// +// Default graphical display delays +// +#define CPU_ST7920_DELAY_1 DELAY_NS(300) +#define CPU_ST7920_DELAY_2 DELAY_NS( 40) +#define CPU_ST7920_DELAY_3 DELAY_NS(340) + // // Serial Ports // diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index b3d8dc9d0b..7efb761c28 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -51,6 +51,13 @@ // Defines // ------------------------ +// +// Default graphical display delays +// +#define CPU_ST7920_DELAY_1 DELAY_NS(300) +#define CPU_ST7920_DELAY_2 DELAY_NS( 40) +#define CPU_ST7920_DELAY_3 DELAY_NS(340) + #ifndef STM32_FLASH_SIZE #if ANY(MCU_STM32F103RE, MCU_STM32F103VE, MCU_STM32F103ZE) #define STM32_FLASH_SIZE 512 diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index 8baa7936f5..d4b3c0a772 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -36,9 +36,9 @@ #include -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) +#define CPU_ST7920_DELAY_1 DELAY_NS(600) +#define CPU_ST7920_DELAY_2 DELAY_NS(750) +#define CPU_ST7920_DELAY_3 DELAY_NS(750) //#undef MOTHERBOARD //#define MOTHERBOARD BOARD_TEENSY31_32 diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 26c35223bd..0b82a569f9 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -37,9 +37,9 @@ #include #include -#define ST7920_DELAY_1 DELAY_NS(600) -#define ST7920_DELAY_2 DELAY_NS(750) -#define ST7920_DELAY_3 DELAY_NS(750) +#define CPU_ST7920_DELAY_1 DELAY_NS(600) +#define CPU_ST7920_DELAY_2 DELAY_NS(750) +#define CPU_ST7920_DELAY_3 DELAY_NS(750) // ------------------------ // Defines diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 1d00447fe8..14f14bf446 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -41,9 +41,9 @@ #include "../../feature/ethernet.h" #endif -//#define ST7920_DELAY_1 DELAY_NS(600) -//#define ST7920_DELAY_2 DELAY_NS(750) -//#define ST7920_DELAY_3 DELAY_NS(750) +#define CPU_ST7920_DELAY_1 DELAY_NS(600) +#define CPU_ST7920_DELAY_2 DELAY_NS(750) +#define CPU_ST7920_DELAY_3 DELAY_NS(750) // ------------------------ // Defines diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c4309db144..bfbe5ba6cf 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -237,11 +237,18 @@ #elif ENABLED(CR10_STOCKDISPLAY) #define IS_RRD_FG_SC 1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #define LCD_ST7920_DELAY_1 DELAY_NS(125) + #define LCD_ST7920_DELAY_2 DELAY_NS(125) + #define LCD_ST7920_DELAY_3 DELAY_NS(125) -#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING, BQ_LCD_SMART_CONTROLLER, K3D_FULL_GRAPHIC_SMART_CONTROLLER) +#elif ENABLED(ANET_FULL_GRAPHICS_LCD, ANET_FULL_GRAPHICS_LCD_ALT_WIRING) + + #define IS_RRD_FG_SC 1 + #define LCD_ST7920_DELAY_1 DELAY_NS(150) + #define LCD_ST7920_DELAY_2 DELAY_NS(150) + #define LCD_ST7920_DELAY_3 DELAY_NS(150) + +#elif ANY(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER, BQ_LCD_SMART_CONTROLLER, K3D_FULL_GRAPHIC_SMART_CONTROLLER) #define IS_RRD_FG_SC 1 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 4abf91edbd..20c8cec0cf 100644 --- a/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp +++ b/Marlin/src/lcd/dogm/ultralcd_st7920_u8glib_rrd_AVR.cpp @@ -33,60 +33,6 @@ #include "ultralcd_st7920_u8glib_rrd_AVR.h" -#if F_CPU >= 20000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(150) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(150) -#elif MB(3DRAG, K8200, K8400) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(188) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(MINIRAMBO, EINSY_RAMBO, EINSY_RETRO, SILVER_GATE) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(250) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(RAMBO) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(0) -#elif MB(BQ_ZUM_MEGA_3D) - #define CPU_ST7920_DELAY_1 DELAY_NS(0) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(189) -#elif defined(ARDUINO_ARCH_STM32) - #define CPU_ST7920_DELAY_1 DELAY_NS(300) - #define CPU_ST7920_DELAY_2 DELAY_NS(40) - #define CPU_ST7920_DELAY_3 DELAY_NS(340) -#elif F_CPU == 16000000 - #define CPU_ST7920_DELAY_1 DELAY_NS(125) - #define CPU_ST7920_DELAY_2 DELAY_NS(0) - #define CPU_ST7920_DELAY_3 DELAY_NS(188) -#else - #error "No valid condition for delays in 'ultralcd_st7920_u8glib_rrd_AVR.h'" -#endif - -#ifndef ST7920_DELAY_1 - #ifdef BOARD_ST7920_DELAY_1 - #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 - #else - #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 - #endif -#endif -#ifndef ST7920_DELAY_2 - #ifdef BOARD_ST7920_DELAY_2 - #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 - #else - #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 - #endif -#endif -#ifndef ST7920_DELAY_3 - #ifdef BOARD_ST7920_DELAY_3 - #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 - #else - #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 - #endif -#endif - // Optimize this code with -O3 #pragma GCC optimize (3) diff --git a/Marlin/src/pins/esp32/pins_MRR_ESPE.h b/Marlin/src/pins/esp32/pins_MRR_ESPE.h index f156efd2e8..8b4ec8b197 100644 --- a/Marlin/src/pins/esp32/pins_MRR_ESPE.h +++ b/Marlin/src/pins/esp32/pins_MRR_ESPE.h @@ -122,7 +122,7 @@ // LCDs and Controllers // ////////////////////////// -#if HAS_MARLINUI_U8GLIB +#if HAS_WIRED_LCD #define LCD_PINS_RS 13 #define LCD_PINS_ENABLE 17 diff --git a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h index c01afccaca..b74870b30f 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_1.h @@ -63,7 +63,6 @@ * ------ ------ * EXP2 EXP1 */ - #define EXP1_03_PIN -1 #define EXP1_04_PIN -1 #define EXP1_05_PIN -1 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 1ce6aed700..56944273e3 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h @@ -184,16 +184,15 @@ #endif /** - * ------ ------ - * NC | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | 1.31 (SD_DETECT) (LCD_D7) 1.23 | 3 4 | 1.22 (LCD_D6) - * (MOSI) 0.18 | 5 6 3.25 (BTN_EN2) (LCD_D5) 1.21 | 5 6 1.20 (LCD_D4) - * (SD_SS) 0.16 | 7 8 | 3.26 (BTN_EN1) (LCD_RS) 1.19 | 7 8 | 1.18 (LCD_EN) - * (SCK) 0.15 | 9 10 | 0.17 (MISO) (BTN_ENC) 0.28 | 9 10 | 1.30 (BEEPER) - * ------ ------ - * EXP2 EXP1 + * ------ ------ + * (BEEPER) 1.30 |10 9 | 0.28 (BTN_ENC) (MISO) 0.17 |10 9 | 0.15 (SCK) + * (LCD_EN) 1.18 | 8 7 | 1.19 (LCD_RS) (BTN_EN1) 3.26 | 8 7 | 0.16 (SD_SS) + * (LCD_D4) 1.20 6 5 | 1.21 (LCD_D5) (BTN_EN2) 3.25 6 5 | 0.18 (MOSI) + * (LCD_D6) 1.22 | 4 3 | 1.23 (LCD_D7) (SD_DETECT) 1.31 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ - #define EXP1_03_PIN P1_23 #define EXP1_04_PIN P1_22 #define EXP1_05_PIN P1_21 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 ae6456a3ce..58f2ac2808 100644 --- a/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h +++ b/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h @@ -239,16 +239,15 @@ #define TMC_BAUD_RATE 19200 #endif -/** ------ ------ - * NC | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | 1.31 1.23 | 3 4 | 1.22 - * 0.18 | 5 6 3.25 1.21 | 5 6 1.20 - * 0.16 | 7 8 | 3.26 1.19 | 7 8 | 1.18 - * 0.15 | 9 10| 0.17 0.28 | 9 10| 1.30 - * ------ ------ - * EXP2 EXP1 +/** ------ ------ + * 1.30 |10 9 | 0.28 0.17 |10 9 | 0.15 + * 1.18 | 8 7 | 1.19 3.26 | 8 7 | 0.16 + * 1.20 6 5 | 1.21 3.25 6 5 | 0.18 + * 1.22 | 4 3 | 1.23 1.31 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ - #define EXP1_03_PIN P1_23 #define EXP1_04_PIN P1_22 #define EXP1_05_PIN P1_21 @@ -258,7 +257,7 @@ #define EXP1_09_PIN P0_28 #define EXP1_10_PIN P1_30 -#define EXP2_03_PIN -1 +#define EXP2_03_PIN -1 // RESET #define EXP2_04_PIN P1_31 #define EXP2_05_PIN P0_18 #define EXP2_06_PIN P3_25 diff --git a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h index 49dad8b07b..fe2a71ae03 100644 --- a/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h +++ b/Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h @@ -237,7 +237,6 @@ * ------ ------ * EXP1 EXP2 */ - #define EXP1_03_PIN P1_22 #define EXP1_04_PIN P1_00 #define EXP1_05_PIN P0_17 diff --git a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h index c2d2621bc1..af7b7d7e58 100644 --- a/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h +++ b/Marlin/src/pins/lpc1769/pins_BTT_SKR_E3_TURBO.h @@ -188,7 +188,6 @@ * ------ * EXP */ - #define EXP1_03_PIN P0_18 #define EXP1_04_PIN P0_17 #define EXP1_05_PIN P0_15 diff --git a/Marlin/src/pins/mega/pins_OVERLORD.h b/Marlin/src/pins/mega/pins_OVERLORD.h index 161820b67a..0884d8ecb5 100644 --- a/Marlin/src/pins/mega/pins_OVERLORD.h +++ b/Marlin/src/pins/mega/pins_OVERLORD.h @@ -119,7 +119,7 @@ // // LCD / Controller // -#if HAS_MARLINUI_U8GLIB +#if HAS_WIRED_LCD // OVERLORD OLED pins #define LCD_PINS_RS 20 #define LCD_PINS_D5 21 diff --git a/Marlin/src/pins/mega/pins_SILVER_GATE.h b/Marlin/src/pins/mega/pins_SILVER_GATE.h index 41cbe5e0e0..0828b32aa9 100644 --- a/Marlin/src/pins/mega/pins_SILVER_GATE.h +++ b/Marlin/src/pins/mega/pins_SILVER_GATE.h @@ -72,7 +72,7 @@ #define HEATER_BED_PIN 8 #define TEMP_BED_PIN 6 -#if HAS_MARLINUI_U8GLIB +#if HAS_WIRED_LCD #if ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 #define LCD_PINS_RS 30 #define LCD_PINS_ENABLE 20 @@ -86,6 +86,9 @@ #define KILL_PIN 21 #define HOME_PIN 28 #endif + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(250) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) #endif #endif diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index fc82e600df..aa2bc07908 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -1221,23 +1221,47 @@ // // Default DOGLCD SPI delays // -#if HAS_MARLINUI_U8GLIB - #if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1) - #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 +#if ENABLED(U8GLIB_ST7920) + #ifndef ST7920_DELAY_1 + #ifdef LCD_ST7920_DELAY_1 + #define ST7920_DELAY_1 LCD_ST7920_DELAY_1 + #elif defined(BOARD_ST7920_DELAY_1) + #define ST7920_DELAY_1 BOARD_ST7920_DELAY_1 + #elif defined(CPU_ST7920_DELAY_1) + #define ST7920_DELAY_1 CPU_ST7920_DELAY_1 + #endif #endif - #if !defined(ST7920_DELAY_2) && defined(BOARD_ST7920_DELAY_2) - #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 + #ifndef ST7920_DELAY_2 + #ifdef LCD_ST7920_DELAY_2 + #define ST7920_DELAY_2 LCD_ST7920_DELAY_2 + #elif defined(BOARD_ST7920_DELAY_2) + #define ST7920_DELAY_2 BOARD_ST7920_DELAY_2 + #elif defined(CPU_ST7920_DELAY_2) + #define ST7920_DELAY_2 CPU_ST7920_DELAY_2 + #endif #endif - #if !defined(ST7920_DELAY_3) && defined(BOARD_ST7920_DELAY_3) - #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 + #ifndef ST7920_DELAY_3 + #ifdef LCD_ST7920_DELAY_3 + #define ST7920_DELAY_3 LCD_ST7920_DELAY_3 + #elif defined(BOARD_ST7920_DELAY_3) + #define ST7920_DELAY_3 BOARD_ST7920_DELAY_3 + #elif defined(CPU_ST7920_DELAY_3) + #define ST7920_DELAY_3 CPU_ST7920_DELAY_3 + #endif #endif #else #undef ST7920_DELAY_1 #undef ST7920_DELAY_2 #undef ST7920_DELAY_3 + #undef LCD_ST7920_DELAY_1 + #undef LCD_ST7920_DELAY_2 + #undef LCD_ST7920_DELAY_3 #undef BOARD_ST7920_DELAY_1 #undef BOARD_ST7920_DELAY_2 #undef BOARD_ST7920_DELAY_3 + #undef CPU_ST7920_DELAY_1 + #undef CPU_ST7920_DELAY_2 + #undef CPU_ST7920_DELAY_3 #endif #if !NEED_CASE_LIGHT_PIN diff --git a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h index 78465dd7a8..dbb34f6585 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RAMBO.h @@ -205,4 +205,10 @@ #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_WIRED_LCD +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(250) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) +#endif + #undef MK3_FAN_PINS diff --git a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h index 0c072745d5..5d8ffc07aa 100644 --- a/Marlin/src/pins/rambo/pins_EINSY_RETRO.h +++ b/Marlin/src/pins/rambo/pins_EINSY_RETRO.h @@ -199,3 +199,10 @@ #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL || TOUCH_UI_FTDI_EVE + +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(250) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) +#endif diff --git a/Marlin/src/pins/rambo/pins_MINIRAMBO.h b/Marlin/src/pins/rambo/pins_MINIRAMBO.h index ec44cc3b36..6257550697 100644 --- a/Marlin/src/pins/rambo/pins_MINIRAMBO.h +++ b/Marlin/src/pins/rambo/pins_MINIRAMBO.h @@ -69,7 +69,7 @@ #define E0_DIR_PIN 43 #define E0_ENABLE_PIN 26 -// Microstepping pins - Mapping not from fastio.h (?) +// Microstepping pins #define X_MS1_PIN 40 #define X_MS2_PIN 41 #define Y_MS1_PIN 69 @@ -192,3 +192,9 @@ #endif // IS_ULTIPANEL || TOUCH_UI_ULTIPANEL #endif // HAS_WIRED_LCD || TOUCH_UI_ULTIPANEL + +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(250) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) +#endif diff --git a/Marlin/src/pins/rambo/pins_RAMBO.h b/Marlin/src/pins/rambo/pins_RAMBO.h index f2d34dc00d..a77cb3d93f 100644 --- a/Marlin/src/pins/rambo/pins_RAMBO.h +++ b/Marlin/src/pins/rambo/pins_RAMBO.h @@ -268,3 +268,10 @@ #endif // !IS_NEWPANEL #endif // HAS_WIRED_LCD + +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(0) + #define BOARD_ST7920_DELAY_3 DELAY_NS(0) +#endif diff --git a/Marlin/src/pins/ramps/pins_3DRAG.h b/Marlin/src/pins/ramps/pins_3DRAG.h index e78f7683f6..3f38ecb211 100644 --- a/Marlin/src/pins/ramps/pins_3DRAG.h +++ b/Marlin/src/pins/ramps/pins_3DRAG.h @@ -80,6 +80,7 @@ #if IS_ULTRA_LCD && IS_NEWPANEL #undef BEEPER_PIN + // TODO: Remap EXP1/2 based on adapter #undef LCD_PINS_RS #undef LCD_PINS_ENABLE #undef LCD_PINS_D4 @@ -107,6 +108,12 @@ #endif // IS_ULTRA_LCD && IS_NEWPANEL +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(188) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) +#endif + /** * M3/M4/M5 - Spindle/Laser Control * diff --git a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h index 97ef1b4fd8..4d7a792635 100644 --- a/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h +++ b/Marlin/src/pins/ramps/pins_BAM_DICE_DUE.h @@ -38,12 +38,10 @@ #define SPINDLE_DIR_PIN 67 #define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM -#include "pins_RAMPS.h" - // // Temperature Sensors // -#undef TEMP_0_PIN -#undef TEMP_1_PIN #define TEMP_0_PIN 9 // Analog Input #define TEMP_1_PIN 11 // Analog Input + +#include "pins_RAMPS.h" 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 99cf484de7..5b3ed4c6a5 100644 --- a/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h +++ b/Marlin/src/pins/ramps/pins_BQ_ZUM_MEGA_3D.h @@ -123,3 +123,10 @@ #undef HEATER_BED_PIN #define HEATER_BED_PIN 8 #endif + +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_3 DELAY_NS(189) +#endif diff --git a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h index 8dc93c833b..4f25110ca2 100644 --- a/Marlin/src/pins/ramps/pins_DAGOMA_F5.h +++ b/Marlin/src/pins/ramps/pins_DAGOMA_F5.h @@ -39,10 +39,8 @@ #define FIL_RUNOUT2_PIN 14 #endif -// -// LCD delays -// -#if HAS_MARLINUI_U8GLIB +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) #define BOARD_ST7920_DELAY_1 DELAY_NS(0) #define BOARD_ST7920_DELAY_2 DELAY_NS(250) #define BOARD_ST7920_DELAY_3 DELAY_NS(250) diff --git a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h index 5f645e5d95..0398d36f93 100644 --- a/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h +++ b/Marlin/src/pins/ramps/pins_FORMBOT_TREX2PLUS.h @@ -198,14 +198,9 @@ #define LCD_PINS_D7 29 #endif -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(200) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(200) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(200) - #endif +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(200) + #define BOARD_ST7920_DELAY_2 DELAY_NS(200) + #define BOARD_ST7920_DELAY_3 DELAY_NS(200) #endif diff --git a/Marlin/src/pins/ramps/pins_K8600.h b/Marlin/src/pins/ramps/pins_K8600.h index 47b52e75e8..9049308ba8 100644 --- a/Marlin/src/pins/ramps/pins_K8600.h +++ b/Marlin/src/pins/ramps/pins_K8600.h @@ -60,30 +60,9 @@ // // Steppers // -#undef X_STEP_PIN -#undef X_DIR_PIN -#undef X_ENABLE_PIN -#define X_STEP_PIN 54 -#define X_DIR_PIN 55 -#define X_ENABLE_PIN 38 - -#undef Y_STEP_PIN -#undef Y_DIR_PIN -#undef Y_ENABLE_PIN -#define Y_STEP_PIN 60 -#define Y_DIR_PIN 61 -#define Y_ENABLE_PIN 56 - #undef Z_ENABLE_PIN #define Z_ENABLE_PIN 63 -#undef E0_STEP_PIN -#undef E0_DIR_PIN -#undef E0_ENABLE_PIN -#define E0_STEP_PIN 26 -#define E0_DIR_PIN 28 -#define E0_ENABLE_PIN 24 - // // Heaters / Fans // diff --git a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h index 08dd0f44bd..4742ac9b0d 100644 --- a/Marlin/src/pins/ramps/pins_MKS_GEN_13.h +++ b/Marlin/src/pins/ramps/pins_MKS_GEN_13.h @@ -54,6 +54,9 @@ #include "pins_RAMPS.h" +#undef EXP2_03_PIN +#define EXP2_03_PIN -1 // RESET + // // LCD / Controller // @@ -81,19 +84,21 @@ * * This configuration uses the following arrangement: * - * EXP1 D37 = EN2 D35 = EN1 EXP2 D50 = MISO D52 = SCK - * D17 = BLUE D16 = RED D31 = ENC D53 = SDCS - * D23 = KILL D25 = BUZZ D33 = --- D51 = MOSI - * D27 = A0 D29 = LCS D49 = SDCD RST = --- - * GND = GND 5V = 5V GND = --- D41 = --- + * ------ ------ + * ENCB |10 9 | ENCA MISO |10 9 | SCK + * BLUE_LED | 8 7 | RED_LED ENCBTN | 8 7 | SDCS + * KILL 6 5 | BEEPER 6 5 | MOSI + * A0 | 4 3 | LCD_CS SDCD | 4 3 | + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ - + #undef SD_DETECT_PIN #undef BTN_EN1 #undef BTN_EN2 #undef BTN_ENC #undef DOGLCD_A0 #undef DOGLCD_CS - #undef SD_DETECT_PIN #undef BEEPER_PIN #undef KILL_PIN #undef STAT_LED_RED_PIN @@ -102,46 +107,24 @@ // // VIKI2 12-wire lead // + #define SD_DETECT_PIN EXP2_04_PIN // SDCD orange/white + #define BTN_EN1 EXP1_09_PIN // ENCA white + #define BTN_EN2 EXP1_10_PIN // ENCB green + #define BTN_ENC EXP2_08_PIN // ENCBTN purple + #define DOGLCD_A0 EXP1_04_PIN // A0 brown + #define DOGLCD_CS EXP1_03_PIN // LCS green/white - // orange/white SDCD - #define SD_DETECT_PIN 49 - - // white ENCA - #define BTN_EN1 35 - - // green ENCB - #define BTN_EN2 37 - - // purple ENCBTN - #define BTN_ENC 31 - - // brown A0 - #define DOGLCD_A0 27 + // EXP2_10_PIN gray MISO + // EXP2_05_PIN yellow MOSI + // EXP2_09_PIN orange SCK - // green/white LCS - #define DOGLCD_CS 29 - - // 50 gray MISO - // 51 yellow MOSI - // 52 orange SCK - - // blue SDCS - //#define SDSS 53 + //#define SDSS EXP2_07_PIN // SDCS blue // // VIKI2 4-wire lead // - - // blue BTN - #define KILL_PIN 23 - - // green BUZZER - #define BEEPER_PIN 25 - - // yellow RED-LED - #define STAT_LED_RED_PIN 16 - - // white BLUE-LED - #define STAT_LED_BLUE_PIN 17 - + #define KILL_PIN EXP1_06_PIN // BTN blue + #define BEEPER_PIN EXP1_05_PIN // BUZZER green + #define STAT_LED_RED_PIN EXP1_07_PIN // RED-LED yellow + #define STAT_LED_BLUE_PIN EXP1_08_PIN // BLUE-LED white #endif diff --git a/Marlin/src/pins/ramps/pins_RAMPS.h b/Marlin/src/pins/ramps/pins_RAMPS.h index 1683ccf5c8..b51d212f4f 100644 --- a/Marlin/src/pins/ramps/pins_RAMPS.h +++ b/Marlin/src/pins/ramps/pins_RAMPS.h @@ -120,14 +120,14 @@ #define X_DIR_PIN 55 #define X_ENABLE_PIN 38 #ifndef X_CS_PIN - #define X_CS_PIN EXP2_07_PIN + #define X_CS_PIN AUX3_03_PIN #endif #define Y_STEP_PIN 60 #define Y_DIR_PIN 61 #define Y_ENABLE_PIN 56 #ifndef Y_CS_PIN - #define Y_CS_PIN EXP2_04_PIN + #define Y_CS_PIN AUX3_07_PIN #endif #ifndef Z_STEP_PIN @@ -242,7 +242,7 @@ // Misc. Functions // #ifndef SDSS - #define SDSS EXP2_07_PIN + #define SDSS AUX3_03_PIN #endif #define LED_PIN 13 @@ -424,58 +424,79 @@ #endif // -// Aux 3 GND D52 D50 5V -// NC D53 D51 D49 +// AUX3 : GND D52 D50 5V +// NC D53 D51 D49 + +#define AUX3_03_PIN 53 +#define AUX3_04_PIN 52 +#define AUX3_05_PIN 51 +#define AUX3_06_PIN 50 +#define AUX3_07_PIN 49 // -// Aux 4 D16 D17 D23 D25 D27 D29 D31 D33 D35 D37 D39 D41 D43 D45 D47 D32 GND 5V +// AUX4 : D16 D17 D23 D25 D27 D29 D31 D33 D35 D37 D39 D41 D43 D45 D47 D32 GND 5V // +#define AUX4_03_PIN 32 +#define AUX4_04_PIN 47 +#define AUX4_05_PIN 45 +#define AUX4_06_PIN 43 +#define AUX4_07_PIN 41 +#define AUX4_08_PIN 39 +#define AUX4_09_PIN 37 +#define AUX4_10_PIN 35 +#define AUX4_11_PIN 33 +#define AUX4_12_PIN 31 +#define AUX4_13_PIN 29 +#define AUX4_14_PIN 27 +#define AUX4_15_PIN 25 +#define AUX4_16_PIN 23 +#define AUX4_17_PIN 17 +#define AUX4_18_PIN 16 + /** - * LCD adapter. Please note: These comes in two variants. The socket keys can be + * LCD adapter. NOTE: These come in two variants. The socket keys can be * on either side, and may be backwards on some boards / displays. - * ----- ----- - * D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK) - * D17 | 8 7 | D16 D31 | 8 7 | D53 - * D23 6 5 D25 D33 6 5 D51 (MOSI) - * D27 | 4 3 | D29 D49 | 4 3 | D41 - * GND | 2 1 | 5V GND | 2 1 | NC - * ----- ----- - * EXP1 EXP2 + * ------ ------ + * D37 |10 9 | D35 (MISO) D50 |10 9 | D52 (SCK) + * D17 | 8 7 | D16 D31 | 8 7 | D53 + * D23 6 5 D25 D33 6 5 D51 (MOSI) + * D27 | 4 3 | D29 D49 | 4 3 | D41 + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ - #ifndef EXP1_03_PIN - #define EXP1_03_PIN 29 - #define EXP1_04_PIN 27 - #define EXP1_05_PIN 25 - #define EXP1_06_PIN 23 - #define EXP1_07_PIN 16 - #define EXP1_08_PIN 17 - #define EXP1_09_PIN 35 - #define EXP1_10_PIN 37 - - #define EXP2_03_PIN 41 - #define EXP2_04_PIN 49 - #define EXP2_05_PIN 51 - #define EXP2_06_PIN 33 - #define EXP2_07_PIN 53 - #define EXP2_08_PIN 31 - #define EXP2_09_PIN 52 - #define EXP2_10_PIN 50 + #define EXP1_03_PIN AUX4_13_PIN + #define EXP1_04_PIN AUX4_14_PIN + #define EXP1_05_PIN AUX4_15_PIN + #define EXP1_06_PIN AUX4_16_PIN + #define EXP1_07_PIN AUX4_18_PIN + #define EXP1_08_PIN AUX4_17_PIN + #define EXP1_09_PIN AUX4_10_PIN + #define EXP1_10_PIN AUX4_09_PIN + + #define EXP2_03_PIN AUX4_07_PIN + #define EXP2_04_PIN AUX3_07_PIN + #define EXP2_05_PIN AUX3_05_PIN + #define EXP2_06_PIN AUX4_11_PIN + #define EXP2_07_PIN AUX3_03_PIN + #define EXP2_08_PIN AUX4_12_PIN + #define EXP2_09_PIN AUX3_04_PIN + #define EXP2_10_PIN AUX3_06_PIN #endif ////////////////////////// // LCDs and Controllers // ////////////////////////// -// GLCD features -// Uncomment screen orientation -//#define LCD_SCREEN_ROT_90 -//#define LCD_SCREEN_ROT_180 -//#define LCD_SCREEN_ROT_270 - #if HAS_WIRED_LCD + // Uncomment screen orientation + //#define LCD_SCREEN_ROT_90 + //#define LCD_SCREEN_ROT_180 + //#define LCD_SCREEN_ROT_270 + // // LCD Display output pins // @@ -587,7 +608,7 @@ #endif #if ENABLED(BQ_LCD_SMART_CONTROLLER) - #define LCD_BACKLIGHT_PIN 39 + #define LCD_BACKLIGHT_PIN AUX4_08_PIN #endif #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) @@ -599,9 +620,9 @@ #elif ENABLED(LCD_I2C_PANELOLU2) - #define BTN_EN1 47 - #define BTN_EN2 43 - #define BTN_ENC 32 + #define BTN_EN1 AUX4_04_PIN + #define BTN_EN2 AUX4_06_PIN + #define BTN_ENC AUX4_03_PIN #define LCD_SDSS SDSS #define KILL_PIN EXP2_03_PIN @@ -725,13 +746,23 @@ // Pins only defined for RAMPS_SMART currently + #elif ENABLED(G3D_PANEL) + + #define BEEPER_PIN EXP2_06_PIN + + #define SD_DETECT_PIN EXP2_04_PIN + #define KILL_PIN EXP2_03_PIN + + #define BTN_EN1 EXP1_10_PIN + #define BTN_EN2 EXP1_09_PIN + #define BTN_ENC EXP2_08_PIN + #elif IS_TFTGLCD_PANEL #define SD_DETECT_PIN EXP2_04_PIN #else - // Beeper on AUX-4 #define BEEPER_PIN EXP2_06_PIN // Buttons are directly attached to AUX-2 @@ -745,11 +776,6 @@ #define BTN_ENC EXP2_08_PIN #endif - #if ENABLED(G3D_PANEL) - #define SD_DETECT_PIN EXP2_04_PIN - #define KILL_PIN EXP2_03_PIN - #endif - #endif #endif // IS_NEWPANEL diff --git a/Marlin/src/pins/sanguino/pins_MELZI.h b/Marlin/src/pins/sanguino/pins_MELZI.h index de4dd1b01d..8f2729f8f0 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI.h +++ b/Marlin/src/pins/sanguino/pins_MELZI.h @@ -31,4 +31,17 @@ #define IS_MELZI 1 +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(188) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) + #endif +#endif + #include "pins_SANGUINOLOLU_12.h" diff --git a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h index d4915c9cca..81ccf5977e 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h @@ -36,16 +36,10 @@ #define BOARD_INFO_NAME "Melzi (Creality)" // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif #include "pins_MELZI.h" @@ -137,11 +131,11 @@ /** * EXP1 Connector EXP1 as CR10 STOCKDISPLAY - * ----- ----- - * PA4 | 6 5 | PC0 BEEPER_PIN | 6 5 | BTN_ENC - * PD3 | 7 4 | RESET BTN_EN1 | 7 4 | RESET - * PD2 8 3 | PA1 BTN_EN2 8 3 | LCD_PINS_D4 (ST9720 CLK) - * PA3 | 9 2 | PC1 (ST9720 CS) LCD_PINS_RS | 9 2 | LCD_PINS_ENABLE (ST9720 DAT) - * GND |10 1 | 5V GND |10 1 | 5V - * ----- ----- + * ------ ------ + * PA4 |10 9 | PC0 BEEPER_PIN |10 9 | BTN_ENC + * PD3 | 8 7 | RESET BTN_EN1 | 8 7 | RESET + * PD2 6 5 | PA1 BTN_EN2 6 5 | LCD_PINS_D4 (ST9720 CLK) + * PA3 | 4 3 | PC1 (ST9720 CS) LCD_PINS_RS | 4 3 | LCD_PINS_ENABLE (ST9720 DAT) + * GND | 2 1 | 5V GND | 2 1 | 5V + * ------ ------ */ diff --git a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h index 8b4faeeaf9..3bf8f80457 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_MALYAN.h @@ -27,19 +27,6 @@ #define BOARD_INFO_NAME "Melzi (Malyan)" -// Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif -#endif - #include "pins_MELZI.h" #undef LCD_SDSS diff --git a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h index f878941037..e88a38561d 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_TRONXY.h @@ -27,16 +27,11 @@ #define BOARD_INFO_NAME "Melzi (Tronxy)" -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) - #endif +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) #endif #include "pins_MELZI.h" diff --git a/Marlin/src/pins/sanguino/pins_MELZI_V2.h b/Marlin/src/pins/sanguino/pins_MELZI_V2.h index e0369923c7..c1fb7fb6f7 100644 --- a/Marlin/src/pins/sanguino/pins_MELZI_V2.h +++ b/Marlin/src/pins/sanguino/pins_MELZI_V2.h @@ -24,16 +24,11 @@ #define BOARD_INFO_NAME "Melzi V2" -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(400) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) - #endif +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 0) + #define BOARD_ST7920_DELAY_2 DELAY_NS(400) + #define BOARD_ST7920_DELAY_3 DELAY_NS( 0) #endif #include "pins_MELZI.h" diff --git a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h index d79ad7a3dd..8dd6171b92 100644 --- a/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h +++ b/Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h @@ -165,16 +165,6 @@ #define KILL_PIN 10 #define BEEPER_PIN 27 - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(188) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) - #endif - #elif ENABLED(U8GLIB_ST7920) // SPI GLCD 12864 ST7920 ( like [www.digole.com] ) For Melzi V2.0 #if IS_MELZI @@ -185,19 +175,6 @@ // Marlin so this can be used for BEEPER_PIN. You can use this pin // with M42 instead of BEEPER_PIN. #define BEEPER_PIN 27 - - #if IS_RRD_FG_SC - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(0) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(188) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(0) - #endif - #endif - #else // Sanguinololu >=1.3 #define LCD_PINS_RS 4 #define LCD_PINS_ENABLE 17 diff --git a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h index 0265ae0a64..cb2dec1600 100644 --- a/Marlin/src/pins/sanguino/pins_ZMIB_V2.h +++ b/Marlin/src/pins/sanguino/pins_ZMIB_V2.h @@ -189,10 +189,9 @@ #endif #define LCD_PINS_D4 10 // ST7920_CLK_PIN LCD_PIN_ENABLE (PIN6 of LCD module) - // Alter timing for graphical display - #define ST7920_DELAY_1 DELAY_2_NOP - #define ST7920_DELAY_2 DELAY_2_NOP - #define ST7920_DELAY_3 DELAY_2_NOP + #define BOARD_ST7920_DELAY_1 DELAY_2_NOP + #define BOARD_ST7920_DELAY_2 DELAY_2_NOP + #define BOARD_ST7920_DELAY_3 DELAY_2_NOP #elif EITHER(ZONESTAR_12864OLED, ZONESTAR_12864OLED_SSD1306) // 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 441f9350e3..5d23466071 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 @@ -68,7 +68,7 @@ #define E0_DIR_PIN PB0 #define E0_ENABLE_PIN PC4 -#if ENABLED(TMC_USE_SW_SPI) +#if ENABLED(TMC_USE_SW_SPI) // Shared with EXP2 #ifndef TMC_SW_SCK #define TMC_SW_SCK PB3 #endif @@ -93,33 +93,48 @@ #define TEMP_BED_PIN PB1 // Analog Input #define TEMP_0_PIN PA0 // Analog Input -// -// LCD Pins -// - -/** - * ----- ----- - * NC | · · | GND 5V | · · | GND - * RESET | · · | PB9 (SD_DETECT) (LCD_D7) PC14 | · · | PC15 (LCD_D6) - * (MOSI) PB5 | · · | PB8 (BTN_EN2) (LCD_D5) PB7 | · · | PC13 (LCD_D4) - * (SD_SS) PA15 | · · | PD2 (BTN_EN1) (LCD_RS) PC12 | · · | PB6 (LCD_EN) - * (SCK) PB3 | · · | PB4 (MISO) (BTN_ENC) PC11 | · · | PC10 (BEEPER) - * ----- ----- - * EXP2 EXP1 +/** ------ ------ + * (BEEPER) PC10 |10 9 | PC11 (BTN_ENC) (MISO) PB4 |10 9 | PB3 (SCK) + * (LCD_EN) PB6 | 8 7 | PC12 (LCD_RS) (BTN_EN1) PD2 | 8 7 | PA15 (SD_SS) + * (LCD_D4) PC13 | 6 5 | PB7 (LCD_D5) (BTN_EN2) PB8 | 6 5 | PB5 (MOSI) + * (LCD_D6) PC15 | 4 3 | PC14 (LCD_D7) (SD_DETECT) PB9 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ +#define EXP1_03_PIN PC14 +#define EXP1_04_PIN PC15 +#define EXP1_05_PIN PB7 +#define EXP1_06_PIN PC13 +#define EXP1_07_PIN PC12 +#define EXP1_08_PIN PB6 +#define EXP1_09_PIN PC11 +#define EXP1_10_PIN PC10 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN PB9 +#define EXP2_05_PIN PB5 +#define EXP2_06_PIN PB8 +#define EXP2_07_PIN PA15 +#define EXP2_08_PIN PD2 +#define EXP2_09_PIN PB3 +#define EXP2_10_PIN PB4 +// +// LCD / Controller +// #if HAS_WIRED_LCD - #define BEEPER_PIN PC10 - #define BTN_ENC PC11 + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN #if ENABLED(CR10_STOCKDISPLAY) - #define LCD_PINS_RS PC15 + #define LCD_PINS_RS EXP1_04_PIN - #define BTN_EN1 PB6 - #define BTN_EN2 PC13 + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN - #define LCD_PINS_ENABLE PC14 - #define LCD_PINS_D4 PB7 + #define LCD_PINS_ENABLE EXP1_03_PIN + #define LCD_PINS_D4 EXP1_05_PIN #elif IS_TFTGLCD_PANEL @@ -127,56 +142,56 @@ #undef BTN_ENC #if ENABLED(TFTGLCD_PANEL_SPI) - #define TFTGLCD_CS PD2 + #define TFTGLCD_CS EXP2_08_PIN #endif - #define SD_DETECT_PIN PB9 + #define SD_DETECT_PIN EXP2_04_PIN #else - #define LCD_PINS_RS PC12 + #define LCD_PINS_RS EXP1_07_PIN - #define BTN_EN1 PD2 - #define BTN_EN2 PB8 + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN - #define LCD_PINS_ENABLE PB6 + #define LCD_PINS_ENABLE EXP1_08_PIN #if ENABLED(FYSETC_MINI_12864) #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PC13 - #define DOGLCD_A0 PC12 - #define DOGLCD_CS PB6 - #define DOGLCD_SCK PB3 - #define DOGLCD_MOSI PB5 + #define LCD_RESET_PIN EXP1_06_PIN + #define DOGLCD_A0 EXP1_07_PIN + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN #define FORCE_SOFT_SPI // SPI MODE3 - #define LED_PIN PB7 // red pwm - //#define LED_PIN PC15 // green - //#define LED_PIN PC14 // blue + #define LED_PIN EXP1_05_PIN // red pwm + //#define LED_PIN EXP1_04_PIN // green + //#define LED_PIN EXP1_03_PIN // blue //#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) // #ifndef RGB_LED_R_PIN - // #define RGB_LED_R_PIN PB7 + // #define RGB_LED_R_PIN EXP1_05_PIN // #endif // #ifndef RGB_LED_G_PIN - // #define RGB_LED_G_PIN PC15 + // #define RGB_LED_G_PIN EXP1_04_PIN // #endif // #ifndef RGB_LED_B_PIN - // #define RGB_LED_B_PIN PC14 + // #define RGB_LED_B_PIN EXP1_03_PIN // #endif //#elif ENABLED(FYSETC_MINI_12864_2_1) - // #define NEOPIXEL_PIN PB7 + // #define NEOPIXEL_PIN EXP1_05_PIN //#endif #else // !FYSETC_MINI_12864 - #define LCD_PINS_D4 PC13 + #define LCD_PINS_D4 EXP1_06_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 PB7 - #define LCD_PINS_D6 PC15 - #define LCD_PINS_D7 PC14 + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -186,16 +201,11 @@ #endif // !FYSETC_MINI_12864 - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif #endif @@ -214,11 +224,11 @@ #if SD_CONNECTION_IS(LCD) #define SPI_DEVICE 3 - #define SD_DETECT_PIN PB9 - #define SD_SCK_PIN PB3 - #define SD_MISO_PIN PB4 - #define SD_MOSI_PIN PB5 - #define SD_SS_PIN PA15 + #define SD_DETECT_PIN EXP2_04_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN + #define SD_SS_PIN EXP2_07_PIN #elif SD_CONNECTION_IS(ONBOARD) #define SD_DETECT_PIN PA3 #define SD_SCK_PIN PA5 diff --git a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h index c2edcd3678..2ce1d49bb8 100644 --- a/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h +++ b/Marlin/src/pins/stm32f1/pins_CCROBOT_MEEB_3DP.h @@ -122,41 +122,43 @@ #define NEOPIXEL_PIN PC7 // The NEOPIXEL LED driving pin /** - * 1 ----- 2 - * PB5 | · · | PB6 - * PA2 | · · | RESET - * PA3 | · · | PB8 - * PB7 | · · | PA4 - * GND | · · | VCC5 - * 9 ----- 10 - * LCD EXP + * ------ + * PB5 |10 9 | PB6 + * PA2 | 8 7 | RESET + * PA3 6 5 | PB8 + * PB7 | 4 3 | PA4 + * GND | 2 1 | VCC5 + * ------ + * EXP1 */ +#define EXP1_03_PIN PA4 +#define EXP1_04_PIN PB7 +#define EXP1_05_PIN PB8 +#define EXP1_06_PIN PA3 +#define EXP1_07_PIN -1 // RESET +#define EXP1_08_PIN PA2 +#define EXP1_09_PIN PB6 +#define EXP1_10_PIN PB5 // // LCD / Controller // #if ENABLED(CR10_STOCKDISPLAY) - #define BEEPER_PIN PB5 - #define BTN_EN1 PA2 - #define BTN_EN2 PA3 - #define BTN_ENC PB6 - - #define LCD_PINS_RS PB7 // CS -- SOFT SPI for ENDER3 LCD - #define LCD_PINS_D4 PB8 // SCLK - #define LCD_PINS_ENABLE PA4 // DATA MOSI + #define BEEPER_PIN EXP1_10_PIN + #define BTN_EN1 EXP1_08_PIN + #define BTN_EN2 EXP1_06_PIN + #define BTN_ENC EXP1_09_PIN + + #define LCD_PINS_RS EXP1_04_PIN // CS -- SOFT SPI for ENDER3 LCD + #define LCD_PINS_D4 EXP1_05_PIN // SCLK + #define LCD_PINS_ENABLE EXP1_03_PIN // DATA MOSI #endif // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif // diff --git a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h index 08efa9a04e..7d0e15f57a 100644 --- a/Marlin/src/pins/stm32f1/pins_FLY_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_FLY_MINI.h @@ -83,13 +83,13 @@ #if ENABLED(TMC_USE_SW_SPI) #ifndef TMC_SW_MOSI - #define TMC_SW_MOSI PB15 + #define TMC_SW_MOSI EXP2_05_PIN #endif #ifndef TMC_SW_MISO - #define TMC_SW_MISO PB14 + #define TMC_SW_MISO EXP2_10_PIN #endif #ifndef TMC_SW_SCK - #define TMC_SW_SCK PB13 + #define TMC_SW_SCK EXP2_09_PIN #endif #endif @@ -120,52 +120,69 @@ #define TEMP_BED_PIN PC0 // Analog Input #define TEMP_0_PIN PC1 // Analog Input -// -// LCD Pins -// +/** ------ ------ + * (BEEPER) PC14 |10 9 | PC13 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SD_SCK) + * (LCD_EN) PB9 | 8 7 | PB8 (LCD_RS) (BTN_EN1) PB3 | 8 7 | PB12 (SD_CS2) + * (LCD_D4) PB7 | 6 5 PB6 (LCD_D5) (BTN_EN2) PD2 | 6 5 PB15 (SD_MOSI) + * (LCD_D6) PB5 | 4 3 | PB4 (LCD_D7) (SD_DETECT) PB11 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 + */ +#define EXP1_03_PIN PB4 +#define EXP1_04_PIN PB5 +#define EXP1_05_PIN PB6 +#define EXP1_06_PIN PB7 +#define EXP1_07_PIN PB8 +#define EXP1_08_PIN PB9 +#define EXP1_09_PIN PC13 +#define EXP1_10_PIN PC14 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN PB11 +#define EXP2_05_PIN PB15 +#define EXP2_06_PIN PD2 +#define EXP2_07_PIN PB12 +#define EXP2_08_PIN PB3 +#define EXP2_09_PIN PB13 +#define EXP2_10_PIN PB14 // // LCD / Controller // -#define SPI_DEVICE 2 -#define SD_SS_PIN PB12 -#define SD_SCK_PIN PB13 -#define SD_MISO_PIN PB14 -#define SD_MOSI_PIN PB15 - -#define SDSS SD_SS_PIN -#define SD_DETECT_PIN PB11 - -#define BEEPER_PIN PC14 - -#define LCD_PINS_RS PB8 -#define LCD_PINS_ENABLE PB9 -#define LCD_PINS_D4 PB7 -#define LCD_PINS_D5 PB6 -#define LCD_PINS_D6 PB5 -#define LCD_PINS_D7 PB4 - -#define BTN_EN1 PD2 -#define BTN_EN2 PB3 -#define BTN_ENC PC13 - -#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) - #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder -#endif +#if HAS_WIRED_LCD -// -// Filament runout -// + #define SPI_DEVICE 2 + #define SD_SS_PIN EXP2_07_PIN + #define SD_SCK_PIN EXP2_09_PIN + #define SD_MISO_PIN EXP2_10_PIN + #define SD_MOSI_PIN EXP2_05_PIN -// -// ST7920 Delays -// -#ifndef ST7920_DELAY_1 - #define ST7920_DELAY_1 DELAY_NS(96) -#endif -#ifndef ST7920_DELAY_2 - #define ST7920_DELAY_2 DELAY_NS(48) -#endif -#ifndef ST7920_DELAY_3 - #define ST7920_DELAY_3 DELAY_NS(715) -#endif + #define SDSS SD_SS_PIN + #define SD_DETECT_PIN EXP2_04_PIN + + #define BEEPER_PIN EXP1_10_PIN + + #define LCD_PINS_RS EXP1_07_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_D4 EXP1_06_PIN + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN + + #define BTN_EN1 EXP2_06_PIN + #define BTN_EN2 EXP2_08_PIN + #define BTN_ENC EXP1_09_PIN + + #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) + #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder + #endif + + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) + #endif + +#endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h index 4edd67a14d..797e13fd07 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI.h @@ -157,16 +157,11 @@ //#define LCD_UART_RX PD9 #endif - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h index f346c3a9fd..64b1c6c040 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_MINI_A30.h @@ -165,16 +165,11 @@ //#define LCD_UART_RX PD9 #endif - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h index 2545642bae..992fc36f92 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_PRO_VB.h @@ -162,16 +162,11 @@ //#define LCD_UART_RX PD9 #endif - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h index 865de809e2..d33ce461fe 100644 --- a/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h +++ b/Marlin/src/pins/stm32f1/pins_GTM32_REV_B.h @@ -167,16 +167,11 @@ //#define LCD_UART_RX PD9 #endif - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index 2cfb71380d..4db596a1bc 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -342,15 +342,9 @@ #endif - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif // !MKS_MINI_12864 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 a07cfe0120..d6a4bb92dc 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -133,52 +133,82 @@ #endif /** - * ----- ----- ----- - * (BEEPER) PC1 | 1 2 | PC3 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SD_SCK) 5V | 1 2 | GND - * (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) (BTN_EN1) PB11 | 3 4 | PA15 (SD_SS) (LCD_EN) PA4 | 3 4 | PA5 (LCD_RS) - * (LCD_D4) PA6 | 5 6 PA7 (LCD_D5) (BTN_EN2) PB0 | 5 6 PB15 (SD_MOSI) (LCD_D4) PA6 | 5 6 PB0 (BTN_EN2) - * (LCD_D6) PC4 | 7 8 | PC5 (LCD_D7) (SD_DETECT) PC10 | 7 8 | RESET RESET | 7 8 | PB11 (BTN_EN1) - * GND | 9 10| 5V GND | 9 10| NC (BTN_ENC) PC3 | 9 10| PC1 (BEEPER) - * ----- ----- ----- - * EXP1 EXP2 EXP3 + * ------ ------ ------ + * (BEEPER) PC1 |10 9 | PC3 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SD_SCK) (BEEPER) PC1 |10 9 | PC3 (BTN_ENC) + * (LCD_EN) PA4 | 8 7 | PA5 (LCD_RS) (BTN_EN1) PB11 | 8 7 | PA15 (SD_SS) (BTN_EN1) PB11 | 8 7 | RESET + * (LCD_D4) PA6 6 5 | PA7 (LCD_D5) (BTN_EN2) PB0 6 5 | PB15 (SD_MOSI) (BTN_EN2) PB0 6 5 | PA6 (LCD_D4) + * (LCD_D6) PC4 | 4 3 | PC5 (LCD_D7) (SD_DETECT) PC10 | 4 3 | RESET (LCD_RS) PA5 | 4 3 | PA4 (LCD_EN) + * GND | 2 1 | 5V GND | 2 1 | NC GND | 2 1 | 5V + * ------ ------ ------ + * EXP1 EXP2 "Ender-3 EXP1" */ +#define EXP1_03_PIN PC5 +#define EXP1_04_PIN PC4 +#define EXP1_05_PIN PA7 +#define EXP1_06_PIN PA6 +#define EXP1_07_PIN PA5 +#define EXP1_08_PIN PA4 +#define EXP1_09_PIN PC3 +#define EXP1_10_PIN PC1 + +#define EXP2_03_PIN -1 // RESET +#define EXP2_04_PIN PC10 +#define EXP2_05_PIN PB15 +#define EXP2_06_PIN PB0 +#define EXP2_07_PIN PA15 +#define EXP2_08_PIN PB11 +#define EXP2_09_PIN PB13 +#define EXP2_10_PIN PB14 + +// "Ender-3 EXP1" +#define E3_EXP1_03_PIN PA4 +#define E3_EXP1_04_PIN PA5 +#define E3_EXP1_05_PIN PA6 +#define E3_EXP1_06_PIN PB0 +#define E3_EXP1_07_PIN -1 // RESET +#define E3_EXP1_08_PIN PB11 +#define E3_EXP1_09_PIN PC3 +#define E3_EXP1_10_PIN PC1 + #if HAS_WIRED_LCD - #define BEEPER_PIN PC1 - #define BTN_ENC PC3 - #define LCD_PINS_ENABLE PA4 - #define LCD_PINS_RS PA5 - #define BTN_EN1 PB11 - #define BTN_EN2 PB0 + #define BEEPER_PIN EXP1_10_PIN + #define BTN_ENC EXP1_09_PIN + #define LCD_PINS_ENABLE EXP1_08_PIN + #define LCD_PINS_RS EXP1_07_PIN + #define BTN_EN1 EXP2_08_PIN + #define BTN_EN2 EXP2_06_PIN // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor) #if ENABLED(MKS_MINI_12864) #define LCD_BACKLIGHT_PIN -1 #define LCD_RESET_PIN -1 - #define DOGLCD_A0 PC4 - #define DOGLCD_CS PA7 - #define DOGLCD_SCK PB13 - #define DOGLCD_MOSI PB15 + #define DOGLCD_A0 EXP1_04_PIN + #define DOGLCD_CS EXP1_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #define DOGLCD_MOSI EXP2_05_PIN #elif ENABLED(MKS_MINI_12864_V3) - #define ENABLE_SPI3 - #define DOGLCD_CS PA4 - #define DOGLCD_A0 PA5 + #define DOGLCD_CS EXP1_08_PIN + #define DOGLCD_A0 EXP1_07_PIN #define LCD_PINS_DC DOGLCD_A0 #define LCD_BACKLIGHT_PIN -1 - #define LCD_RESET_PIN PA6 - #define NEOPIXEL_PIN PA7 - #define DOGLCD_MOSI PB15 - #define DOGLCD_SCK PB13 + #define LCD_RESET_PIN EXP1_06_PIN + #define NEOPIXEL_PIN EXP1_05_PIN + #define DOGLCD_MOSI EXP2_05_PIN + #define DOGLCD_SCK EXP2_09_PIN + #define FORCE_SOFT_SPI + #define SOFTWARE_SPI + //#define LCD_SCREEN_ROT_180 #else - #define LCD_PINS_D4 PA6 + #define LCD_PINS_D4 EXP1_06_PIN #if IS_ULTIPANEL - #define LCD_PINS_D5 PA7 - #define LCD_PINS_D6 PC4 - #define LCD_PINS_D7 PC5 + #define LCD_PINS_D5 EXP1_05_PIN + #define LCD_PINS_D6 EXP1_04_PIN + #define LCD_PINS_D7 EXP1_03_PIN #if !defined(BTN_ENC_EN) && ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder @@ -190,30 +220,33 @@ #endif // HAS_WIRED_LCD +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #ifndef BOARD_ST7920_DELAY_1 + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_2 + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #endif + #ifndef BOARD_ST7920_DELAY_3 + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) + #endif +#endif + // // SD Card // +#define SDCARD_CONNECTION ONBOARD #define SPI_DEVICE 2 #define ONBOARD_SPI_DEVICE 2 #define SDSS SD_SS_PIN -#define SDCARD_CONNECTION ONBOARD -#define SD_DETECT_PIN PC10 #define ONBOARD_SD_CS_PIN SD_SS_PIN +#define SD_DETECT_PIN PC10 // EXP2_04_PIN #define NO_SD_HOST_DRIVE // TODO: This is the only way to set SPI for SD on STM32 (for now) #define ENABLE_SPI2 -#define SD_SCK_PIN PB13 -#define SD_MISO_PIN PB14 -#define SD_MOSI_PIN PB15 -#define SD_SS_PIN PA15 - -#ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) -#endif -#ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) -#endif -#ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) -#endif +#define SD_SCK_PIN EXP2_09_PIN +#define SD_MISO_PIN EXP2_10_PIN +#define SD_MOSI_PIN EXP2_05_PIN +#define SD_SS_PIN EXP2_07_PIN diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h index 73c77d092a..6373d70e38 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_LITE.h @@ -112,16 +112,11 @@ #endif // !MKS_MINI_12864 - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif + // Alter timing for graphical display + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif #endif // HAS_WIRED_LCD 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 0c59c6d7ea..a105b1f67f 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -378,13 +378,9 @@ #endif - #ifndef BOARD_ST7920_DELAY_1 + #if ENABLED(U8GLIB_ST7920) #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h index 6e19b441c6..8f03a3678f 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h @@ -299,16 +299,11 @@ #endif -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(125) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(125) - #endif +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_2 DELAY_NS(125) + #define BOARD_ST7920_DELAY_3 DELAY_NS(125) #endif #define HAS_SPI_FLASH 1 diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h index 3674f10ce7..a7a1dacd5b 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V1_0.h @@ -331,7 +331,8 @@ #define ADC_KEYPAD_PIN PC0 // PIN6 of AUX1 #endif -#if HAS_MARLINUI_U8GLIB +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) #define BOARD_ST7920_DELAY_1 DELAY_NS(125) #define BOARD_ST7920_DELAY_2 DELAY_NS(250) #define BOARD_ST7920_DELAY_3 DELAY_NS(125) diff --git a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h index 017195edee..ba6bf8aa7b 100644 --- a/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h +++ b/Marlin/src/pins/stm32f1/pins_ZM3E4_V2_0.h @@ -304,7 +304,8 @@ #define BTN_ENC EXP2_05_PIN // PE15 #endif -#if HAS_MARLINUI_U8GLIB +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) #define BOARD_ST7920_DELAY_1 DELAY_NS(200) // Tclk_fall <200ns #define BOARD_ST7920_DELAY_2 DELAY_NS(250) // Tdata_width >200ns #define BOARD_ST7920_DELAY_3 DELAY_NS(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 79a414d7d4..bb283201e4 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_BTT002_V1_0.h @@ -182,7 +182,6 @@ * EXP2 EXP1 | * -------------------------------------------------------------------------------------- */ - #define EXP1_03_PIN PE13 #define EXP1_04_PIN PE12 #define EXP1_05_PIN PE11 @@ -286,16 +285,10 @@ #endif // Alter timing for graphical display - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) - #endif + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) #endif #endif // HAS_WIRED_LCD diff --git a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h index a768088c37..8d828f9e27 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_E3_RRF.h @@ -282,16 +282,10 @@ #endif // Alter timing for graphical display - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) - #endif + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) #endif #endif // HAS_WIRED_LCD 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 fa49ff1495..5a1efc252b 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_GTR_V1_0.h @@ -488,16 +488,10 @@ #endif // Alter timing for graphical display - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) - #endif + #if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) #endif #endif // HAS_WIRED_LCD 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 ec9ca32f7e..bb5800aee7 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_OCTOPUS_V1_common.h @@ -310,17 +310,15 @@ #define TMC_BAUD_RATE 19200 #endif -/** - * ------ ------ - * NC | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | PC15 (SD_DETECT) (LCD_D7) PE15 | 3 4 | PE14 (LCD_D6) - * (MOSI) PA7 | 5 6 PB1 (BTN_EN2) (LCD_D5) PE13 | 5 6 PE12 (LCD_D4) - * (SD_SS) PA4 | 7 8 | PB2 (BTN_EN1) (LCD_RS) PE10 | 7 8 | PE9 (LCD_EN) - * (SCK) PA5 | 9 10 | PA6 (MISO) (BTN_ENC) PE7 | 9 10 | PE8 (BEEPER) - * ------ ----- - * EXP2 EXP1 +/** ------ ------ + * (BEEPER) PE8 |10 9 | PE7 (BTN_ENC) (MISO) PA6 |10 9 | PA5 (SCK) + * (LCD_EN) PE9 | 8 7 | PE10 (LCD_RS) (BTN_EN1) PB2 | 8 7 | PA4 (SD_SS) + * (LCD_D4) PE12 6 5 | PE13 (LCD_D5) (BTN_EN2) PB1 6 5 | PA7 (MOSI) + * (LCD_D6) PE14 | 4 3 | PE15 (LCD_D7) (SD_DETECT) PC15 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ - #define EXP1_03_PIN PE15 #define EXP1_04_PIN PE14 #define EXP1_05_PIN PE13 @@ -485,16 +483,10 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(120) // DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(80) // DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(580) // DELAY_NS(600) - #endif +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS(120) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 80) + #define BOARD_ST7920_DELAY_3 DELAY_NS(580) #endif #if HAS_SPI_TFT 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 6daa34e059..8690f41ec9 100644 --- a/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h +++ b/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h @@ -311,17 +311,15 @@ #define SDCARD_CONNECTION LCD #endif -/** - * ----- ----- - * NC | 1 2 | GND 5V | 1 2 | GND - * RESET | 3 4 | PF12(SD_DETECT) (LCD_D7) PG7 | 3 4 | PG6 (LCD_D6) - * (MOSI)PB15 | 5 6 PF11(BTN_EN2) (LCD_D5) PG3 | 5 6 PG2 (LCD_D4) - * (SD_SS)PB12 | 7 8 | PG10(BTN_EN1) (LCD_RS) PD10 | 7 8 | PD11 (LCD_EN) - * (SCK)PB13 | 9 10| PB14(MISO) (BTN_ENC) PA8 | 9 10| PG4 (BEEPER) - * ----- ----- - * EXP2 EXP1 +/** ------ ------ + * (BEEPER) PG4 |10 9 | PA8 (BTN_ENC) (MISO) PB14 |10 9 | PB13 (SCK) + * (LCD_EN) PD11 | 8 7 | PD10 (LCD_RS) (BTN_EN1) PG10 | 8 7 | PB12 (SD_SS) + * (LCD_D4) PG2 6 5 | PG3 (LCD_D5) (BTN_EN2) PF11 6 5 | PB15 (MOSI) + * (LCD_D6) PG6 | 4 3 | PG7 (LCD_D7) (SD_DETECT) PF12 | 4 3 | RESET + * GND | 2 1 | 5V GND | 2 1 | NC + * ------ ------ + * EXP1 EXP2 */ - #define EXP1_03_PIN PG7 #define EXP1_04_PIN PG6 #define EXP1_05_PIN PG3 @@ -506,12 +504,12 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB +#if ENABLED(U8GLIB_ST7920) #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(125) + #define BOARD_ST7920_DELAY_1 DELAY_NS(125) #endif #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(90) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 90) #endif #ifndef BOARD_ST7920_DELAY_3 #define BOARD_ST7920_DELAY_3 DELAY_NS(600) 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 e049f8fbd9..30163dc61d 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 @@ -303,7 +303,6 @@ * ----- ----- * EXP2 EXP1 */ - #define EXP1_03_PIN PE13 #define EXP1_04_PIN PE12 #define EXP1_05_PIN PE11 @@ -489,12 +488,12 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB +#if ENABLED(U8GLIB_ST7920) #ifndef BOARD_ST7920_DELAY_1 #define BOARD_ST7920_DELAY_1 DELAY_NS(120) #endif #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(80) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 80) #endif #ifndef BOARD_ST7920_DELAY_3 #define BOARD_ST7920_DELAY_3 DELAY_NS(580) diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 27ad7179df..cbed56d202 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -185,7 +185,6 @@ * ------ ------ * EXP1 EXP2 */ - #define EXP1_03_PIN PE7 #define EXP1_04_PIN PE8 #define EXP1_05_PIN PE9 @@ -305,17 +304,9 @@ #define FIL_RUNOUT_PIN PA3 -// -// ST7920 Delays -// -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(715) - #endif +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h index b50f1e4966..c922f13c60 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V20.h @@ -250,16 +250,10 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(600) - #endif +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(600) #endif #if ENABLED(TOUCH_UI_FTDI_EVE) diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h index 9ce8d33fa8..4bf8da564f 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_S6.h @@ -314,16 +314,10 @@ #endif // HAS_WIRED_LCD // Alter timing for graphical display -#if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(640) - #endif +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(640) #endif #ifndef RGB_LED_R_PIN diff --git a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h index f8d93b5604..0801aac952 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -276,7 +276,6 @@ * ------ ------ * EXP1 EXP2 */ - #define EXP1_03_PIN PD10 #define EXP1_04_PIN PD11 #define EXP1_05_PIN PE15 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index 03d8d19e94..af0f5fa17c 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -167,20 +167,13 @@ #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder #endif - #endif - // Alter timing for graphical display - #if HAS_MARLINUI_U8GLIB - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) - #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) - #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(640) - #endif - #endif +#endif // HAS_WIRED_LCD +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) + #define BOARD_ST7920_DELAY_3 DELAY_NS(640) #endif diff --git a/Marlin/src/pins/stm32f4/pins_VAKE403D.h b/Marlin/src/pins/stm32f4/pins_VAKE403D.h index 9d122c2642..280f98eae8 100644 --- a/Marlin/src/pins/stm32f4/pins_VAKE403D.h +++ b/Marlin/src/pins/stm32f4/pins_VAKE403D.h @@ -182,15 +182,9 @@ #define BTN_ENC PB12 #endif -// -// ST7920 Delays -// -#ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(96) -#endif -#ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(48) -#endif -#ifndef BOARD_ST7920_DELAY_3 +// Alter timing for graphical display +#if ENABLED(U8GLIB_ST7920) + #define BOARD_ST7920_DELAY_1 DELAY_NS( 96) + #define BOARD_ST7920_DELAY_2 DELAY_NS( 48) #define BOARD_ST7920_DELAY_3 DELAY_NS(715) #endif