Skip to content

Commit

Permalink
♻️ Migrate REPRAPWORLD_GRAPHICAL_LCD
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 24, 2024
1 parent 8d70ce2 commit 1157c17
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 78 deletions.
47 changes: 47 additions & 0 deletions Marlin/src/pins/lcd/REPRAPWORLD_GRAPHICAL_LCD.h
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*
*/
#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
2 changes: 2 additions & 0 deletions Marlin/src/pins/pins_lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 15 additions & 16 deletions Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
31 changes: 15 additions & 16 deletions Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 13 additions & 11 deletions Marlin/src/pins/samd/pins_MINITRONICS20.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
35 changes: 18 additions & 17 deletions Marlin/src/pins/samd/pins_RAMPS_144.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
27 changes: 14 additions & 13 deletions Marlin/src/pins/stm32f1/pins_CHITU3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/pins/stm32f1/pins_STM3R_MINI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 1157c17

Please sign in to comment.