Skip to content

Commit

Permalink
Update YHCB2004 LCD support
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 18, 2023
1 parent 2f3bc21 commit f860a6c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 24 deletions.
18 changes: 17 additions & 1 deletion Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,23 @@

#elif ENABLED(YHCB2004)

LCD_CLASS lcd(YHCB2004_CLK, 20, 4, YHCB2004_MOSI, YHCB2004_MISO); // CLK, cols, rows, MOSI, MISO
#ifndef YHCB2004_SS_PIN
#define YHCB2004_SS_PIN SS
#endif
#ifndef YHCB2004_SCK_PIN
#define YHCB2004_SCK_PIN SCK
#endif
#ifndef YHCB2004_MOSI_PIN
#define YHCB2004_MOSI_PIN MOSI
#endif
#ifndef YHCB2004_MISO_PIN
#define YHCB2004_MISO_PIN MISO
#endif
#if !PINS_EXIST(YHCB2004_SS, YHCB2004_SCK, YHCB2004_MOSI, YHCB2004_MISO)
#error "YHCB2004 display requires YHCB2004_SS_PIN, YHCB2004_SCK_PIN, YHCB2004_MOSI_PIN, and YHCB2004_MISO_PIN."
#endif

LCD_CLASS lcd(YHCB2004_SS_PIN, 20, 4, YHCB2004_SCK_PIN, YHCB2004_MOSI_PIN, YHCB2004_MISO_PIN); // SS, cols, rows, SCK, MOSI, MISO

#else

Expand Down
16 changes: 4 additions & 12 deletions Marlin/src/pins/mega/pins_GT2560_V3.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,10 @@
#define BEEPER_PIN 18

#if ENABLED(YHCB2004)
#ifndef YHCB2004_CLK
#define YHCB2004_CLK 5
#define DIO52 YHCB2004_CLK
#endif
#ifndef YHCB2004_MOSI
#define YHCB2004_MOSI 21
#define DIO50 YHCB2004_MOSI
#endif
#ifndef YHCB2004_MISO
#define YHCB2004_MISO 36
#define DIO51 YHCB2004_MISO
#endif
#define YHCB2004_MOSI_PIN 21
#define YHCB2004_MISO_PIN 36
#define YHCB2004_SCK_PIN 5
#define YHCB2004_SS_PIN SS
#elif HAS_WIRED_LCD
#ifndef LCD_PINS_RS
#define LCD_PINS_RS 20
Expand Down
14 changes: 9 additions & 5 deletions Marlin/src/pins/mega/pins_GT2560_V3_A20.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
* ATmega2560
*/

#define LCD_PINS_RS 5
#define LCD_PINS_EN 36
#define LCD_PINS_D4 21
#define LCD_PINS_D7 6
#if HAS_WIRED_LCD
#define LCD_PINS_RS 5
#define LCD_PINS_EN 36
#define LCD_PINS_D4 21
#define LCD_PINS_D7 6
#endif

#define SPEAKER // The speaker can produce tones
#ifndef SPEAKER
#define SPEAKER // The speaker can produce tones
#endif

#if IS_NEWPANEL
#define BTN_EN1 16
Expand Down
14 changes: 9 additions & 5 deletions Marlin/src/pins/mega/pins_GT2560_V4_A20.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@

#define BOARD_INFO_NAME "GT2560 4.x"

#define LCD_PINS_RS 5
#define LCD_PINS_EN 36
#define LCD_PINS_D4 21
#define LCD_PINS_D7 6
#if HAS_WIRED_LCD
#define LCD_PINS_RS 5
#define LCD_PINS_EN 36
#define LCD_PINS_D4 21
#define LCD_PINS_D7 6
#endif

#define SPEAKER // The speaker can produce tones
#ifndef SPEAKER
#define SPEAKER // The speaker can produce tones
#endif

#if IS_NEWPANEL
#define BTN_EN1 16
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/stm32f4/pins_BLACKPILL_CUSTOM.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
//#define SDIO_SUPPORT
#define NO_SD_HOST_DRIVE // This board's SD is only seen by the printer

#if SD_CONNECTION_IS(ONBOARD)
#if SD_CONNECTION_IS(ONBOARD)
#define SDSS PA4
#define SD_SCK_PIN PA5
#define SD_MISO_PIN PA6
Expand Down

0 comments on commit f860a6c

Please sign in to comment.