MarlinUI for SPI/I2C TFT-GLCD character-based display bridge (#19375)

This commit is contained in:
Serhiy-K 2020-09-28 09:52:38 +03:00 committed by Scott Lahteine
parent 58deab1915
commit 63e6437d66
31 changed files with 2516 additions and 53 deletions

View File

@ -1957,6 +1957,14 @@
// //
//#define FF_INTERFACEBOARD //#define FF_INTERFACEBOARD
//
// TFT GLCD Panel with Marlin UI
// Panel connected to main board by SPI or I2C interface.
// See https://github.com/Serhiy-K/TFTGLCDAdapter
//
//#define TFTGLCD_PANEL_SPI
//#define TFTGLCD_PANEL_I2C
//============================================================================= //=============================================================================
//======================= LCD / Controller Selection ======================= //======================= LCD / Controller Selection =======================
//========================= (Graphical LCDs) ======================== //========================= (Graphical LCDs) ========================

View File

@ -1106,7 +1106,7 @@
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s) #define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
#endif #endif
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && (HAS_MARLINUI_U8GLIB || HAS_MARLINUI_HD44780) #if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && ANY(HAS_MARLINUI_U8GLIB, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
//#define SHOW_REMAINING_TIME // Display estimated time to completion //#define SHOW_REMAINING_TIME // Display estimated time to completion
#if ENABLED(SHOW_REMAINING_TIME) #if ENABLED(SHOW_REMAINING_TIME)
//#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation //#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
@ -1117,7 +1117,7 @@
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits //#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
#endif #endif
#if HAS_MARLINUI_HD44780 #if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing //#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar #define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar

View File

@ -997,6 +997,10 @@
if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point if (do_ubl_mesh_map) display_map(g29_map_type); // Display the current point
#if IS_TFTGLCD_PANEL
ui.ubl_plot(lpos.x, lpos.y); // update plot screen
#endif
ui.refresh(); ui.refresh();
float new_z = z_values[lpos.x][lpos.y]; float new_z = z_values[lpos.x][lpos.y];

View File

@ -217,6 +217,28 @@
#define LCD_WIDTH 16 #define LCD_WIDTH 16
#define LCD_HEIGHT 2 #define LCD_HEIGHT 2
#elif EITHER(TFTGLCD_PANEL_SPI, TFTGLCD_PANEL_I2C)
#define IS_TFTGLCD_PANEL 1
#define IS_ULTIPANEL // Note that IS_ULTIPANEL leads to HAS_WIRED_LCD
#if ENABLED(SDSUPPORT) && DISABLED(LCD_PROGRESS_BAR)
#define LCD_PROGRESS_BAR
#endif
#if ENABLED(TFTGLCD_PANEL_I2C)
#define LCD_USE_I2C_BUZZER // Enable buzzer on LCD for I2C and SPI buses (LiquidTWI2 not required)
#define LCD_I2C_ADDRESS 0x27 // Must be equal to panel's I2C slave addres
#endif
#define STD_ENCODER_PULSES_PER_STEP 2
#define STD_ENCODER_STEPS_PER_MENU_ITEM 1
#define LCD_WIDTH 20 // 20 or 24 chars in line
#define LCD_HEIGHT 10 // Character lines
#define LCD_CONTRAST_MIN 127
#define LCD_CONTRAST_MAX 255
#define DEFAULT_LCD_CONTRAST 250
#define CONVERT_TO_EXT_ASCII // Use extended 128-255 symbols from ASCII table.
// At this time present conversion only for cyrillic - bg, ru and uk languages.
// First 7 ASCII symbols in panel font must be replaced with Marlin's special symbols.
#endif #endif
#if ENABLED(IS_RRD_FG_SC) #if ENABLED(IS_RRD_FG_SC)
@ -459,6 +481,8 @@
#define HAS_WIRED_LCD 1 #define HAS_WIRED_LCD 1
#if ENABLED(DOGLCD) #if ENABLED(DOGLCD)
#define HAS_MARLINUI_U8GLIB 1 #define HAS_MARLINUI_U8GLIB 1
#elif IS_TFTGLCD_PANEL
// Neither DOGM nor HD44780. Fully customized interface.
#elif DISABLED(HAS_GRAPHICAL_TFT) #elif DISABLED(HAS_GRAPHICAL_TFT)
#define HAS_MARLINUI_HD44780 1 #define HAS_MARLINUI_HD44780 1
#endif #endif

