From 381c5908b4f0a24d7fad7becfd2f72f4e5056814 Mon Sep 17 00:00:00 2001 From: mks-viva <1224833100@qq.com> Date: Wed, 28 Jul 2021 21:56:22 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=BA=20MKS=20MINI12864=20V3=20for=20Rob?= =?UTF-8?q?in=20E3P,=20etc.=20(#22453)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h | 4 +- Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h | 78 +++++++++++++------ .../pins/stm32f1/pins_MKS_ROBIN_E3_common.h | 1 + Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h | 2 +- .../src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h | 3 +- Marlin/src/pins/stm32f4/pins_FLYF407ZG.h | 4 +- .../src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h | 1 + Marlin/src/pins/stm32f4/pins_RUMBA32_common.h | 4 +- 8 files changed, 66 insertions(+), 31 deletions(-) diff --git a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h index bdf3f48c3a..31b03f6b07 100644 --- a/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h +++ b/Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h @@ -41,7 +41,7 @@ #define BOARD_NO_NATIVE_USB // Avoid conflict with TIMER_SERVO when using the STM32 HAL -#define TEMP_TIMER 5 +#define TEMP_TIMER 5 // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role @@ -65,7 +65,7 @@ #define SD_SCK_PIN PB13 // SPI2 #define SD_MISO_PIN PB14 // SPI2 #define SD_MOSI_PIN PB15 // SPI2 -#define SPI_DEVICE 2 +#define SPI_DEVICE 2 // SPI Flash #define HAS_SPI_FLASH 1 diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h index c7850903e7..b32d0aa0b8 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3P.h @@ -38,6 +38,9 @@ #define BOARD_NO_NATIVE_USB #define MKS_HARDWARE_TEST_ONLY_E0 +// Avoid conflict with TIMER_SERVO when using the STM32 HAL +#define TEMP_TIMER 5 + // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role // @@ -214,17 +217,23 @@ #define SDCARD_CONNECTION ONBOARD #endif -#define SDIO_SUPPORT -#define SDIO_CLOCK 4500000 // 4.5 MHz -#define SD_DETECT_PIN PD12 -#define ONBOARD_SD_CS_PIN PC11 +#if SD_CONNECTION_IS(ONBOARD) + #define SDIO_SUPPORT + #define SDIO_CLOCK 4500000 // 4.5 MHz + #define SD_DETECT_PIN PD12 + #define ONBOARD_SD_CS_PIN PC11 +#elif SD_CONNECTION_IS(LCD) + #define ENABLE_SPI1 + #define SDSS PE10 + #define SD_SCK_PIN PA5 + #define SD_MISO_PIN PA6 + #define SD_MOSI_PIN PA7 + #define SD_DETECT_PIN PE12 +#endif // // LCD / Controller // -#ifndef BEEPER_PIN - #define BEEPER_PIN PC5 -#endif /** * Note: MKS Robin TFT screens use various TFT controllers. @@ -261,33 +270,29 @@ #define TOUCH_BUTTONS_HW_SPI #define TOUCH_BUTTONS_HW_SPI_DEVICE 1 - #ifndef TFT_WIDTH - #define TFT_WIDTH 480 - #endif - #ifndef TFT_HEIGHT - #define TFT_HEIGHT 320 - #endif - - #define LCD_READ_ID 0xD3 #define LCD_USE_DMA_SPI #endif -#if HAS_SPI_GRAPHICAL_TFT +#if ENABLED(TFT_CLASSIC_UI) // Emulated DOGM SPI #define LCD_PINS_ENABLE PD13 #define LCD_PINS_RS PC6 #define BTN_ENC PE13 #define BTN_EN1 PE8 #define BTN_EN2 PE11 -#elif ENABLED(TFT_480x320_SPI) - #define TFT_DRIVER ST7796 +#elif ENABLED(TFT_COLOR_UI) #define TFT_BUFFER_SIZE 14400 #endif #if HAS_WIRED_LCD && !HAS_SPI_TFT - - // NON TFT Displays + #define BEEPER_PIN PC5 + #define BTN_ENC PE13 + #define LCD_PINS_ENABLE PD13 + #define LCD_PINS_RS PC6 + #define BTN_EN1 PE8 + #define BTN_EN2 PE11 + #define LCD_BACKLIGHT_PIN -1 #if ENABLED(MKS_MINI_12864) @@ -301,9 +306,32 @@ #define DOGLCD_SCK PA5 #define DOGLCD_MOSI PA7 - // Required for MKS_MINI_12864 with this board - #define MKS_LCD12864B - #undef SHOW_BOOTSCREEN + #elif IS_TFTGLCD_PANEL + + #if ENABLED(TFTGLCD_PANEL_SPI) + #define PIN_SPI_SCK PA5 + #define PIN_TFT_MISO PA6 + #define PIN_TFT_MOSI PA7 + #define TFTGLCD_CS PE8 + #endif + + #ifndef BEEPER_PIN + #define BEEPER_PIN -1 + #endif + + #elif ENABLED(MKS_MINI_12864_V3) + #define DOGLCD_CS PD13 + #define DOGLCD_A0 PC6 + #define LCD_PINS_DC DOGLCD_A0 + #define LCD_BACKLIGHT_PIN -1 + #define LCD_RESET_PIN PE14 + #define NEOPIXEL_PIN PE15 + #define DOGLCD_MOSI PA7 + #define DOGLCD_SCK PA5 + #if SD_CONNECTION_IS(ONBOARD) + #define FORCE_SOFT_SPI + #endif + //#define LCD_SCREEN_ROT_180 #else // !MKS_MINI_12864 @@ -342,6 +370,10 @@ #define W25QXX_SCK_PIN PB13 #endif +#ifndef BEEPER_PIN + #define BEEPER_PIN PC5 +#endif + #if ENABLED(SPEAKER) && BEEPER_PIN == PC5 #error "MKS Robin nano default BEEPER_PIN is not a SPEAKER." #endif 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 b5d02942f3..44c35b9d04 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_E3_common.h @@ -166,6 +166,7 @@ #define DOGLCD_SCK PB13 #define FORCE_SOFT_SPI #define SOFTWARE_SPI + //#define LCD_SCREEN_ROT_180 #else diff --git a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h index 95d62f05a4..147aec5e9f 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h @@ -37,7 +37,7 @@ #define BOARD_NO_NATIVE_USB // Avoid conflict with TIMER_SERVO when using the STM32 HAL -#define TEMP_TIMER 5 +#define TEMP_TIMER 5 // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role 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 7bbc2b26da..4b0ba2fdab 100644 --- a/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h +++ b/Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO_V2.h @@ -38,7 +38,7 @@ #define BOARD_NO_NATIVE_USB // Avoid conflict with TIMER_SERVO when using the STM32 HAL -#define TEMP_TIMER 5 +#define TEMP_TIMER 5 // // Release PB4 (Y_ENABLE_PIN) from JTAG NRST role @@ -345,6 +345,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif + //#define LCD_SCREEN_ROT_180 #else // !MKS_MINI_12864 diff --git a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h index 34124a9b02..77257f818a 100644 --- a/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h +++ b/Marlin/src/pins/stm32f4/pins_FLYF407ZG.h @@ -33,8 +33,8 @@ #define DEFAULT_MACHINE_NAME BOARD_INFO_NAME // Avoid conflict with fans and TIMER_TONE -#define TEMP_TIMER 3 -#define STEP_TIMER 5 +#define TEMP_TIMER 3 +#define STEP_TIMER 5 // // EEPROM Emulation 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 182506f11e..6795b92892 100644 --- a/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h +++ b/Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h @@ -365,6 +365,7 @@ #if SD_CONNECTION_IS(ONBOARD) #define FORCE_SOFT_SPI #endif + //#define LCD_SCREEN_ROT_180 #else // !MKS_MINI_12864 diff --git a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h index be6e4f8a34..7bf148874c 100644 --- a/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h +++ b/Marlin/src/pins/stm32f4/pins_RUMBA32_common.h @@ -45,8 +45,8 @@ // This will be difficult to solve from the Arduino IDE, without modifying the RUMBA32 variant // included with the STM32 framework. -#define STEP_TIMER 10 -#define TEMP_TIMER 14 +#define STEP_TIMER 10 +#define TEMP_TIMER 14 // // Limit Switches