diff --git a/Marlin/src/pins/lcd/REPRAPWORLD_GRAPHICAL_LCD.h b/Marlin/src/pins/lcd/REPRAPWORLD_GRAPHICAL_LCD.h new file mode 100644 index 000000000000..f5f435ad7402 --- /dev/null +++ b/Marlin/src/pins/lcd/REPRAPWORLD_GRAPHICAL_LCD.h @@ -0,0 +1,47 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (c) 2023 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 . + * + */ +#pragma once + +/** + * pins/lcd/REPRAPWORLD_GRAPHICAL_LCD.h + */ + +/** + * https://reprapworld.com/electronics/autonomous-printing/smart-controller-graphical-lcd-12864-lcd/ + * + * RRW GLCD Headers UT 2 4 6 PWR - + + * 1 3 5 + * + * AUX1 1 2 MTICSP 2 4 6 8 10 SDOUT 2 4 6 8 + * 3 4 1 3 5 7 9 1 3 5 7 + * 5 6 + * 7 8 + * KEYPAD 2 4 6 8 10 SPI 2 4 6 8 + * 1 3 5 7 9 1 3 5 7 + */ + +// DOGLCD IS_U8GLIB_ST7920 IS_ULTIPANEL HAS_WIRED_LCD IS_NEWPANEL HAS_MARLINUI_MENU + +// REPRAPWORLD_GRAPHICAL_LCD connects to AUX2 and AUX3 on RAMPS. Other boards vary. +#ifndef LCD_PINS_EN + #error "REPRAPWORLD_GRAPHICAL_LCD connection is not defined for your MOTHERBOARD." +#endif diff --git a/Marlin/src/pins/pins_lcd.h b/Marlin/src/pins/pins_lcd.h index e4ecc853d456..25341d4de559 100644 --- a/Marlin/src/pins/pins_lcd.h +++ b/Marlin/src/pins/pins_lcd.h @@ -47,6 +47,8 @@ #include "lcd/FYSETC_MINI_12864.h" #elif ENABLED(ULTI_CONTROLLER) #include "lcd/ULTI_CONTROLLER.h" + #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + #include "lcd/REPRAPWORLD_GRAPHICAL_LCD.h" #elif IS_RRD_FG_SC #include "lcd/RRD_FG_SC.h" #elif IS_RRD_SC diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h index 97ee20a515d6..fc3542746cdb 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h @@ -211,6 +211,20 @@ // Migrated to pins/lcd +#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TODO: Define an adapter + + //#define BTN_ENC 55 + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + + //#define LCD_PINS_RS EXP2_10_PIN // CS + //#define LCD_PINS_EN EXP2_06_PIN // MOSI + //#define LCD_PINS_D4 EXP2_02_PIN // SCK + + //#define SD_DETECT_PIN EXP2_05_PIN + #elif IS_RRD_SC // Migrated to pins/lcd @@ -240,13 +254,6 @@ #define NO_SPEAKER #endif - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - // TO TEST - //#define LCD_PINS_RS EXP2_10_PIN // CS chip select /SS chip slave select - //#define LCD_PINS_EN EXP2_06_PIN // SID (MOSI) - //#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock - #elif ALL(IS_NEWPANEL, PANEL_ONE) // TO TEST @@ -314,15 +321,7 @@ // #if IS_NEWPANEL - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - // TO TEST - //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 - //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 - //#define BTN_ENC 55 - //#define SD_DETECT_PIN EXP2_05_PIN - - #elif ENABLED(LCD_I2C_PANELOLU2) + #if ENABLED(LCD_I2C_PANELOLU2) // TO TEST //#define BTN_EN1 47 diff --git a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h index 80f1288eab20..63a260a186aa 100644 --- a/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h +++ b/Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h @@ -267,6 +267,20 @@ // Migrated to pins/lcd +#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TODO: Define an adapter + + //#define BTN_ENC 55 + //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 + //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 + + //#define LCD_PINS_RS EXP2_10_PIN // CS + //#define LCD_PINS_EN EXP2_06_PIN // MOSI + //#define LCD_PINS_D4 EXP2_02_PIN // SCK + + //#define SD_DETECT_PIN EXP2_05_PIN + #elif IS_RRD_SC // Migrated to pins/lcd @@ -293,13 +307,6 @@ #define NO_SPEAKER #endif - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - // TO TEST - //#define LCD_PINS_RS EXP2_10_PIN // CS chip select /SS chip slave select - //#define LCD_PINS_EN EXP2_06_PIN // SID (MOSI) - //#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock - #elif ALL(IS_NEWPANEL, PANEL_ONE) // TO TEST @@ -367,15 +374,7 @@ // #if IS_NEWPANEL - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - // TO TEST - //#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56 - //#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72 - //#define BTN_ENC 55 - //#define SD_DETECT_PIN EXP2_05_PIN - - #elif ENABLED(LCD_I2C_PANELOLU2) + #if ENABLED(LCD_I2C_PANELOLU2) // TO TEST //#define BTN_EN1 47 diff --git a/Marlin/src/pins/samd/pins_MINITRONICS20.h b/Marlin/src/pins/samd/pins_MINITRONICS20.h index 5c9499225cc9..32a5d5f4e59f 100644 --- a/Marlin/src/pins/samd/pins_MINITRONICS20.h +++ b/Marlin/src/pins/samd/pins_MINITRONICS20.h @@ -183,6 +183,18 @@ // Migrated to pins/lcd +#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TODO: Define an adapter + + #define BTN_ENC 23 + #define BTN_EN1 27 + #define BTN_EN2 33 + + #define LCD_PINS_RS 18 // CS + #define LCD_PINS_EN MOSI // MOSI + #define LCD_PINS_D4 SCK // SCK + #elif IS_RRD_SC // Migrated to pins/lcd @@ -193,17 +205,7 @@ // LCD Display output pins // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS 18 // CS chip select /SS chip slave select - #define LCD_PINS_EN MOSI // SID (MOSI) - #define LCD_PINS_D4 SCK // SCK (CLK) clock - - #define BTN_ENC 23 - #define BTN_EN1 27 - #define BTN_EN2 33 - - #elif ALL(IS_NEWPANEL, PANEL_ONE) + #if ALL(IS_NEWPANEL, PANEL_ONE) // TO TEST //#define LCD_PINS_RS EXP1_02_PIN diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 7e8169191c47..fafe2006b243 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -458,6 +458,22 @@ // Migrated to pins/lcd +#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TODO: Define an adapter + + #define BTN_ENC AUX2_04 + #define BTN_EN1 AUX2_05 + #define BTN_EN2 AUX2_03 + + #define LCD_PINS_RS EXP2_07_PIN // CS + #define LCD_PINS_EN EXP2_06_PIN // MOSI + #define LCD_PINS_D4 EXP2_02_PIN // SCK + + #ifndef SD_DETECT_PIN + #define SD_DETECT_PIN AUX2_08 + #endif + #elif IS_RRD_SC // Migrated to pins/lcd @@ -473,13 +489,7 @@ // // LCD Display output pins // - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select - #define LCD_PINS_EN EXP2_06_PIN // SID (MOSI) - #define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock - - #elif ALL(IS_NEWPANEL, PANEL_ONE) + #if ALL(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS AUX2_06 #define LCD_PINS_EN AUX2_08 @@ -555,16 +565,7 @@ // #if IS_NEWPANEL - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 AUX2_05 - #define BTN_EN2 AUX2_03 - #define BTN_ENC AUX2_04 - #ifndef SD_DETECT_PIN - #define SD_DETECT_PIN AUX2_08 - #endif - - #elif ENABLED(LCD_I2C_PANELOLU2) + #if ENABLED(LCD_I2C_PANELOLU2) #define BTN_EN1 AUX4_04 #define BTN_EN2 AUX4_06 diff --git a/Marlin/src/pins/stm32f1/pins_CHITU3D.h b/Marlin/src/pins/stm32f1/pins_CHITU3D.h index 2074bbeccec1..d52c7ec75f1c 100644 --- a/Marlin/src/pins/stm32f1/pins_CHITU3D.h +++ b/Marlin/src/pins/stm32f1/pins_CHITU3D.h @@ -98,13 +98,21 @@ // // LCD Pins // -#if HAS_WIRED_LCD +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #define LCD_PINS_RS PD1 // 49 // CS chip select /SS chip slave select - #define LCD_PINS_EN PD3 // 51 // SID (MOSI) - #define LCD_PINS_D4 PD4 // 52 // SCK (CLK) clock - #elif ALL(IS_NEWPANEL, PANEL_ONE) + #define BTN_ENC PD15 + #define BTN_EN1 PE0 + #define BTN_EN2 PD11 + + #define LCD_PINS_RS PD1 // CS + #define LCD_PINS_EN PD3 // MOSI + #define LCD_PINS_D4 PD4 // SCK + + #define SD_DETECT_PIN PC10 + +#elif HAS_WIRED_LCD + + #if ALL(IS_NEWPANEL, PANEL_ONE) #define LCD_PINS_RS PB8 #define LCD_PINS_EN PD2 #define LCD_PINS_D4 PB12 @@ -146,13 +154,6 @@ #define LCD_BACKLIGHT_PIN PC7 // 39 #endif - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - - #define BTN_EN1 PE0 // 64 - #define BTN_EN2 PD11 // 59 - #define BTN_ENC PD15 // 63 - #define SD_DETECT_PIN PC10 // 42 - #elif ENABLED(LCD_I2C_PANELOLU2) #define BTN_EN1 PC15 // 47 diff --git a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h index e5b16460f010..7fd6394fde38 100644 --- a/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h +++ b/Marlin/src/pins/stm32f1/pins_STM3R_MINI.h @@ -110,10 +110,12 @@ // // LCD Pins // -#if HAS_WIRED_LCD +#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) + + // TODO: Define an adapter + +#elif HAS_WIRED_LCD - #if ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #else #define LCD_PINS_RS PB8 #define LCD_PINS_EN PD2 @@ -138,8 +140,6 @@ #if IS_RRD_SC #error "RRD Smart Controller is not supported." - #elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) - #error "REPRAPWORLD_GRAPHICAL_LCD is not supported." #elif ENABLED(LCD_I2C_PANELOLU2) #error "LCD_I2C_PANELOLU2 is not supported." #elif ENABLED(LCD_I2C_VIKI)