Skip to content

Commit

Permalink
♻️ Migrate LCD pins to EXP
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 8, 2023
1 parent 56f2da8 commit 0465771
Show file tree
Hide file tree
Showing 47 changed files with 1,335 additions and 1,323 deletions.
1 change: 1 addition & 0 deletions Marlin/src/HAL/AVR/fastio/fastio_1280.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Hardware Pin : 02 03 06 07 01 05 15 16 17 18 23 24 25 26 64 63 13 12 46 45 44 43 78 77 76 75 74 73 72 71 60 59 58 57 56 55 54 53 50 70 52 51 42 41 40 39 38 37 36 35 22 21 20 19 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 | 04 08 09 10 11 14 27 28 29 30 31 32 33 34 47 48 49 61 62 65 66 67 68 69 79 80 81 98 99 100
* Port : E0 E1 E4 E5 G5 E3 H3 H4 H5 H6 B4 B5 B6 B7 J1 J0 H1 H0 D3 D2 D1 D0 A0 A1 A2 A3 A4 A5 A6 A7 C7 C6 C5 C4 C3 C2 C1 C0 D7 G2 G1 G0 L7 L6 L5 L4 L3 L2 L1 L0 B3 B2 B1 B0 F0 F1 F2 F3 F4 F5 F6 F7 K0 K1 K2 K3 K4 K5 K6 K7 | E2 E6 E7 xx xx H2 H7 G3 G4 xx xx xx xx xx D4 D5 D6 xx xx J2 J3 J4 J5 J6 J7 xx xx xx xx xx
* Logical Pin : 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 78 79 80 xx xx 84 85 71 70 xx xx xx xx xx 81 82 83 xx xx 72 73 75 76 77 74 xx xx xx xx xx
* Analog Input : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*
* Arduino Pin Layout video: https://youtu.be/rIqeVCX09FA
* AVR alternate pin function overview video: https://youtu.be/1yd8wuI5Plg
Expand Down
99 changes: 43 additions & 56 deletions Marlin/src/pins/linux/pins_RAMPS_LINUX.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,22 @@
// LCDs and Controllers //
//////////////////////////

#if ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)
#if ENABLED(CR10_STOCKDISPLAY)

// Migrated to pins_lcd.h

#define EXP1_01_PIN 37
#define EXP1_02_PIN 35
#define EXP1_03_PIN 17
#define EXP1_05_PIN 23
#define EXP1_06_PIN 25
#define EXP1_07_PIN 27
#define EXP1_08_PIN 29

#define SD_DETECT_PIN 49
#define KILL_PIN 41

#elif ANY(TFT_COLOR_UI, TFT_CLASSIC_UI, TFT_LVGL_UI)

#define TFT_A0_PIN 43
#define TFT_CS_PIN 49
Expand Down Expand Up @@ -486,60 +501,37 @@
#define LCD_PINS_D6 44
#define LCD_PINS_D7 64

#else

#if ENABLED(CR10_STOCKDISPLAY)
#elif ENABLED(ZONESTAR_LCD)

#define LCD_PINS_RS 27
#define LCD_PINS_ENABLE 29
#define LCD_PINS_D4 25
#define LCD_PINS_RS 64
#define LCD_PINS_ENABLE 44
#define LCD_PINS_D4 63
#define LCD_PINS_D5 40
#define LCD_PINS_D6 42
#define LCD_PINS_D7 65

#if !IS_NEWPANEL
#define BEEPER_PIN 37
#endif

#elif ENABLED(ZONESTAR_LCD)

#define LCD_PINS_RS 64
#define LCD_PINS_ENABLE 44
#define LCD_PINS_D4 63
#define LCD_PINS_D5 40
#define LCD_PINS_D6 42
#define LCD_PINS_D7 65
#else

#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
#define LCD_PINS_DC 25 // Set as output on init
#define LCD_PINS_RS 27 // Pull low for 1s to init
// DOGM SPI LCD Support
#define DOGLCD_CS 16
#define DOGLCD_MOSI 17
#define DOGLCD_SCK 23
#define DOGLCD_A0 LCD_PINS_DC
#else

#if EITHER(MKS_12864OLED, MKS_12864OLED_SSD1306)
#define LCD_PINS_DC 25 // Set as output on init
#define LCD_PINS_RS 27 // Pull low for 1s to init
// DOGM SPI LCD Support
#define DOGLCD_CS 16
#define DOGLCD_MOSI 17
#define DOGLCD_SCK 23
#define DOGLCD_A0 LCD_PINS_DC
#else
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#endif

#define LCD_PINS_D7 29

#if !IS_NEWPANEL
#define BEEPER_PIN 33
#endif

#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#endif

#define LCD_PINS_D7 29

#if !IS_NEWPANEL
// Buttons attached to a shift register
// Not wired yet
//#define SHIFT_CLK_PIN 38
//#define SHIFT_LD_PIN 42
//#define SHIFT_OUT_PIN 40
//#define SHIFT_EN_PIN 17
#define BEEPER_PIN 33
#endif

