From 4108c5d01fe56c4cb06bffdd926cbaf879e34f11 Mon Sep 17 00:00:00 2001 From: George Fu Date: Sat, 18 Jan 2020 03:16:05 +0800 Subject: [PATCH] Update FYSETC S6 pins (#16559) --- Marlin/Configuration.h | 9 +- Marlin/src/inc/Conditionals_LCD.h | 2 +- Marlin/src/inc/Conditionals_post.h | 2 +- Marlin/src/inc/SanityCheck.h | 1 + Marlin/src/pins/ramps/pins_FYSETC_F6_13.h | 6 +- Marlin/src/pins/stm32/pins_FYSETC_S6.h | 144 ++++++++++++---------- 6 files changed, 93 insertions(+), 71 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index ee82fbf9f..25c6ffdb2 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1944,10 +1944,11 @@ // FYSETC variant of the MINI12864 graphic controller with SD support // https://wiki.fysetc.com/Mini12864_Panel/ // -//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default -//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) -//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight -//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight +//#define FYSETC_MINI_12864_X_X // Type C/D/E/F. No tunable RGB Backlight by default +//#define FYSETC_MINI_12864_1_2 // Type C/D/E/F. Simple RGB Backlight (always on) +//#define FYSETC_MINI_12864_2_0 // Type A/B. Discreet RGB Backlight +//#define FYSETC_MINI_12864_2_1 // Type A/B. Neopixel RGB Backlight +//#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight. // // Factory display for Creality CR-10 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 296662082..0e87b79c2 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -114,7 +114,7 @@ #define MINIPANEL -#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) +#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1, FYSETC_GENERIC_12864_1_1) #define FYSETC_MINI_12864 #define DOGLCD diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index ec0b06f66..4ad08ffa8 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -262,7 +262,7 @@ #elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) #define _LCD_CONTRAST_MIN 120 #define _LCD_CONTRAST_INIT 195 -#elif ANY(FYSETC_MINI_12864_X_X, FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0, FYSETC_MINI_12864_2_1) +#elif ENABLED(FYSETC_MINI_12864) #define _LCD_CONTRAST_INIT 220 #elif ENABLED(ULTI_CONTROLLER) #define _LCD_CONTRAST_INIT 127 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index da27aef8e..48f92d985 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1904,6 +1904,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS + ENABLED(FYSETC_MINI_12864_1_2) \ + ENABLED(FYSETC_MINI_12864_2_0) \ + ENABLED(FYSETC_MINI_12864_2_1) \ + + ENABLED(FYSETC_GENERIC_12864_1_1) \ + ENABLED(CR10_STOCKDISPLAY) \ + ENABLED(ANET_FULL_GRAPHICS_LCD) \ + ENABLED(AZSMZ_12864) \ diff --git a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h index 4c6f59aaa..d00963039 100644 --- a/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h +++ b/Marlin/src/pins/ramps/pins_FYSETC_F6_13.h @@ -225,9 +225,11 @@ #define DOGLCD_A0 16 #define DOGLCD_CS 17 - #define LCD_BACKLIGHT_PIN -1 - #define KILL_PIN 41 + #if ENABLED(FYSETC_GENERIC_12864_1_1) + #define LCD_BACKLIGHT_PIN 27 + #endif + #define KILL_PIN 41 #define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally. // Seems to work best if left open. diff --git a/Marlin/src/pins/stm32/pins_FYSETC_S6.h b/Marlin/src/pins/stm32/pins_FYSETC_S6.h index 227fe4cd5..33756e437 100644 --- a/Marlin/src/pins/stm32/pins_FYSETC_S6.h +++ b/Marlin/src/pins/stm32/pins_FYSETC_S6.h @@ -42,6 +42,11 @@ // #define FLASH_EEPROM_EMULATION //#define SRAM_EEPROM_EMULATION +//#define I2C_EEPROM +#ifdef I2C_EEPROM + #undef E2END // Defined in Arduino Core STM32 to be used with EEPROM emulation. This board uses a real EEPROM. + #define E2END 0xFFF // 4KB +#endif // // Limit Switches @@ -93,9 +98,9 @@ #define E2_CS_PIN PC15 #if HAS_TMC220x - /** - * TMC2208/TMC2209 stepper drivers - */ + // + // TMC2208/TMC2209 stepper drivers + // // // Software serial @@ -159,70 +164,83 @@ // // LCD / Controller // - -#define BEEPER_PIN PC9 -#define SD_DETECT_PIN PB10 - -#if ENABLED(FYSETC_MINI_12864) - // - // See https://wiki.fysetc.com/Mini12864_Panel/?fbclid=IwAR1FyjuNdVOOy9_xzky3qqo_WeM5h-4gpRnnWhQr_O1Ef3h0AFnFXmCehK8 - // - #define DOGLCD_A0 PD2 - #define DOGLCD_CS PC11 - - //#define LCD_BACKLIGHT_PIN -1 - //#define KILL_PIN -1 - - #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. - // Seems to work best if left open. - - #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) - #ifndef RGB_LED_R_PIN - #define RGB_LED_R_PIN PC12 - #endif - #ifndef RGB_LED_G_PIN - #define RGB_LED_G_PIN PD0 - #endif - #ifndef RGB_LED_B_PIN - #define RGB_LED_B_PIN PD1 - #endif - #elif ENABLED(FYSETC_MINI_12864_2_1) - #define NEOPIXEL_PIN PC12 - #endif - -#elif HAS_GRAPHICAL_LCD - #define LCD_PINS_RS PD2 - #define LCD_PINS_ENABLE PC11 - #define LCD_PINS_D4 PC10 - #define LCD_PINS_D5 PC12 - #define LCD_PINS_D6 PD0 - #define LCD_PINS_D7 PD1 - - #if ENABLED(MKS_MINI_12864) - #define DOGLCD_CS PC12 - #define DOGLCD_A0 PD0 - #endif - -#endif - -#if ENABLED(NEWPANEL) - #define BTN_EN1 PC6 - #define BTN_EN2 PC7 +#if HAS_SPI_LCD + #define BEEPER_PIN PC9 #define BTN_ENC PA8 -#endif -// Alter timing for graphical display -#if HAS_GRAPHICAL_LCD - #ifndef BOARD_ST7920_DELAY_1 - #define BOARD_ST7920_DELAY_1 DELAY_NS(103) + #if ENABLED(CR10_STOCKDISPLAY) + #define LCD_PINS_RS PD0 + + #define BTN_EN1 PC11 + #define BTN_EN2 PC10 + + #define LCD_PINS_ENABLE PD1 + #define LCD_PINS_D4 PC12 + + // CR10_Stock Display needs a different delay setting on SKR PRO v1.1, so undef it here. + // It will be defined again at the #HAS_GRAPHICAL_LCD section below. + #undef ST7920_DELAY_1 + #undef ST7920_DELAY_2 + #undef ST7920_DELAY_3 + + #else + + #define LCD_PINS_RS PD2 + + #define BTN_EN1 PC6 + #define BTN_EN2 PC7 + #define SD_DETECT_PIN PB10 + + #define LCD_SDSS PA4 + + #define LCD_PINS_ENABLE PC11 + #define LCD_PINS_D4 PC10 + + #if ENABLED(FYSETC_MINI_12864) + // See https://wiki.fysetc.com/Mini12864_Panel + #define DOGLCD_CS PC11 + #define DOGLCD_A0 PD2 + #if ENABLED(FYSETC_GENERIC_12864_1_1) + #define LCD_BACKLIGHT_PIN PD0 + #endif + #define LCD_RESET_PIN PC10 // Must be high or open for LCD to operate normally. + #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0) + #ifndef RGB_LED_R_PIN + #define RGB_LED_R_PIN PC12 + #endif + #ifndef RGB_LED_G_PIN + #define RGB_LED_G_PIN PD0 + #endif + #ifndef RGB_LED_B_PIN + #define RGB_LED_B_PIN PD1 + #endif + #elif ENABLED(FYSETC_MINI_12864_2_1) + #define NEOPIXEL_PIN PC12 + #endif + #endif // !FYSETC_MINI_12864 + + #if ENABLED(ULTIPANEL) + #define LCD_PINS_D5 PC12 + #define LCD_PINS_D6 PD0 + #define LCD_PINS_D7 PD1 + #endif + #endif - #ifndef BOARD_ST7920_DELAY_2 - #define BOARD_ST7920_DELAY_2 DELAY_NS(51) + + // Alter timing for graphical display + #if HAS_GRAPHICAL_LCD + #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(600) + #endif #endif - #ifndef BOARD_ST7920_DELAY_3 - #define BOARD_ST7920_DELAY_3 DELAY_NS(642) - #endif -#endif + +#endif // HAS_SPI_LCD #ifndef RGB_LED_R_PIN #define RGB_LED_R_PIN PB6