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 Apr 8, 2023
1 parent 4472762 commit 84194bf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
3 changes: 3 additions & 0 deletions Marlin/src/lcd/dogm/marlinui_DOGM.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@
// RepRapWorld Graphical LCD

#if DISABLED(SDSUPPORT) && (LCD_PINS_D4 == SD_SCK_PIN) && (LCD_PINS_EN == SD_MOSI_PIN)
// Hardware SPI shared with SD Card
#define U8G_CLASS U8GLIB_ST7920_128X64_4X_HAL
#define U8G_PARAM LCD_PINS_RS
#elif ENABLED(SDSUPPORT) && __SAMD21__
// Hardware SPI on DUE
#define U8G_CLASS U8GLIB_ST7920_128X64_4X
#define U8G_PARAM LCD_PINS_RS
#else
// Software SPI
#define U8G_CLASS U8GLIB_ST7920_128X64_4X
#define U8G_PARAM LCD_PINS_D4, LCD_PINS_EN, LCD_PINS_RS
#endif
Expand Down
21 changes: 21 additions & 0 deletions Marlin/src/pins/pins_lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,27 @@

#endif

#elif ENABLED(REPRAPWORLD_GRAPHICAL_LCD) && !defined(LCD_PINS_EN)

// 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 AUX3_02
#error "REPRAPWORLD_GRAPHICAL_LCD connection is not defined for your MOTHERBOARD."
#endif

#define LCD_PINS_RS AUX3_02 // CS chip select /SS chip slave select
#define LCD_PINS_EN AUX3_04 // SID (MOSI)
#define LCD_PINS_D4 AUX3_05 // SCK (CLK) clock

#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

#else

// More displays to come
Expand Down
11 changes: 2 additions & 9 deletions Marlin/src/pins/ramps/pins_RAMPS.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,7 @@
//
#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
// Migrated to pins_lcd.h

#elif BOTH(IS_NEWPANEL, PANEL_ONE)

Expand Down Expand Up @@ -700,12 +698,7 @@

#elif 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
// Migrated to pins_lcd.h

#elif ENABLED(LCD_I2C_PANELOLU2)

Expand Down
14 changes: 4 additions & 10 deletions Marlin/src/pins/samd/pins_RAMPS_144.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@
#define AUX4_18 16

/**
* LCD adapters come in different variants.
* LCD adapters come in different variants. The socket keys can be
* on either side, and may be backwards on some boards / displays.
*/
#ifndef EXP1_08_PIN

Expand Down Expand Up @@ -415,9 +416,7 @@
//
#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
// Migrated to pins_lcd.h

#elif BOTH(IS_NEWPANEL, PANEL_ONE)

Expand Down Expand Up @@ -518,12 +517,7 @@

#elif 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
// Migrated to pins_lcd.h

#elif ENABLED(LCD_I2C_PANELOLU2)

Expand Down

0 comments on commit 84194bf

Please sign in to comment.