Skip to content

Commit

Permalink
🎨 Add EXP1/2 headers, adjust TFT pins (MarlinFirmware#24230)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and Jeremy Fairbanks committed Jul 18, 2022
1 parent 7f0f7e8 commit df55f5a
Show file tree
Hide file tree
Showing 17 changed files with 333 additions and 186 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/STM32F1/tft/tft_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SPIClass TFT_SPI::SPIx(1);

void TFT_SPI::Init() {
#if PIN_EXISTS(TFT_RESET)
OUT_WRITE(TFT_RST_PIN, HIGH);
OUT_WRITE(TFT_RESET_PIN, HIGH);
delay(100);
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
#define TFT_RESET_PIN EXP1_07_PIN
#define TFT_BACKLIGHT_PIN EXP1_08_PIN

#define TFT_RST_PIN EXP2_04_PIN
//#define TFT_RST_PIN EXP2_04_PIN
#define TFT_MOSI_PIN EXP2_05_PIN
#define TFT_SCK_PIN EXP2_09_PIN
#define TFT_MISO_PIN EXP2_10_PIN
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,10 @@
#define KILL_PIN -1 // NC

#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI

#define TFT_CS_PIN EXP1_04_PIN
#define TFT_A0_PIN EXP1_03_PIN
#define TFT_DC_PIN EXP1_03_PIN
#define TFT_A0_PIN TFT_DC_PIN
#define TFT_MISO_PIN EXP2_10_PIN
#define TFT_BACKLIGHT_PIN EXP1_08_PIN
#define TFT_RESET_PIN EXP1_07_PIN
Expand Down
25 changes: 14 additions & 11 deletions Marlin/src/pins/mega/pins_CNCONTROLS_11.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,20 @@
//
// LCD / Controller
//
#define BEEPER_PIN 6

// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 26
#define DOGLCD_CS 24
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
#define DOGLCD_SCK -1

#define BTN_EN1 23
#define BTN_EN2 25
#define BTN_ENC 27
#if HAS_WIRED_LCD
#define BEEPER_PIN 6

#define BTN_EN1 23
#define BTN_EN2 25
#define BTN_ENC 27

#if HAS_MARLINUI_U8GLIB
#define DOGLCD_A0 26
#define DOGLCD_CS 24
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
#define DOGLCD_SCK -1
#endif
#endif

// Hardware buttons for manual movement of XYZ
#define SHIFT_OUT_PIN 19
Expand Down
26 changes: 14 additions & 12 deletions Marlin/src/pins/mega/pins_CNCONTROLS_12.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,20 @@
//
// LCD / Controller
//
#define BEEPER_PIN 16

// Pins for DOGM SPI LCD Support
#define DOGLCD_A0 39
#define DOGLCD_CS 35
#define DOGLCD_MOSI 48
#define DOGLCD_SCK 49

// The encoder and click button
#define BTN_EN1 36
#define BTN_EN2 34
#define BTN_ENC 38
#if HAS_WIRED_LCD
#define BEEPER_PIN 16

#define BTN_EN1 36
#define BTN_EN2 34
#define BTN_ENC 38

#if HAS_MARLINUI_U8GLIB
#define DOGLCD_A0 39
#define DOGLCD_CS 35
#define DOGLCD_MOSI 48
#define DOGLCD_SCK 49
#endif
#endif

// Hardware buttons for manual movement of XYZ
#define SHIFT_OUT_PIN 42
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN
#undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it
#define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments
// as the wiring diagram uses pin 44 for DOGLCD_A0
// as the wiring diagram uses pin 44 for DOGLCD_A0.
#endif

//
Expand Down
81 changes: 54 additions & 27 deletions Marlin/src/pins/sam/pins_RAMPS_FD_V1.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,71 +134,98 @@
#define SDSS 4
#define LED_PIN 13

/** ------ ------
* 37 |10 9 | 35 (MISO) 50 |10 9 | 76 (SCK)
* 29 | 8 7 | 27 (EN2) 31 | 8 7 | 4 (SD_SS)
* 25 6 5 | 23 (EN1) 33 6 5 | 75 (MOSI)
* 16 | 4 3 | 17 (SDD) 49 | 4 3 | RESET
* GND | 2 1 | 5V GND | 2 1 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_03_PIN 17
#define EXP1_04_PIN 16
#define EXP1_05_PIN 23
#define EXP1_06_PIN 25
#define EXP1_07_PIN 27
#define EXP1_08_PIN 29
#define EXP1_09_PIN 35
#define EXP1_10_PIN 37

#define EXP2_03_PIN -1
#define EXP2_04_PIN 49
#define EXP2_05_PIN 75
#define EXP2_06_PIN 33
#define EXP2_07_PIN 4
#define EXP2_08_PIN 31
#define EXP2_09_PIN 76
#define EXP2_10_PIN 74

//
// LCD / Controller
//
#if HAS_WIRED_LCD
// ramps-fd lcd adaptor

#define BEEPER_PIN 37
#define BTN_EN1 33
#define BTN_EN2 31
#define BTN_ENC 35
#define SD_DETECT_PIN 49
#define BEEPER_PIN EXP1_10_PIN
#define BTN_EN1 EXP2_06_PIN
#define BTN_EN2 EXP2_08_PIN
#define BTN_ENC EXP1_09_PIN
#define SD_DETECT_PIN EXP2_04_PIN

#if IS_NEWPANEL
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_RS EXP1_04_PIN
#define LCD_PINS_ENABLE EXP1_03_PIN
#endif

#if ENABLED(FYSETC_MINI_12864)
#define DOGLCD_CS LCD_PINS_ENABLE
#define DOGLCD_A0 LCD_PINS_RS
#define DOGLCD_SCK 76
#define DOGLCD_MOSI 75
#define DOGLCD_SCK EXP2_09_PIN
#define DOGLCD_MOSI EXP2_05_PIN

//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0

#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.

#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 25
#define RGB_LED_R_PIN EXP1_06_PIN
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 27
#define RGB_LED_G_PIN EXP1_07_PIN
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 29
#define RGB_LED_B_PIN EXP1_08_PIN
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN 25
#define NEOPIXEL_PIN EXP1_06_PIN
#endif

#elif IS_NEWPANEL

#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
#define LCD_PINS_D4 EXP1_05_PIN
#define LCD_PINS_D5 EXP1_06_PIN
#define LCD_PINS_D6 EXP1_07_PIN
#define LCD_PINS_D7 EXP1_08_PIN

#if ENABLED(MINIPANEL)
#define DOGLCD_CS 25
#define DOGLCD_A0 27
#define DOGLCD_CS EXP1_06_PIN
#define DOGLCD_A0 EXP1_07_PIN
#endif

#endif

#if ANY(VIKI2, miniVIKI)
#define DOGLCD_A0 16
#define DOGLCD_A0 EXP1_04_PIN
#define KILL_PIN 51
#define STAT_LED_BLUE_PIN 29
#define STAT_LED_RED_PIN 23
#define DOGLCD_CS 17
#define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI
#define DOGLCD_MOSI 75 // MOSI_PIN
#define DOGLCD_MISO 74 // MISO_PIN
#define STAT_LED_BLUE_PIN EXP1_08_PIN
#define STAT_LED_RED_PIN EXP1_05_PIN
#define DOGLCD_CS EXP1_03_PIN
#define DOGLCD_SCK EXP2_09_PIN // SCK_PIN - Required for DUE Hardware SPI
#define DOGLCD_MOSI EXP2_05_PIN // MOSI_PIN
#define DOGLCD_MISO EXP2_10_PIN // MISO_PIN
#endif

#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
Expand Down
78 changes: 53 additions & 25 deletions Marlin/src/pins/sam/pins_RURAMPS4D_11.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
// SPI for MAX Thermocouple
/*
#if DISABLED(SDSUPPORT)
#define TEMP_0_CS_PIN 53
#define TEMP_0_CS_PIN EXP1_03_PIN
#else
#define TEMP_0_CS_PIN 49
#endif
Expand Down Expand Up @@ -190,59 +190,87 @@
// 32Mb FLASH
//#define SPI_FLASH_CS_PIN ?

/**
* ------ ------
* (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK)
* (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS)
* (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI)
* (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET
* GND | 2 1 | 5V GND | 2 1 | --
* ------ ------
* EXP1 EXP2
*/
#define EXP1_03_PIN 53
#define EXP1_04_PIN 52
#define EXP1_05_PIN 50
#define EXP1_06_PIN 48
#define EXP1_07_PIN 63
#define EXP1_08_PIN 64
#define EXP1_09_PIN 40
#define EXP1_10_PIN 62

#define EXP2_03_PIN -1 // RESET
#define EXP2_04_PIN 51
#define EXP2_05_PIN 75 // MOSI
#define EXP2_06_PIN 42
#define EXP2_07_PIN 10
#define EXP2_08_PIN 44
#define EXP2_09_PIN 76 // SCK
#define EXP2_10_PIN 74 // MISO

//
// LCD / Controller
//
#if HAS_WIRED_LCD

#if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC)
#define BEEPER_PIN 62
#define LCD_PINS_D4 48
#define LCD_PINS_D5 50
#define LCD_PINS_D6 52
#define LCD_PINS_D7 53
#define SD_DETECT_PIN 51
#define BEEPER_PIN EXP1_10_PIN
#define LCD_PINS_D4 EXP1_06_PIN
#define LCD_PINS_D5 EXP1_05_PIN
#define LCD_PINS_D6 EXP1_04_PIN
#define LCD_PINS_D7 EXP1_03_PIN
#define SD_DETECT_PIN EXP2_04_PIN
#endif

#if EITHER(RADDS_DISPLAY, IS_RRD_SC)

#define LCD_PINS_RS 63
#define LCD_PINS_ENABLE 64
#define LCD_PINS_RS EXP1_07_PIN
#define LCD_PINS_ENABLE EXP1_08_PIN

#elif IS_RRD_FG_SC

#define LCD_PINS_RS 52
#define LCD_PINS_ENABLE 53
#define LCD_PINS_RS EXP1_04_PIN
#define LCD_PINS_ENABLE EXP1_03_PIN

#elif HAS_U8GLIB_I2C_OLED

#define BEEPER_PIN 62
#define LCD_SDSS 10
#define SD_DETECT_PIN 51
#define BEEPER_PIN EXP1_10_PIN
#define LCD_SDSS EXP2_07_PIN
#define SD_DETECT_PIN EXP2_04_PIN

#elif ENABLED(FYSETC_MINI_12864)

#define BEEPER_PIN 62
#define DOGLCD_CS 64
#define DOGLCD_A0 63
#define BEEPER_PIN EXP1_10_PIN
#define DOGLCD_CS EXP1_08_PIN
#define DOGLCD_A0 EXP1_07_PIN

//#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
// results in LCD soft SPI mode 3, SD soft SPI mode 0

#define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally.
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.

#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
#ifndef RGB_LED_R_PIN
#define RGB_LED_R_PIN 50 // D5
#define RGB_LED_R_PIN EXP1_05_PIN // D5
#endif
#ifndef RGB_LED_G_PIN
#define RGB_LED_G_PIN 52 // D6
#define RGB_LED_G_PIN EXP1_04_PIN // D6
#endif
#ifndef RGB_LED_B_PIN
#define RGB_LED_B_PIN 53 // D7
#define RGB_LED_B_PIN EXP1_03_PIN // D7
#endif
#elif ENABLED(FYSETC_MINI_12864_2_1)
#define NEOPIXEL_PIN 50 // D5
#define NEOPIXEL_PIN EXP1_05_PIN // D5
#endif

#elif ENABLED(SPARK_FULL_GRAPHICS)
Expand All @@ -259,9 +287,9 @@
#endif // SPARK_FULL_GRAPHICS

#if IS_NEWPANEL
#define BTN_EN1 44
#define BTN_EN2 42
#define BTN_ENC 40
#define BTN_EN1 EXP2_08_PIN
#define BTN_EN2 EXP2_06_PIN
#define BTN_ENC EXP1_09_PIN
#endif

#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
Expand Down
Loading

0 comments on commit df55f5a

Please sign in to comment.