View File

@ -318,6 +318,10 @@
#define _LCD_CONTRAST_MIN 64 #define _LCD_CONTRAST_MIN 64
#define _LCD_CONTRAST_INIT 128 #define _LCD_CONTRAST_INIT 128
#define _LCD_CONTRAST_MAX 255 #define _LCD_CONTRAST_MAX 255
#elif IS_TFTGLCD_PANEL
#define _LCD_CONTRAST_MIN 0
#define _LCD_CONTRAST_INIT 250
#define _LCD_CONTRAST_MAX 255
#endif #endif
#ifdef _LCD_CONTRAST_INIT #ifdef _LCD_CONTRAST_INIT
@ -2453,7 +2457,7 @@
/** /**
* Buzzer/Speaker * Buzzer/Speaker
*/ */
#if PIN_EXISTS(BEEPER) || EITHER(LCD_USE_I2C_BUZZER, PCA9632_BUZZER) #if PIN_EXISTS(BEEPER) || ANY(LCD_USE_I2C_BUZZER, PCA9632_BUZZER, IS_TFTGLCD_PANEL)
#define HAS_BUZZER 1 #define HAS_BUZZER 1
#if PIN_EXISTS(BEEPER) #if PIN_EXISTS(BEEPER)
#define USE_BEEPER 1 #define USE_BEEPER 1

View File

@ -693,8 +693,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR)
#if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) #if NONE(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
#error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY." #error "LCD_PROGRESS_BAR requires SDSUPPORT or LCD_SET_PROGRESS_MANUALLY."
#elif !HAS_MARLINUI_HD44780 #elif NONE(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
#error "LCD_PROGRESS_BAR requires a character LCD." #error "LCD_PROGRESS_BAR only applies to HD44780 character LCD and TFTGLCD_PANEL_(SPI|I2C)."
#elif HAS_MARLINUI_U8GLIB #elif HAS_MARLINUI_U8GLIB
#error "LCD_PROGRESS_BAR does not apply to graphical displays." #error "LCD_PROGRESS_BAR does not apply to graphical displays."
#elif ENABLED(FILAMENT_LCD_DISPLAY) #elif ENABLED(FILAMENT_LCD_DISPLAY)
@ -2274,7 +2274,9 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
+ ENABLED(TFT_LVGL_UI_FSMC) \ + ENABLED(TFT_LVGL_UI_FSMC) \
+ ENABLED(TFT_LVGL_UI_SPI) \ + ENABLED(TFT_LVGL_UI_SPI) \
+ ENABLED(ANYCUBIC_LCD_I3MEGA) \ + ENABLED(ANYCUBIC_LCD_I3MEGA) \
+ ENABLED(ANYCUBIC_LCD_CHIRON) + ENABLED(ANYCUBIC_LCD_CHIRON) \
+ ENABLED(TFTGLCD_PANEL_SPI) \
+ ENABLED(TFTGLCD_PANEL_I2C)
#error "Please select only one LCD controller option." #error "Please select only one LCD controller option."
#endif #endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Implementation of the LCD display routines for a TFT GLCD displays with external controller.
*/
#include "../../inc/MarlinConfig.h"
#if IS_TFTGLCD_PANEL
#include "../../libs/duration_t.h"
////////////////////////////////////
// Set up button and encode mappings for each panel (into 'buttons' variable)
//
// This is just to map common functions (across different panels) onto the same
// macro name. The mapping is independent of whether the button is directly connected or
// via a shift/i2c register.
////////////////////////////////////
// Create LCD class instance and chipset-specific information
class TFTGLCD {
private:
public:
TFTGLCD();
void clear_buffer();
void setCursor(uint8_t col, uint8_t row);
void write(char c);
void print(const char *line);
void print_line();
void print_screen();
void redraw_screen();
void setContrast(uint16_t contrast);
};
extern TFTGLCD lcd;
#include "../fontutils.h"
#include "../lcdprint.h"
// Use panel encoder - free old encoder pins
#undef BTN_EN1
#undef BTN_EN2
#undef BTN_ENC
#define BTN_EN1 -1
#define BTN_EN2 -1
#define BTN_ENC -1
#ifndef EN_C
#define EN_C 4 //for click
#endif
#endif // IS_TFTGLCD_PANEL