#endif
Expand All @@ -553,15 +545,10 @@

#define BEEPER_PIN 37

#if ENABLED(CR10_STOCKDISPLAY)
#define BTN_EN1 17
#define BTN_EN2 23
#else
#define BTN_EN1 31
#define BTN_EN2 33
#endif

#define BTN_ENC 35
#define BTN_EN1 31
#define BTN_EN2 33

#define SD_DETECT_PIN 49
#define KILL_PIN 41

Expand Down
17 changes: 5 additions & 12 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@
#define EXP2_07_PIN P1_31
#define EXP2_08_PIN -1

#if HAS_WIRED_LCD
#if ENABLED(CR10_STOCKDISPLAY)

// Migrated to pins_lcd.h

#elif HAS_WIRED_LCD
#if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
#error "ANET_FULL_GRAPHICS_LCD_ALT_WIRING only applies to the ANET 1.0 board."

Expand Down Expand Up @@ -291,17 +295,6 @@
#define DOGLCD_MOSI EXP1_01_PIN
#define LCD_BACKLIGHT_PIN -1

#elif ENABLED(CR10_STOCKDISPLAY)

#define LCD_PINS_RS EXP1_07_PIN

#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BTN_ENC EXP1_02_PIN // (58) open-drain

#define LCD_PINS_ENABLE EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN

#elif HAS_ADC_BUTTONS

#error "ADC BUTTONS do not work unmodified on SKR 1.3, The ADC ports cannot take more than 3.3v."
Expand Down
16 changes: 5 additions & 11 deletions Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@
#define EXP2_07_PIN P1_31
#define EXP2_08_PIN -1 // RESET

#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
#if ENABLED(CR10_STOCKDISPLAY)

// Migrated to pins_lcd.h

#elif HAS_DWIN_E3V2 || IS_DWIN_MARLINUI

// RET6 DWIN ENCODER LCD
#define BTN_ENC EXP1_05_PIN
Expand Down Expand Up @@ -357,16 +361,6 @@

#define BEEPER_PIN EXP1_01_PIN

#elif ENABLED(CR10_STOCKDISPLAY)
#define LCD_PINS_RS EXP1_07_PIN

#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#define BTN_ENC EXP1_02_PIN

#define LCD_PINS_ENABLE EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN

#elif ENABLED(ENDER2_STOCKDISPLAY)

/** Creality Ender-2 display pinout
Expand Down
17 changes: 6 additions & 11 deletions Marlin/src/pins/lpc1768/pins_MKS_SGEN_L.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,16 @@
#error "No custom SD drive cable defined for this board."
#endif

#if HAS_WIRED_LCD
#if ENABLED(CR10_STOCKDISPLAY)

#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN

#if ENABLED(CR10_STOCKDISPLAY)
#define LCD_PINS_RS EXP1_07_PIN
// Migrated to pins_lcd.h

#define BTN_EN1 EXP1_03_PIN
#define BTN_EN2 EXP1_05_PIN
#elif HAS_WIRED_LCD

#define LCD_PINS_ENABLE EXP1_08_PIN
#define LCD_PINS_D4 EXP1_06_PIN
#define BEEPER_PIN EXP1_01_PIN
#define BTN_ENC EXP1_02_PIN

#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
#if HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
#define TFT_CS_PIN EXP1_07_PIN
#define TFT_A0_PIN EXP1_08_PIN
#define TFT_DC_PIN EXP1_08_PIN
Expand Down
7 changes: 3 additions & 4 deletions Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,13 @@
#if ENABLED(CR10_STOCKDISPLAY)

// Re-Arm can support Creality stock display without SD card reader and single cable on EXP3.
// Re-Arm J3 pins 1 (p1.31) & 2 (P3.26) are not used. Stock cable will need to have one
// Re-Arm J3 pins 1 (P1.31) & 2 (P3.26) are not used. Stock cable will need to have one
// 10-pin IDC connector trimmed or replaced with a 12-pin IDC connector to fit J3.
// Requires REVERSE_ENCODER_DIRECTION in Configuration.h

#define BEEPER_PIN P2_11 // J3-3 & AUX-4

#define BTN_EN1 P0_16 // J3-7 & AUX-4
#define BTN_EN2 P1_23 // J3-5 & AUX-4
#define BTN_EN1 P1_23 // J3-5 & AUX-4
#define BTN_EN2 P0_16 // J3-7 & AUX-4
#define BTN_ENC P3_25 // J3-4 & AUX-4

#define LCD_PINS_RS P0_15 // J3-9 & AUX-4 (CS)
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/pins/lpc1769/pins_AZTEEG_X5_GT.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
//
// Display
//

#if EITHER(VIKI2, miniVIKI)
#define BEEPER_PIN P1_31
#define DOGLCD_A0 P2_06
Expand Down
Loading

0 comments on commit 0465771

Please sign in to comment.