Skip to content

Commit 84a704e

Browse files
committed
♻️ Migrate REPRAPWORLD_GRAPHICAL_LCD
1 parent 4d28780 commit 84a704e

File tree

8 files changed

+239
-194
lines changed

8 files changed

+239
-194
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
/**
25+
* pins/lcd/REPRAPWORLD_GRAPHICAL_LCD.h
26+
*/
27+
28+
/**
29+
* https://reprapworld.com/electronics/autonomous-printing/smart-controller-graphical-lcd-12864-lcd/
30+
*
31+
* RRW GLCD Headers UT 2 4 6 PWR - +
32+
* 1 3 5
33+
*
34+
* AUX1 1 2 MTICSP 2 4 6 8 10 SDOUT 2 4 6 8
35+
* 3 4 1 3 5 7 9 1 3 5 7
36+
* 5 6
37+
* 7 8
38+
* KEYPAD 2 4 6 8 10 SPI 2 4 6 8
39+
* 1 3 5 7 9 1 3 5 7
40+
*/
41+
42+
// DOGLCD IS_U8GLIB_ST7920 IS_ULTIPANEL HAS_WIRED_LCD IS_NEWPANEL HAS_MARLINUI_MENU
43+
44+
/**
45+
* REPRAPWORLD_GRAPHICAL_LCD connects to AUX2 and AUX3 on RAMPS. Other boards vary.
46+
*
47+
* Pins that must be minimally defined for this display:
48+
* LCD_PINS_EN LCD_PINS_RS LCD_PINS_D4
49+
*/
50+
#if !defined(LCD_PINS_EN) || !defined(LCD_PINS_RS) || !defined(LCD_PINS_D5) || LCD_PINS_EN < 0 || LCD_PINS_RS < 0 || LCD_PINS_D5 < 0
51+
#error "REPRAPWORLD_GRAPHICAL_LCD connection is not defined for your MOTHERBOARD."
52+
#endif

Marlin/src/pins/pins_lcd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
#include "lcd/FYSETC_242_OLED_12864.h"
5050
#elif ENABLED(ULTI_CONTROLLER)
5151
#include "lcd/ULTI_CONTROLLER.h"
52+
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
53+
#include "lcd/REPRAPWORLD_GRAPHICAL_LCD.h"
5254
#elif IS_RRD_FG_SC
5355
#include "lcd/RRD_FG_SC.h"
5456
#elif IS_RRD_SC

Marlin/src/pins/samd/pins_BRICOLEMON_LITE_V1_0.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,20 @@
222222

223223
// Migrated to pins/lcd
224224

225+
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
226+
227+
// TODO: Define an adapter
228+
229+
//#define BTN_ENC 55
230+
//#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56
231+
//#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72
232+
233+
//#define LCD_PINS_RS EXP2_10_PIN // CS
234+
//#define LCD_PINS_EN EXP2_06_PIN // MOSI
235+
//#define LCD_PINS_D4 EXP2_02_PIN // SCK
236+
237+
//#define SD_DETECT_PIN EXP2_05_PIN
238+
225239
#elif IS_RRD_SC
226240

227241
// Migrated to pins/lcd
@@ -251,13 +265,6 @@
251265
#define NO_SPEAKER
252266
#endif
253267

254-
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
255-
256-
// TO TEST
257-
//#define LCD_PINS_RS EXP2_10_PIN // CS chip select /SS chip slave select
258-
//#define LCD_PINS_EN EXP2_06_PIN // SID (MOSI)
259-
//#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock
260-
261268
#elif ALL(IS_NEWPANEL, PANEL_ONE)
262269

263270
// TO TEST
@@ -325,15 +332,7 @@
325332
//
326333
#if IS_NEWPANEL
327334

328-
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
329-
330-
// TO TEST
331-
//#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56
332-
//#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72
333-
//#define BTN_ENC 55
334-
//#define SD_DETECT_PIN EXP2_05_PIN
335-
336-
#elif ENABLED(LCD_I2C_PANELOLU2)
335+
#if ENABLED(LCD_I2C_PANELOLU2)
337336

338337
// TO TEST
339338
//#define BTN_EN1 47

Marlin/src/pins/samd/pins_BRICOLEMON_V1_0.h

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,20 @@
250250

251251
// Migrated to pins/lcd
252252

253+
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
254+
255+
// TODO: Define an adapter
256+
257+
//#define BTN_ENC 55
258+
//#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56
259+
//#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72
260+
261+
//#define LCD_PINS_RS EXP2_10_PIN // CS
262+
//#define LCD_PINS_EN EXP2_06_PIN // MOSI
263+
//#define LCD_PINS_D4 EXP2_02_PIN // SCK
264+
265+
//#define SD_DETECT_PIN EXP2_05_PIN
266+
253267
#elif IS_RRD_SC
254268

