MarlinUI for SPI/I2C TFT-GLCD character-based display bridge (#19375)
This commit is contained in:
@ -65,7 +65,16 @@
|
||||
* by redrawing the screen after SD card accesses.
|
||||
*/
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
#if IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_26
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN P1_31
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BTN_EN1 P3_26
|
||||
#define BTN_EN2 P3_25
|
||||
#define BTN_ENC P2_11
|
||||
@ -80,7 +89,8 @@
|
||||
#define DOGLCD_CS P2_06
|
||||
#define DOGLCD_A0 P0_16
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // HAS_WIRED_LCD
|
||||
|
||||
//
|
||||
// SD Support
|
||||
@ -89,7 +99,7 @@
|
||||
// requires jumpers on the SKR V1.1 board as documented here:
|
||||
// https://www.facebook.com/groups/505736576548648/permalink/630639874058317/
|
||||
#ifndef SDCARD_CONNECTION
|
||||
#if EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
|
||||
#if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY, IS_TFTGLCD_PANEL)
|
||||
#define SDCARD_CONNECTION LCD
|
||||
#else
|
||||
#define SDCARD_CONNECTION ONBOARD
|
||||
|
@ -265,6 +265,14 @@
|
||||
|
||||
#error "ADC BUTTONS do not work unmodifed on SKR 1.3, The ADC ports cannot take more than 3.3v."
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS EXPA2_08_PIN
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN EXPA2_04_PIN
|
||||
|
||||
#else // !CR10_STOCKDISPLAY
|
||||
|
||||
#define LCD_PINS_RS EXPA1_07_PIN
|
||||
|
@ -309,6 +309,14 @@
|
||||
#define XPT2046_Y_OFFSET -285
|
||||
#endif
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_26
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN P1_31
|
||||
|
||||
#else
|
||||
|
||||
#define BTN_ENC P0_28 // (58) open-drain
|
||||
|
@ -217,7 +217,18 @@
|
||||
* that the garbage/lines are erased immediately after the SD card accesses are completed.
|
||||
*/
|
||||
|
||||
#if HAS_WIRED_LCD
|
||||
#if IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_25 // EXP2.3
|
||||
#endif
|
||||
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
#define SD_DETECT_PIN P0_28 // EXP2.4
|
||||
#endif
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN P1_31 // EXP1.1
|
||||
#define BTN_ENC P1_30 // EXP1.2
|
||||
#define BTN_EN1 P3_26 // EXP2.5
|
||||
@ -273,7 +284,7 @@
|
||||
//#define LCD_SCREEN_ROT_270
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // HAS_WIRED_LCD
|
||||
|
||||
/**
|
||||
* Example for trinamic drivers using the J8 connector on MKs Sbase.
|
||||
|
@ -249,6 +249,15 @@
|
||||
#define LCD_PINS_ENABLE P1_22
|
||||
#define LCD_PINS_D4 P0_17
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#undef BEEPER_PIN
|
||||
#undef BTN_ENC
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_25
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define BTN_EN1 P3_25
|
||||
|
@ -326,6 +326,15 @@
|
||||
#define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI)
|
||||
#define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK)
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_26 // (31) J3-2 & AUX-4
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN P1_31 // (49) J3-1 & AUX-3 (NOT 5V tolerant)
|
||||
#define KILL_PIN P1_22 // (41) J5-4 & AUX-4
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
//#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3
|
||||
|
@ -241,7 +241,16 @@
|
||||
* ----- -----
|
||||
* EXP1 EXP2
|
||||
*/
|
||||
#if HAS_WIRED_LCD
|
||||
#if IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_25
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN P0_27
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN P1_31
|
||||
#define BTN_ENC P1_30
|
||||
|
||||
|
@ -111,16 +111,33 @@
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
/*
|
||||
The Smoothieboard supports the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with either
|
||||
a custom cable with breakouts to the pins indicated below or the RRD GLCD Adapter board
|
||||
found at http://smoothieware.org/rrdglcdadapter
|
||||
/**
|
||||
* SD Support
|
||||
*
|
||||
* For the RRD GLCD it CANNOT share the same SPI as the LCD so it must be
|
||||
* hooked up to the onboard SDCard SPI and use a spare pin for the SDCS.
|
||||
* Also note that an external SDCard sharing the SPI port with the
|
||||
* onboard/internal SDCard must be ejected before rebooting as the bootloader
|
||||
* does not like the external card. NOTE Smoothie will not boot if the external
|
||||
* sdcard is inserted in the RRD LCD sdcard slot at boot time, it must be
|
||||
* inserted after it has booted.
|
||||
*/
|
||||
#define SD_DETECT_PIN P0_27 // EXP2 Pin 7 (SD_CD, SD_DET)
|
||||
|
||||
Other links to information about setting up a display panel with Smoothieboard
|
||||
http://chibidibidiwah.wdfiles.com/local--files/panel/smoothieboard2sd.jpg
|
||||
http://smoothieware.org/panel
|
||||
*/
|
||||
#define MISO_PIN P0_08 // EXP2 Pin 1 (PB3, SD_MISO)
|
||||
#define SCK_PIN P0_07 // EXP2 Pin 2 (SD_SCK)
|
||||
#define SS_PIN P0_28 // EXP2 Pin 4 (SD_CSEL, SD_CS)
|
||||
#define MOSI_PIN P0_09 // EXP2 Pin 6 (PB2, SD_MOSI)
|
||||
|
||||
/**
|
||||
* The Smoothieboard supports the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with either
|
||||
* a custom cable with breakouts to the pins indicated below or the RRD GLCD Adapter board
|
||||
* found at http://smoothieware.org/rrdglcdadapter
|
||||
*
|
||||
* Other links to information about setting up a display panel with Smoothieboard
|
||||
* http://chibidibidiwah.wdfiles.com/local--files/panel/smoothieboard2sd.jpg
|
||||
* http://smoothieware.org/panel
|
||||
*/
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
// EXP1 Pins
|
||||
#define BEEPER_PIN P1_31 // EXP1 Pin 1
|
||||
@ -132,24 +149,14 @@
|
||||
#define BTN_EN2 P3_26 // EXP2 Pin 3
|
||||
#define BTN_EN1 P3_25 // EXP2 Pin 5
|
||||
|
||||
/*
|
||||
SD Support
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
For the RRD GLCD it CANNOT share the same SPI as the LCD so it must be
|
||||
hooked up to the onboard SDCard SPI and use a spare pin for the SDCS.
|
||||
Also note that an external SDCard sharing the SPI port with the
|
||||
onboard/internal SDCard must be ejected before rebooting as the bootloader
|
||||
does not like the external card. NOTE Smoothie will not boot if the external
|
||||
sdcard is inserted in the RRD LCD sdcard slot at boot time, it must be
|
||||
inserted after it has booted.
|
||||
*/
|
||||
|
||||
#define MISO_PIN P0_08 // EXP2 Pin 1 (PB3, SD_MISO)
|
||||
#define SCK_PIN P0_07 // EXP2 Pin 2 (SD_SCK)
|
||||
#define SS_PIN P0_28 // EXP2 Pin 4 (SD_CSEL, SD_CS)
|
||||
#define MOSI_PIN P0_09 // EXP2 Pin 6 (PB2, SD_MOSI)
|
||||
#define SD_DETECT_PIN P0_27 // EXP2 Pin 7 (SD_CD, SD_DET)
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS P3_26 // EXP2 Pin 3
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error "Marlin's Smoothieboard support cannot drive your LCD."
|
||||
#endif
|
||||
|
@ -261,6 +261,9 @@
|
||||
#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0
|
||||
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK)
|
||||
#endif
|
||||
#if defined(TFTGLCD_CS) && TFTGLCD_CS >= 0
|
||||
REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_CS)
|
||||
#endif
|
||||
#if PIN_EXISTS(E_MUX0)
|
||||
REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN)
|
||||
#endif
|
||||
|
@ -450,6 +450,10 @@
|
||||
#define LCD_PINS_D6 44
|
||||
#define LCD_PINS_D7 64
|
||||
|
||||
#elif ENABLED(TFTGLCD_PANEL_SPI)
|
||||
|
||||
#define TFTGLCD_CS 33
|
||||
|
||||
#else
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
@ -682,6 +686,10 @@
|
||||
|
||||
// Pins only defined for RAMPS_SMART currently
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#define SD_DETECT_PIN 49
|
||||
|
||||
#else
|
||||
|
||||
// Beeper on AUX-4
|
||||
|
@ -279,9 +279,7 @@
|
||||
|
||||
#if SD_CONNECTION_IS(ONBOARD)
|
||||
#define SD_DETECT_PIN PC4
|
||||
#endif
|
||||
|
||||
#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
|
||||
#elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
|
||||
#define SD_DETECT_PIN PA15
|
||||
#define SS_PIN PA10
|
||||
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
||||
|
@ -169,8 +169,48 @@
|
||||
#define FORCE_SOFT_SPI
|
||||
#define LCD_BACKLIGHT_PIN -1
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
|
||||
#error "CAUTION! TFTGLCD_PANEL_SPI requires wiring modifications. See 'pins_BTT_SKR_MINI_E3_common.h' for details. Comment out this line to continue."
|
||||
|
||||
/**
|
||||
* TFTGLCD_PANEL_SPI display pinout
|
||||
*
|
||||
* Board Display
|
||||
* _____ _____
|
||||
* 5V | 1 2 | GND (SPI1-MISO) MISO | 1 2 | SCK (SPI1-SCK)
|
||||
* (FREE) PB7 | 3 4 | PB8 (LCD_CS) (PA9) GLCD_CS | 3 4 | SD_CS (PA10)
|
||||
* (FREE) PB9 | 5 6 | PA10 (SD_CS) (FREE) | 5 6 | MOSI (SPI1-MOSI)
|
||||
* RESET | 7 8 | PA9 (MOD_RESET) (PB5) SD_DET | 7 8 | (FREE)
|
||||
* (BEEPER) PB6 | 9 10| PB5 (SD_DET) GND | 9 10| 5V
|
||||
* ----- -----
|
||||
* EXP1 EXP1
|
||||
*
|
||||
* Needs custom cable:
|
||||
*
|
||||
* Board Adapter 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 PA9
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, and MKS_MINI_12864 are currently supported on the BIGTREE_SKR_MINI_E3."
|
||||
#error "Only CR10_STOCKDISPLAY, ZONESTAR_LCD, ENDER2_STOCKDISPLAY, MKS_MINI_12864, and TFTGLCD_PANEL_(SPI|I2C) are currently supported on the BIGTREE_SKR_MINI_E3."
|
||||
#endif
|
||||
|
||||
#endif // HAS_WIRED_LCD
|
||||
@ -227,9 +267,7 @@
|
||||
|
||||
#if SD_CONNECTION_IS(ONBOARD)
|
||||
#define SD_DETECT_PIN PC4
|
||||
#endif
|
||||
|
||||
#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
|
||||
#elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
|
||||
#define SD_DETECT_PIN PB5
|
||||
#define SS_PIN PA10
|
||||
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
||||
|
@ -123,6 +123,17 @@
|
||||
#define LCD_PINS_ENABLE PC14
|
||||
#define LCD_PINS_D4 PB7
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#undef BEEPER_PIN
|
||||
#undef BTN_ENC
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS PD2
|
||||
#endif
|
||||
|
||||
#define SD_DETECT_PIN PB9
|
||||
|
||||
#else
|
||||
|
||||
#define LCD_PINS_RS PC12
|
||||
|
@ -115,6 +115,12 @@
|
||||
#define DOGLCD_SCK PB13
|
||||
#define DOGLCD_MOSI PB15
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS PB11
|
||||
#endif
|
||||
|
||||
#else // !MKS_MINI_12864
|
||||
|
||||
#define LCD_PINS_D4 PA6
|
||||
|
@ -356,6 +356,19 @@
|
||||
#define DOGLCD_SCK PA5
|
||||
#define DOGLCD_MOSI PA7
|
||||
|
||||
#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
|
||||
|
||||
#else // !MKS_MINI_12864
|
||||
|
||||
#define LCD_PINS_D4 PE14
|
||||
|
@ -225,6 +225,12 @@
|
||||
#define BTN_EN2 PG4
|
||||
#endif
|
||||
|
||||
#elif IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS PG5
|
||||
#endif
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN PC5
|
||||
@ -254,6 +260,7 @@
|
||||
#endif
|
||||
|
||||
#endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_ST7920_DELAY_1
|
||||
|
@ -286,7 +286,14 @@
|
||||
//
|
||||
// LCDs and Controllers
|
||||
//
|
||||
#if HAS_WIRED_LCD
|
||||
#if IS_TFTGLCD_PANEL
|
||||
|
||||
#if ENABLED(TFTGLCD_PANEL_SPI)
|
||||
#define TFTGLCD_CS PG10
|
||||
#endif
|
||||
|
||||
#elif HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN PG4
|
||||
#define BTN_ENC PA8
|
||||
|
||||
|
Reference in New Issue
Block a user