View File

@ -59,10 +59,14 @@ inline float rounded_mesh_value() {
static void _lcd_mesh_fine_tune(PGM_P const msg) { static void _lcd_mesh_fine_tune(PGM_P const msg) {
ui.defer_status_screen(); ui.defer_status_screen();
if (ubl.encoder_diff) { if (ubl.encoder_diff) {
mesh_edit_accumulator += ubl.encoder_diff > 0 ? 0.005f : -0.005f; mesh_edit_accumulator += TERN(IS_TFTGLCD_PANEL,
ubl.encoder_diff * 0.005f / ENCODER_PULSES_PER_STEP,
ubl.encoder_diff > 0 ? 0.005f : -0.005f
);
ubl.encoder_diff = 0; ubl.encoder_diff = 0;
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT); TERN(IS_TFTGLCD_PANEL,,ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
} }
TERN_(IS_TFTGLCD_PANEL, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
if (ui.should_draw()) { if (ui.should_draw()) {
const float rounded_f = rounded_mesh_value(); const float rounded_f = rounded_mesh_value();

View File

@ -506,7 +506,7 @@ bool MarlinUI::get_blink() {
* This is very display-dependent, so the lcd implementation draws this. * This is very display-dependent, so the lcd implementation draws this.
*/ */
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL
millis_t MarlinUI::progress_bar_ms; // = 0 millis_t MarlinUI::progress_bar_ms; // = 0
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
millis_t MarlinUI::expire_status_ms; // = 0 millis_t MarlinUI::expire_status_ms; // = 0
@ -517,7 +517,7 @@ void MarlinUI::status_screen() {
TERN_(HAS_LCD_MENU, ENCODER_RATE_MULTIPLY(false)); TERN_(HAS_LCD_MENU, ENCODER_RATE_MULTIPLY(false));
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL
// //
// HD44780 implements the following message blinking and // HD44780 implements the following message blinking and
@ -915,7 +915,7 @@ void MarlinUI::update() {
const bool encoderPastThreshold = (abs_diff >= epps); const bool encoderPastThreshold = (abs_diff >= epps);
if (encoderPastThreshold || lcd_clicked) { if (encoderPastThreshold || lcd_clicked) {
if (encoderPastThreshold) { if (encoderPastThreshold && TERN1(IS_TFTGLCD_PANEL, !external_control)) {
#if BOTH(HAS_LCD_MENU, ENCODER_RATE_MULTIPLIER) #if BOTH(HAS_LCD_MENU, ENCODER_RATE_MULTIPLIER)
@ -1260,6 +1260,12 @@ void MarlinUI::update() {
TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val; TERN(REPRAPWORLD_KEYPAD, keypad_buttons, buttons) = ~val;
#endif #endif
#if IS_TFTGLCD_PANEL
next_button_update_ms = now + (LCD_UPDATE_INTERVAL / 2);
buttons = slow_buttons;
TERN_(AUTO_BED_LEVELING_UBL, external_encoder());
#endif
} // next_button_update_ms } // next_button_update_ms
#if HAS_ENCODER_WHEEL #if HAS_ENCODER_WHEEL
@ -1331,7 +1337,7 @@ void MarlinUI::update() {
const millis_t ms = millis(); const millis_t ms = millis();
#endif #endif
#if ENABLED(LCD_PROGRESS_BAR) #if ENABLED(LCD_PROGRESS_BAR) && !IS_TFTGLCD_PANEL
progress_bar_ms = ms; progress_bar_ms = ms;
#if PROGRESS_MSG_EXPIRE > 0 #if PROGRESS_MSG_EXPIRE > 0
expire_status_ms = persist ? 0 : ms + PROGRESS_MSG_EXPIRE; expire_status_ms = persist ? 0 : ms + PROGRESS_MSG_EXPIRE;

View File

@ -34,7 +34,7 @@
#if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY) #if EITHER(HAS_LCD_MENU, ULTIPANEL_FEEDMULTIPLY)
#define HAS_ENCODER_ACTION 1 #define HAS_ENCODER_ACTION 1
#endif #endif
#if (!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTONS_EXIST(EN1, EN2) #if ((!HAS_ADC_BUTTONS && ENABLED(NEWPANEL)) || BUTTONS_EXIST(EN1, EN2)) && !IS_TFTGLCD_PANEL
#define HAS_ENCODER_WHEEL 1 #define HAS_ENCODER_WHEEL 1
#endif #endif
#if HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT) #if HAS_ENCODER_WHEEL || ANY_BUTTON(ENC, BACK, UP, DWN, LFT, RT)
@ -45,7 +45,7 @@
#endif #endif
// I2C buttons must be read in the main thread // I2C buttons must be read in the main thread
#if EITHER(LCD_I2C_VIKI, LCD_I2C_PANELOLU2) #if ANY(LCD_I2C_VIKI, LCD_I2C_PANELOLU2, IS_TFTGLCD_PANEL)
#define HAS_SLOW_BUTTONS 1 #define HAS_SLOW_BUTTONS 1
#endif #endif
@ -215,7 +215,7 @@
#endif #endif
#if BUTTON_EXISTS(BACK) || HAS_TOUCH_XPT2046 #if BUTTON_EXISTS(BACK) || EITHER(HAS_TOUCH_XPT2046, IS_TFTGLCD_PANEL)
#define BLEN_D 3 #define BLEN_D 3
#define EN_D _BV(BLEN_D) #define EN_D _BV(BLEN_D)
#define LCD_BACK_CLICKED() (buttons & EN_D) #define LCD_BACK_CLICKED() (buttons & EN_D)

View File

@ -65,7 +65,16 @@
* by redrawing the screen after SD card accesses. * 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_EN1 P3_26
#define BTN_EN2 P3_25 #define BTN_EN2 P3_25
#define BTN_ENC P2_11 #define BTN_ENC P2_11
@ -80,7 +89,8 @@
#define DOGLCD_CS P2_06 #define DOGLCD_CS P2_06
#define DOGLCD_A0 P0_16 #define DOGLCD_A0 P0_16
#endif #endif
#endif
#endif // HAS_WIRED_LCD
// //
// SD Support // SD Support
@ -89,7 +99,7 @@
// requires jumpers on the SKR V1.1 board as documented here: // requires jumpers on the SKR V1.1 board as documented here:
// https://www.facebook.com/groups/505736576548648/permalink/630639874058317/ // https://www.facebook.com/groups/505736576548648/permalink/630639874058317/
#ifndef SDCARD_CONNECTION #ifndef SDCARD_CONNECTION
#if EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY) #if ANY(MKS_MINI_12864, ENDER2_STOCKDISPLAY, IS_TFTGLCD_PANEL)
#define SDCARD_CONNECTION LCD #define SDCARD_CONNECTION LCD
#else #else
#define SDCARD_CONNECTION ONBOARD #define SDCARD_CONNECTION ONBOARD

View File

@ -265,6 +265,14 @@
#error "ADC BUTTONS do not work unmodifed on SKR 1.3, The ADC ports cannot take more than 3.3v." #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 #else // !CR10_STOCKDISPLAY
#define LCD_PINS_RS EXPA1_07_PIN #define LCD_PINS_RS EXPA1_07_PIN

View File

@ -309,6 +309,14 @@
#define XPT2046_Y_OFFSET -285 #define XPT2046_Y_OFFSET -285
#endif #endif
#elif IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS P3_26
#endif
#define SD_DETECT_PIN P1_31
#else #else
#define BTN_ENC P0_28 // (58) open-drain #define BTN_ENC P0_28 // (58) open-drain

View File

@ -217,7 +217,18 @@
* that the garbage/lines are erased immediately after the SD card accesses are completed. * 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 BEEPER_PIN P1_31 // EXP1.1
#define BTN_ENC P1_30 // EXP1.2 #define BTN_ENC P1_30 // EXP1.2
#define BTN_EN1 P3_26 // EXP2.5 #define BTN_EN1 P3_26 // EXP2.5
@ -273,7 +284,7 @@
//#define LCD_SCREEN_ROT_270 //#define LCD_SCREEN_ROT_270
#endif #endif
#endif #endif // HAS_WIRED_LCD
/** /**
* Example for trinamic drivers using the J8 connector on MKs Sbase. * Example for trinamic drivers using the J8 connector on MKs Sbase.

View File

@ -249,6 +249,15 @@
#define LCD_PINS_ENABLE P1_22 #define LCD_PINS_ENABLE P1_22
#define LCD_PINS_D4 P0_17 #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 #else
#define BTN_EN1 P3_25 #define BTN_EN1 P3_25

View File

@ -326,6 +326,15 @@
#define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI) #define LCD_PINS_ENABLE P0_18 // J3-10 & AUX-3 (SID, MOSI)
#define LCD_PINS_D4 P2_06 // J3-8 & AUX-3 (SCK, CLK) #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 #elif HAS_WIRED_LCD
//#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3 //#define SCK_PIN P0_15 // (52) system defined J3-9 & AUX-3

View File

@ -241,7 +241,16 @@
* ----- ----- * ----- -----
* EXP1 EXP2 * 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 BEEPER_PIN P1_31
#define BTN_ENC P1_30 #define BTN_ENC P1_30

View File

@ -111,16 +111,33 @@
#elif HAS_WIRED_LCD #elif HAS_WIRED_LCD
/* /**
The Smoothieboard supports the REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with either * SD Support
a custom cable with breakouts to the pins indicated below or the RRD GLCD Adapter board *
found at http://smoothieware.org/rrdglcdadapter * 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 #define MISO_PIN P0_08 // EXP2 Pin 1 (PB3, SD_MISO)
http://chibidibidiwah.wdfiles.com/local--files/panel/smoothieboard2sd.jpg #define SCK_PIN P0_07 // EXP2 Pin 2 (SD_SCK)
http://smoothieware.org/panel #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) #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
// EXP1 Pins // EXP1 Pins
#define BEEPER_PIN P1_31 // EXP1 Pin 1 #define BEEPER_PIN P1_31 // EXP1 Pin 1
@ -132,24 +149,14 @@
#define BTN_EN2 P3_26 // EXP2 Pin 3 #define BTN_EN2 P3_26 // EXP2 Pin 3
#define BTN_EN1 P3_25 // EXP2 Pin 5 #define BTN_EN1 P3_25 // EXP2 Pin 5
/* #elif IS_TFTGLCD_PANEL
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 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) #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 #else
#error "Marlin's Smoothieboard support cannot drive your LCD." #error "Marlin's Smoothieboard support cannot drive your LCD."
#endif #endif

View File

@ -261,6 +261,9 @@
#if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0 #if defined(TMC_SW_SCK) && TMC_SW_SCK >= 0
REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK) REPORT_NAME_DIGITAL(__LINE__, TMC_SW_SCK)
#endif #endif
#if defined(TFTGLCD_CS) && TFTGLCD_CS >= 0
REPORT_NAME_DIGITAL(__LINE__, TFTGLCD_CS)
#endif
#if PIN_EXISTS(E_MUX0) #if PIN_EXISTS(E_MUX0)
REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN) REPORT_NAME_DIGITAL(__LINE__, E_MUX0_PIN)
#endif #endif

View File

@ -450,6 +450,10 @@
#define LCD_PINS_D6 44 #define LCD_PINS_D6 44
#define LCD_PINS_D7 64 #define LCD_PINS_D7 64
#elif ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS 33
#else #else
#if ENABLED(CR10_STOCKDISPLAY) #if ENABLED(CR10_STOCKDISPLAY)
@ -682,6 +686,10 @@
// Pins only defined for RAMPS_SMART currently // Pins only defined for RAMPS_SMART currently
#elif IS_TFTGLCD_PANEL
#define SD_DETECT_PIN 49
#else #else
// Beeper on AUX-4 // Beeper on AUX-4

View File

@ -279,9 +279,7 @@
#if SD_CONNECTION_IS(ONBOARD) #if SD_CONNECTION_IS(ONBOARD)
#define SD_DETECT_PIN PC4 #define SD_DETECT_PIN PC4
#endif #elif SD_CONNECTION_IS(LCD) && BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050)
#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
#define SD_DETECT_PIN PA15 #define SD_DETECT_PIN PA15
#define SS_PIN PA10 #define SS_PIN PA10
#elif SD_CONNECTION_IS(CUSTOM_CABLE) #elif SD_CONNECTION_IS(CUSTOM_CABLE)

View File

@ -169,8 +169,48 @@
#define FORCE_SOFT_SPI #define FORCE_SOFT_SPI
#define LCD_BACKLIGHT_PIN -1 #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 #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
#endif // HAS_WIRED_LCD #endif // HAS_WIRED_LCD
@ -227,9 +267,7 @@
#if SD_CONNECTION_IS(ONBOARD) #if SD_CONNECTION_IS(ONBOARD)
#define SD_DETECT_PIN PC4 #define SD_DETECT_PIN PC4
#endif #elif SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
#if BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) && SD_CONNECTION_IS(LCD)
#define SD_DETECT_PIN PB5 #define SD_DETECT_PIN PB5
#define SS_PIN PA10 #define SS_PIN PA10
#elif SD_CONNECTION_IS(CUSTOM_CABLE) #elif SD_CONNECTION_IS(CUSTOM_CABLE)

View File

@ -123,6 +123,17 @@
#define LCD_PINS_ENABLE PC14 #define LCD_PINS_ENABLE PC14
#define LCD_PINS_D4 PB7 #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 #else
#define LCD_PINS_RS PC12 #define LCD_PINS_RS PC12

View File

@ -115,6 +115,12 @@
#define DOGLCD_SCK PB13 #define DOGLCD_SCK PB13
#define DOGLCD_MOSI PB15 #define DOGLCD_MOSI PB15
#elif IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS PB11
#endif
#else // !MKS_MINI_12864 #else // !MKS_MINI_12864
#define LCD_PINS_D4 PA6 #define LCD_PINS_D4 PA6

View File

@ -356,6 +356,19 @@
#define DOGLCD_SCK PA5 #define DOGLCD_SCK PA5
#define DOGLCD_MOSI PA7 #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 #else // !MKS_MINI_12864
#define LCD_PINS_D4 PE14 #define LCD_PINS_D4 PE14

View File

@ -225,6 +225,12 @@
#define BTN_EN2 PG4 #define BTN_EN2 PG4
#endif #endif
#elif IS_TFTGLCD_PANEL
#if ENABLED(TFTGLCD_PANEL_SPI)
#define TFTGLCD_CS PG5
#endif
#elif HAS_WIRED_LCD #elif HAS_WIRED_LCD
#define BEEPER_PIN PC5 #define BEEPER_PIN PC5
@ -254,6 +260,7 @@
#endif #endif
#endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY #endif // !MKS_MINI_12864 && !ENDER2_STOCKDISPLAY
#endif #endif
#ifndef BOARD_ST7920_DELAY_1 #ifndef BOARD_ST7920_DELAY_1

View File

@ -286,7 +286,14 @@
// //
// LCDs and Controllers // 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 BEEPER_PIN PG4
#define BTN_ENC PA8 #define BTN_ENC PA8

View File

@ -26,6 +26,20 @@ opt_enable VIKI2 SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \
opt_set GRID_MAX_POINTS_X 16 opt_set GRID_MAX_POINTS_X 16
exec_test $1 $2 "Smoothieboard with many features" exec_test $1 $2 "Smoothieboard with many features"
restore_configs
opt_set MOTHERBOARD BOARD_SMOOTHIEBOARD
opt_set EXTRUDERS 2
opt_set TEMP_SENSOR_1 -1
opt_set TEMP_SENSOR_BED 5
opt_enable TFTGLCD_PANEL_SPI SDSUPPORT ADAPTIVE_FAN_SLOWING NO_FAN_SLOWING_IN_PID_TUNING \
FIX_MOUNTED_PROBE AUTO_BED_LEVELING_BILINEAR G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET \
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
LCD_INFO_MENU ARC_SUPPORT BEZIER_CURVE_SUPPORT EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES SDCARD_SORT_ALPHA EMERGENCY_PARSER
opt_set GRID_MAX_POINTS_X 16
exec_test $1 $2 "Smoothieboard with TFTGLCD_PANEL_SPI"
#restore_configs #restore_configs
#opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI #opt_set MOTHERBOARD BOARD_AZTEEG_X5_MINI_WIFI
#opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \ #opt_enable COREYX USE_XMAX_PLUG DAC_MOTOR_CURRENT_DEFAULT \

View File

@ -26,7 +26,7 @@ include_dir = Marlin
# #
[common] [common]
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared> default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
-<src/lcd/HD44780> -<src/lcd/dwin> -<src/lcd/dogm> -<src/lcd/tft> -<src/lcd/HD44780> -<src/lcd/TFTGLCD> -<src/lcd/dwin> -<src/lcd/dogm> -<src/lcd/tft>
-<src/lcd/menu> -<src/lcd/menu>
-<src/lcd/menu/game/game.cpp> -<src/lcd/menu/game/brickout.cpp> -<src/lcd/menu/game/invaders.cpp> -<src/lcd/menu/game/game.cpp> -<src/lcd/menu/game/brickout.cpp> -<src/lcd/menu/game/invaders.cpp>
-<src/lcd/menu/game/maze.cpp> -<src/lcd/menu/game/snake.cpp> -<src/lcd/menu/game/maze.cpp> -<src/lcd/menu/game/snake.cpp>
@ -216,6 +216,7 @@ HAS_MARLINUI_U8GLIB = U8glib-HAL@~0.4.1
src_filter=+<src/lcd/dogm> src_filter=+<src/lcd/dogm>
HAS_GRAPHICAL_TFT = src_filter=+<src/lcd/tft> HAS_GRAPHICAL_TFT = src_filter=+<src/lcd/tft>
DWIN_CREALITY_LCD = src_filter=+<src/lcd/dwin> DWIN_CREALITY_LCD = src_filter=+<src/lcd/dwin>
IS_TFTGLCD_PANEL = src_filter=+<src/lcd/TFTGLCD>
HAS_LCD_MENU = src_filter=+<src/lcd/menu> HAS_LCD_MENU = src_filter=+<src/lcd/menu>
HAS_GAMES = src_filter=+<src/lcd/menu/game/game.cpp> HAS_GAMES = src_filter=+<src/lcd/menu/game/game.cpp>
MARLIN_BRICKOUT = src_filter=+<src/lcd/menu/game/brickout.cpp> MARLIN_BRICKOUT = src_filter=+<src/lcd/menu/game/brickout.cpp>