255269
// Migrated to pins/lcd
@@ -276,13 +290,6 @@
276290
#define NO_SPEAKER
277291
#endif
278292

279-
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
280-
281-
// TO TEST
282-
//#define LCD_PINS_RS EXP2_10_PIN // CS chip select /SS chip slave select
283-
//#define LCD_PINS_EN EXP2_06_PIN // SID (MOSI)
284-
//#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock
285-
286293
#elif ALL(IS_NEWPANEL, PANEL_ONE)
287294

288295
// TO TEST
@@ -350,15 +357,7 @@
350357
//
351358
#if IS_NEWPANEL
352359

353-
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
354-
355-
// TO TEST
356-
//#define BTN_EN1 56 // Mega/Due:64 - AGCM4:56
357-
//#define BTN_EN2 72 // Mega/Due:59 - AGCM4:72
358-
//#define BTN_ENC 55
359-
//#define SD_DETECT_PIN EXP2_05_PIN
360-
361-
#elif ENABLED(LCD_I2C_PANELOLU2)
360+
#if ENABLED(LCD_I2C_PANELOLU2)
362361

363362
// TO TEST
364363
//#define BTN_EN1 47

Marlin/src/pins/samd/pins_MINITRONICS20.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,18 @@
190190

191191
// Migrated to pins/lcd
192192

193+
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
194+
195+
// TODO: Define an adapter
196+
197+
#define BTN_ENC 23
198+
#define BTN_EN1 27
199+
#define BTN_EN2 33
200+
201+
#define LCD_PINS_RS 18 // CS
202+
#define LCD_PINS_EN MOSI // MOSI
203+
#define LCD_PINS_D4 SCK // SCK
204+
193205
#elif IS_RRD_SC
194206

195207
// Migrated to pins/lcd
@@ -200,17 +212,7 @@
200212
// LCD Display output pins
201213
//
202214

203-
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
204-
205-
#define LCD_PINS_RS 18 // CS chip select /SS chip slave select
206-
#define LCD_PINS_EN MOSI // SID (MOSI)
207-
#define LCD_PINS_D4 SCK // SCK (CLK) clock
208-
209-
#define BTN_ENC 23
210-
#define BTN_EN1 27
211-
#define BTN_EN2 33
212-
213-
#elif ALL(IS_NEWPANEL, PANEL_ONE)
215+
#if ALL(IS_NEWPANEL, PANEL_ONE)
214216

215217
// TO TEST
216218
//#define LCD_PINS_RS EXP1_02_PIN

Marlin/src/pins/samd/pins_RAMPS_144.h

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,22 @@
434434

435435
// Migrated to pins/lcd
436436

437+
#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
438+
439+
// TODO: Define an adapter
440+
441+
#define BTN_ENC AUX2_04
442+
#define BTN_EN1 AUX2_05
443+
#define BTN_EN2 AUX2_03
444+
445+
#define LCD_PINS_RS EXP2_07_PIN // CS
446+
#define LCD_PINS_EN EXP2_06_PIN // MOSI
447+
#define LCD_PINS_D4 EXP2_02_PIN // SCK
448+
449+
#ifndef SD_DETECT_PIN
450+
#define SD_DETECT_PIN AUX2_08
451+
#endif
452+
437453
#elif IS_RRD_SC
438454

439455
// Migrated to pins/lcd
@@ -449,13 +465,7 @@
449465
//
450466
// LCD Display output pins
451467
//
452-
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
453-
454-
#define LCD_PINS_RS EXP2_07_PIN // CS chip select /SS chip slave select
455-
#define LCD_PINS_EN EXP2_06_PIN // SID (MOSI)
456-
#define LCD_PINS_D4 EXP2_02_PIN // SCK (CLK) clock
457-
458-
#elif ALL(IS_NEWPANEL, PANEL_ONE)
468+
#if ALL(IS_NEWPANEL, PANEL_ONE)
459469

460470
#define LCD_PINS_RS AUX2_06
461471
#define LCD_PINS_EN AUX2_08
@@ -531,16 +541,7 @@
531541
//
532542
#if IS_NEWPANEL
533543

534-
#if ENABLED(REPRAPWORLD_GRAPHICAL_LCD)
535-
536-
#define BTN_EN1 AUX2_05
537-
#define BTN_EN2 AUX2_03
538-
#define BTN_ENC AUX2_04
539-
#ifndef SD_DETECT_PIN
540-
#define SD_DETECT_PIN AUX2_08
541-
#endif
542-
543-
#elif ENABLED(LCD_I2C_PANELOLU2)
544+
#if ENABLED(LCD_I2C_PANELOLU2)
544545

545546
#define BTN_EN1 AUX4_04
546547
#define BTN_EN2 AUX4_06

0 commit comments

Comments
 (0)