Skip to content

Commit

Permalink
📺 SKR_MINI_SCREEN_ADAPTER for BTT SKR Mini E3 V3 (#24521)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellensp authored Jul 19, 2022
1 parent c5b3bac commit 57700b4
Showing 1 changed file with 147 additions and 93 deletions.
240 changes: 147 additions & 93 deletions Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@
#define POWER_LOSS_PIN PC12 // Power Loss Detection: PWR-DET
#endif

#ifndef NEOPIXEL_PIN
#define NEOPIXEL_PIN PA8 // LED driving pin
#endif

#ifndef PS_ON_PIN
#define PS_ON_PIN PC13 // Power Supply Control
#endif
Expand Down Expand Up @@ -153,8 +149,16 @@
* ------
* EXP1
*/
#define EXP1_01_PIN PB5
#define EXP1_02_PIN PA15
#define EXP1_03_PIN PA9
#define EXP1_04_PIN -1
#define EXP1_05_PIN PA10
#define EXP1_06_PIN PB9
#define EXP1_07_PIN PB8
#define EXP1_08_PIN PD6
#define EXP1_09_PIN -1
#define EXP1_10_PIN -1

#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
/**
Expand All @@ -176,93 +180,135 @@

#define BEEPER_PIN EXP1_02_PIN
#define BTN_EN1 EXP1_08_PIN
#define BTN_EN2 PB8
#define BTN_ENC PB5
#define BTN_EN2 EXP1_07_PIN
#define BTN_ENC EXP1_01_PIN

#elif HAS_WIRED_LCD

#if ENABLED(CR10_STOCKDISPLAY)

#define BEEPER_PIN PB5
#define BTN_ENC EXP1_02_PIN

#define BTN_EN1 PA9
#define BTN_EN2 PA10

#define LCD_PINS_RS PB8
#define LCD_PINS_ENABLE EXP1_08_PIN
#define LCD_PINS_D4 PB9

#elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!

#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#if ENABLED(SKR_MINI_SCREEN_ADAPTER)
/** https://github.com/VoronDesign/Voron-Hardware/tree/master/SKR-Mini_Screen_Adaptor/SRK%20Mini%20E3%20V3.0
*
* SKR Mini E3 V3.0 SKR Mini Screen Adaptor
* ------ ------
* 5V | 1 2 | GND MISO | 1 2 | SCK
* CS | 3 4 | SCK (EN1) PA10 | 3 4 | --
* MOSI | 5 6 | MISO (EN2) PA9 5 6 | MOSI
* 3V3 | 7 8 | GND -- | 7 8 | --
* ------ GND | 9 10| RESET (Kill)
* SPI ------
* EXP2
*
* ------ ------
* PB5 | 1 2 | PA15 -- | 1 2 | PB5 (BTN_ENC)
* PA9 | 3 4 | RESET (LCD CS) PB8 | 3 4 | PD6 (LCD_A0)
* PA10 5 6 | PB9 (RESET) PB9 5 6 | PA15 (DIN)
* PB8 | 7 8 | PD6 -- | 7 8 | --
* GND | 9 10| 5V GND | 9 10| 5V
* ------ ------
* EXP1 EXP1
*/
#if ENABLED(FYSETC_MINI_12864_2_1)
#define BTN_ENC EXP1_01_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BEEPER_PIN -1
#define LCD_RESET_PIN EXP1_06_PIN
#define DOGLCD_CS EXP1_07_PIN
#define DOGLCD_A0 EXP1_08_PIN
#define DOGLCD_SCK PA5
#define DOGLCD_MOSI PA7

#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1
#define NEOPIXEL_PIN EXP1_02_PIN
#else
#error "Only CR10_FYSETC_MINI_12864_2_1 and compatibles are currently supported on the BIGTREE_SKR_MINI_E3 with SKR_MINI_SCREEN_ADAPTER"
#endif

#define LCD_PINS_RS PB9
#define LCD_PINS_ENABLE EXP1_02_PIN
#define LCD_PINS_D4 PB8
#define LCD_PINS_D5 PA10
#define LCD_PINS_D6 PA9
#define LCD_PINS_D7 PB5
#define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!

#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
#else

#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 PA9
#define BTN_EN2 PA10
#if ENABLED(CR10_STOCKDISPLAY)

#define DOGLCD_CS PB8
#define DOGLCD_A0 PB9
#define DOGLCD_SCK PB5
#define DOGLCD_MOSI EXP1_08_PIN
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN

#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN

#elif IS_TFTGLCD_PANEL
#define LCD_PINS_RS EXP1_07_PIN
#define LCD_PINS_ENABLE EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN

#if ENABLED(TFTGLCD_PANEL_SPI)
#elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!

#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif

/**
* TFTGLCD_PANEL_SPI display pinout
*
* Board Display
* ------ ------
* (BEEPER) PB6 | 1 2 | PB5 (SD_DET) 5V | 1 2 | GND
* RESET | 3 4 | PA9 (MOD_RESET) -- | 3 4 | (SD_DET)
* PB9 5 6 | PA10 (SD_CS) (MOSI) | 5 6 | --
* PB7 | 7 8 | PB8 (LCD_CS) (SD_CS) | 7 8 | (LCD_CS)
* GND | 9 10 | 5V (SCK) | 9 10 | (MISO)
* ------ ------
* EXP1 EXP1
*
* Needs custom cable:
*
* Board Display
*
* EXP1-1 ----------- EXP1-10
* EXP1-2 ----------- EXP1-9
* SPI1-4 ----------- EXP1-6
* EXP1-4 ----------- FREE
* SPI1-3 ----------- EXP1-2
* EXP1-6 ----------- EXP1-4
* EXP1-7 ----------- FREE
* EXP1-8 ----------- EXP1-3
* SPI1-1 ----------- EXP1-1
* EXP1-10 ----------- EXP1-7
*/
#define LCD_PINS_RS EXP1_06_PIN
#define LCD_PINS_ENABLE EXP1_02_PIN
#define LCD_PINS_D4 EXP1_07_PIN
#define LCD_PINS_D5 EXP1_05_PIN
#define LCD_PINS_D6 EXP1_03_PIN
#define LCD_PINS_D7 EXP1_01_PIN
#define ADC_KEYPAD_PIN PA1 // Repurpose servo pin for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!

#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)

#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN

#define DOGLCD_CS EXP1_07_PIN
#define DOGLCD_A0 EXP1_06_PIN
#define DOGLCD_SCK EXP1_01_PIN
#define DOGLCD_MOSI EXP1_08_PIN

#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1

#elif IS_TFTGLCD_PANEL

#if ENABLED(TFTGLCD_PANEL_SPI)

#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
#endif

/**
* TFTGLCD_PANEL_SPI display pinout
*
* Board Display
* ------ ------
* (BEEPER) PB6 | 1 2 | PB5 (SD_DET) 5V | 1 2 | GND
* RESET | 3 4 | PA9 (MOD_RESET) -- | 3 4 | (SD_DET)
* PB9 5 6 | PA10 (SD_CS) (MOSI) | 5 6 | --
* PB7 | 7 8 | PB8 (LCD_CS) (SD_CS) | 7 8 | (LCD_CS)
* GND | 9 10 | 5V (SCK) | 9 10 | (MISO)
* ------ ------
* EXP1 EXP1
*
* Needs custom cable:
*
* Board Display
*
* EXP1-1 ----------- EXP1-10
* EXP1-2 ----------- EXP1-9
* SPI1-4 ----------- EXP1-6
* EXP1-4 ----------- FREE
* SPI1-3 ----------- EXP1-2
* EXP1-6 ----------- EXP1-4
* EXP1-7 ----------- FREE
* EXP1-8 ----------- EXP1-3
* SPI1-1 ----------- EXP1-1
* EXP1-10 ----------- EXP1-7
*/

#define TFTGLCD_CS EXP1_03_PIN

#define TFTGLCD_CS PA9

#endif
#endif

#elif ENABLED(FYSETC_MINI_12864_2_1)
#elif ENABLED(FYSETC_MINI_12864_2_1)

#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
#error "CAUTION! FYSETC_MINI_12864_2_1 and clones require wiring modifications. See 'pins_BTT_SKR_MINI_E3_V3_0.h' for details. Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning"
Expand Down Expand Up @@ -294,22 +340,24 @@
* Check twice index position!!! (marked as # here)
* On BTT boards pins from IDC10 connector are numbered in unusual order.
*/
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 PB9
#define BTN_EN2 PB5
#define BEEPER_PIN -1
#define BTN_ENC EXP1_02_PIN
#define BTN_EN1 EXP1_06_PIN
#define BTN_EN2 EXP1_01_PIN
#define BEEPER_PIN -1

#define DOGLCD_CS PA9
#define DOGLCD_A0 PA10
#define DOGLCD_SCK PB8
#define DOGLCD_MOSI PD6
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_A0 EXP1_05_PIN
#define DOGLCD_SCK EXP1_07_PIN
#define DOGLCD_MOSI EXP1_08_PIN

#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1
#define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1

#else
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, FYSETC_MINI_12864_2_1, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
#endif
#else
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, FYSETC_MINI_12864_2_1, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
#endif

#endif // SKR_MINI_SCREEN_ADAPTER

#endif // HAS_WIRED_LCD

Expand Down Expand Up @@ -352,9 +400,8 @@

#define BEEPER_PIN EXP1_02_PIN

#define CLCD_MOD_RESET PA9
#define CLCD_SPI_CS PB8

#define CLCD_MOD_RESET EXP1_03_PIN
#define CLCD_SPI_CS EXP1_07_PIN
#endif // TOUCH_UI_FTDI_EVE && LCD_FYSETC_TFT81050

//
Expand All @@ -368,8 +415,8 @@
#if SD_CONNECTION_IS(ONBOARD)
#define SD_DETECT_PIN PC3
#elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
#define SD_DETECT_PIN PB5
#define SD_SS_PIN PA10
#define SD_DETECT_PIN EXP1_01_PIN
#define SD_SS_PIN EXP1_05_PIN
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
#error "SD CUSTOM_CABLE is not compatible with SKR Mini E3."
#endif
Expand All @@ -383,3 +430,10 @@
#define SD_SCK_PIN PA5
#define SD_MISO_PIN PA6
#define SD_MOSI_PIN PA7

//
// Default NEOPIXEL_PIN
//
#ifndef NEOPIXEL_PIN
#define NEOPIXEL_PIN PA8 // LED driving pin
#endif

0 comments on commit 57700b4

Please sign in to comment.