Skip to content

Commit b3829d7

Browse files
thinkyheadLCh-77
authored andcommitted
🎨 Add EXP1/2 headers, adjust TFT pins (MarlinFirmware#24230)
1 parent 1eef41e commit b3829d7

17 files changed

+333
-186
lines changed

Marlin/src/HAL/STM32F1/tft/tft_spi.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SPIClass TFT_SPI::SPIx(1);
3030

3131
void TFT_SPI::Init() {
3232
#if PIN_EXISTS(TFT_RESET)
33-
OUT_WRITE(TFT_RST_PIN, HIGH);
33+
OUT_WRITE(TFT_RESET_PIN, HIGH);
3434
delay(100);
3535
#endif
3636

Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@
314314
#define TFT_RESET_PIN EXP1_07_PIN
315315
#define TFT_BACKLIGHT_PIN EXP1_08_PIN
316316

317-
#define TFT_RST_PIN EXP2_04_PIN
317+
//#define TFT_RST_PIN EXP2_04_PIN
318318
#define TFT_MOSI_PIN EXP2_05_PIN
319319
#define TFT_SCK_PIN EXP2_09_PIN
320320
#define TFT_MISO_PIN EXP2_10_PIN

Marlin/src/pins/lpc1769/pins_MKS_SGEN_L_V2.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,10 @@
339339
#define KILL_PIN -1 // NC
340340

341341
#elif HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
342+
342343
#define TFT_CS_PIN EXP1_04_PIN
343-
#define TFT_A0_PIN EXP1_03_PIN
344344
#define TFT_DC_PIN EXP1_03_PIN
345+
#define TFT_A0_PIN TFT_DC_PIN
345346
#define TFT_MISO_PIN EXP2_10_PIN
346347
#define TFT_BACKLIGHT_PIN EXP1_08_PIN
347348
#define TFT_RESET_PIN EXP1_07_PIN

Marlin/src/pins/mega/pins_CNCONTROLS_11.h

+14-11
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,20 @@
135135
//
136136
// LCD / Controller
137137
//
138-
#define BEEPER_PIN 6
139-
140-
// Pins for DOGM SPI LCD Support
141-
#define DOGLCD_A0 26
142-
#define DOGLCD_CS 24
143-
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
144-
#define DOGLCD_SCK -1
145-
146-
#define BTN_EN1 23
147-
#define BTN_EN2 25
148-
#define BTN_ENC 27
138+
#if HAS_WIRED_LCD
139+
#define BEEPER_PIN 6
140+
141+
#define BTN_EN1 23
142+
#define BTN_EN2 25
143+
#define BTN_ENC 27
144+
145+
#if HAS_MARLINUI_U8GLIB
146+
#define DOGLCD_A0 26
147+
#define DOGLCD_CS 24
148+
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
149+
#define DOGLCD_SCK -1
150+
#endif
151+
#endif
149152

150153
// Hardware buttons for manual movement of XYZ
151154
#define SHIFT_OUT_PIN 19

Marlin/src/pins/mega/pins_CNCONTROLS_12.h

+14-12
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,20 @@
140140
//
141141
// LCD / Controller
142142
//
143-
#define BEEPER_PIN 16
144-
145-
// Pins for DOGM SPI LCD Support
146-
#define DOGLCD_A0 39
147-
#define DOGLCD_CS 35
148-
#define DOGLCD_MOSI 48
149-
#define DOGLCD_SCK 49
150-
151-
// The encoder and click button
152-
#define BTN_EN1 36
153-
#define BTN_EN2 34
154-
#define BTN_ENC 38
143+
#if HAS_WIRED_LCD
144+
#define BEEPER_PIN 16
145+
146+
#define BTN_EN1 36
147+
#define BTN_EN2 34
148+
#define BTN_ENC 38
149+
150+
#if HAS_MARLINUI_U8GLIB
151+
#define DOGLCD_A0 39
152+
#define DOGLCD_CS 35
153+
#define DOGLCD_MOSI 48
154+
#define DOGLCD_SCK 49
155+
#endif
156+
#endif
155157

156158
// Hardware buttons for manual movement of XYZ
157159
#define SHIFT_OUT_PIN 42

Marlin/src/pins/ramps/pins_AZTEEG_X3_PRO.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
#if ENABLED(CASE_LIGHT_ENABLE) && PIN_EXISTS(CASE_LIGHT) && defined(DOGLCD_A0) && DOGLCD_A0 == CASE_LIGHT_PIN
159159
#undef DOGLCD_A0 // Steal pin 44 for the case light; if you have a Viki2 and have connected it
160160
#define DOGLCD_A0 57 // following the Panucatt wiring diagram, you may need to tweak these pin assignments
161-
// as the wiring diagram uses pin 44 for DOGLCD_A0
161+
// as the wiring diagram uses pin 44 for DOGLCD_A0.
162162
#endif
163163

164164
//

Marlin/src/pins/sam/pins_RAMPS_FD_V1.h

+54-27
Original file line numberDiff line numberDiff line change
@@ -134,71 +134,98 @@
134134
#define SDSS 4
135135
#define LED_PIN 13
136136

137+
/** ------ ------
138+
* 37 |10 9 | 35 (MISO) 50 |10 9 | 76 (SCK)
139+
* 29 | 8 7 | 27 (EN2) 31 | 8 7 | 4 (SD_SS)
140+
* 25 6 5 | 23 (EN1) 33 6 5 | 75 (MOSI)
141+
* 16 | 4 3 | 17 (SDD) 49 | 4 3 | RESET
142+
* GND | 2 1 | 5V GND | 2 1 | --
143+
* ------ ------
144+
* EXP1 EXP2
145+
*/
146+
#define EXP1_03_PIN 17
147+
#define EXP1_04_PIN 16
148+
#define EXP1_05_PIN 23
149+
#define EXP1_06_PIN 25
150+
#define EXP1_07_PIN 27
151+
#define EXP1_08_PIN 29
152+
#define EXP1_09_PIN 35
153+
#define EXP1_10_PIN 37
154+
155+
#define EXP2_03_PIN -1
156+
#define EXP2_04_PIN 49
157+
#define EXP2_05_PIN 75
158+
#define EXP2_06_PIN 33
159+
#define EXP2_07_PIN 4
160+
#define EXP2_08_PIN 31
161+
#define EXP2_09_PIN 76
162+
#define EXP2_10_PIN 74
163+
137164
//
138165
// LCD / Controller
139166
//
140167
#if HAS_WIRED_LCD
141168
// ramps-fd lcd adaptor
142169

143-
#define BEEPER_PIN 37
144-
#define BTN_EN1 33
145-
#define BTN_EN2 31
146-
#define BTN_ENC 35
147-
#define SD_DETECT_PIN 49
170+
#define BEEPER_PIN EXP1_10_PIN
171+
#define BTN_EN1 EXP2_06_PIN
172+
#define BTN_EN2 EXP2_08_PIN
173+
#define BTN_ENC EXP1_09_PIN
174+
#define SD_DETECT_PIN EXP2_04_PIN
148175

149176
#if IS_NEWPANEL
150-
#define LCD_PINS_RS 16
151-
#define LCD_PINS_ENABLE 17
177+
#define LCD_PINS_RS EXP1_04_PIN
178+
#define LCD_PINS_ENABLE EXP1_03_PIN
152179
#endif
153180

154181
#if ENABLED(FYSETC_MINI_12864)
155182
#define DOGLCD_CS LCD_PINS_ENABLE
156183
#define DOGLCD_A0 LCD_PINS_RS
157-
#define DOGLCD_SCK 76
158-
#define DOGLCD_MOSI 75
184+
#define DOGLCD_SCK EXP2_09_PIN
185+
#define DOGLCD_MOSI EXP2_05_PIN
159186

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

163-
#define LCD_RESET_PIN 23 // Must be high or open for LCD to operate normally.
190+
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
164191

165192
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
166193
#ifndef RGB_LED_R_PIN
167-
#define RGB_LED_R_PIN 25
194+
#define RGB_LED_R_PIN EXP1_06_PIN
168195
#endif
169196
#ifndef RGB_LED_G_PIN
170-
#define RGB_LED_G_PIN 27
197+
#define RGB_LED_G_PIN EXP1_07_PIN
171198
#endif
172199
#ifndef RGB_LED_B_PIN
173-
#define RGB_LED_B_PIN 29
200+
#define RGB_LED_B_PIN EXP1_08_PIN
174201
#endif
175202
#elif ENABLED(FYSETC_MINI_12864_2_1)
176-
#define NEOPIXEL_PIN 25
203+
#define NEOPIXEL_PIN EXP1_06_PIN
177204
#endif
178205

179206
#elif IS_NEWPANEL
180207

181-
#define LCD_PINS_D4 23
182-
#define LCD_PINS_D5 25
183-
#define LCD_PINS_D6 27
184-
#define LCD_PINS_D7 29
208+
#define LCD_PINS_D4 EXP1_05_PIN
209+
#define LCD_PINS_D5 EXP1_06_PIN
210+
#define LCD_PINS_D6 EXP1_07_PIN
211+
#define LCD_PINS_D7 EXP1_08_PIN
185212

186213
#if ENABLED(MINIPANEL)
187-
#define DOGLCD_CS 25
188-
#define DOGLCD_A0 27
214+
#define DOGLCD_CS EXP1_06_PIN
215+
#define DOGLCD_A0 EXP1_07_PIN
189216
#endif
190217

191218
#endif
192219

193220
#if ANY(VIKI2, miniVIKI)
194-
#define DOGLCD_A0 16
221+
#define DOGLCD_A0 EXP1_04_PIN
195222
#define KILL_PIN 51
196-
#define STAT_LED_BLUE_PIN 29
197-
#define STAT_LED_RED_PIN 23
198-
#define DOGLCD_CS 17
199-
#define DOGLCD_SCK 76 // SCK_PIN - Required for DUE Hardware SPI
200-
#define DOGLCD_MOSI 75 // MOSI_PIN
201-
#define DOGLCD_MISO 74 // MISO_PIN
223+
#define STAT_LED_BLUE_PIN EXP1_08_PIN
224+
#define STAT_LED_RED_PIN EXP1_05_PIN
225+
#define DOGLCD_CS EXP1_03_PIN
226+
#define DOGLCD_SCK EXP2_09_PIN // SCK_PIN - Required for DUE Hardware SPI
227+
#define DOGLCD_MOSI EXP2_05_PIN // MOSI_PIN
228+
#define DOGLCD_MISO EXP2_10_PIN // MISO_PIN
202229
#endif
203230

204231
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)

Marlin/src/pins/sam/pins_RURAMPS4D_11.h

+53-25
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
// SPI for MAX Thermocouple
154154
/*
155155
#if DISABLED(SDSUPPORT)
156-
#define TEMP_0_CS_PIN 53
156+
#define TEMP_0_CS_PIN EXP1_03_PIN
157157
#else
158158
#define TEMP_0_CS_PIN 49
159159
#endif
@@ -190,59 +190,87 @@
190190
// 32Mb FLASH
191191
//#define SPI_FLASH_CS_PIN ?
192192

193+
/**
194+
* ------ ------
195+
* (BEEPER) 62 |10 9 | 40 (BTN_ENC) (MISO) 74 |10 9 | 76 (SCK)
196+
* (LCD_EN) 64 | 8 7 | 63 (LCD_RS) (BTN_EN1) 44 | 8 7 | 10 (SD_SS)
197+
* (LCD_D4) 48 | 6 5 50 (LCD_D5) (BTN_EN2) 42 | 6 5 75 (MOSI)
198+
* (LCD_D6) 52 | 4 3 | 53 (LCD_D7) (SD_DETECT) 51 | 4 3 | RESET
199+
* GND | 2 1 | 5V GND | 2 1 | --
200+
* ------ ------
201+
* EXP1 EXP2
202+
*/
203+
#define EXP1_03_PIN 53
204+
#define EXP1_04_PIN 52
205+
#define EXP1_05_PIN 50
206+
#define EXP1_06_PIN 48
207+
#define EXP1_07_PIN 63
208+
#define EXP1_08_PIN 64
209+
#define EXP1_09_PIN 40
210+
#define EXP1_10_PIN 62
211+
212+
#define EXP2_03_PIN -1 // RESET
213+
#define EXP2_04_PIN 51
214+
#define EXP2_05_PIN 75 // MOSI
215+
#define EXP2_06_PIN 42
216+
#define EXP2_07_PIN 10
217+
#define EXP2_08_PIN 44
218+
#define EXP2_09_PIN 76 // SCK
219+
#define EXP2_10_PIN 74 // MISO
220+
193221
//
194222
// LCD / Controller
195223
//
196224
#if HAS_WIRED_LCD
197225

198226
#if ANY(RADDS_DISPLAY, IS_RRD_SC, IS_RRD_FG_SC)
199-
#define BEEPER_PIN 62
200-
#define LCD_PINS_D4 48
201-
#define LCD_PINS_D5 50
202-
#define LCD_PINS_D6 52
203-
#define LCD_PINS_D7 53
204-
#define SD_DETECT_PIN 51
227+
#define BEEPER_PIN EXP1_10_PIN
228+
#define LCD_PINS_D4 EXP1_06_PIN
229+
#define LCD_PINS_D5 EXP1_05_PIN
230+
#define LCD_PINS_D6 EXP1_04_PIN
231+
#define LCD_PINS_D7 EXP1_03_PIN
232+
#define SD_DETECT_PIN EXP2_04_PIN
205233
#endif
206234

207235
#if EITHER(RADDS_DISPLAY, IS_RRD_SC)
208236

209-
#define LCD_PINS_RS 63
210-
#define LCD_PINS_ENABLE 64
237+
#define LCD_PINS_RS EXP1_07_PIN
238+
#define LCD_PINS_ENABLE EXP1_08_PIN
211239

212240
#elif IS_RRD_FG_SC
213241

214-
#define LCD_PINS_RS 52
215-
#define LCD_PINS_ENABLE 53
242+
#define LCD_PINS_RS EXP1_04_PIN
243+
#define LCD_PINS_ENABLE EXP1_03_PIN
216244

217245
#elif HAS_U8GLIB_I2C_OLED
218246

219-
#define BEEPER_PIN 62
220-
#define LCD_SDSS 10
221-
#define SD_DETECT_PIN 51
247+
#define BEEPER_PIN EXP1_10_PIN
248+
#define LCD_SDSS EXP2_07_PIN
249+
#define SD_DETECT_PIN EXP2_04_PIN
222250

223251
#elif ENABLED(FYSETC_MINI_12864)
224252

225-
#define BEEPER_PIN 62
226-
#define DOGLCD_CS 64
227-
#define DOGLCD_A0 63
253+
#define BEEPER_PIN EXP1_10_PIN
254+
#define DOGLCD_CS EXP1_08_PIN
255+
#define DOGLCD_A0 EXP1_07_PIN
228256

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

232-
#define LCD_RESET_PIN 48 // Must be high or open for LCD to operate normally.
260+
#define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
233261

234262
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
235263
#ifndef RGB_LED_R_PIN
236-
#define RGB_LED_R_PIN 50 // D5
264+
#define RGB_LED_R_PIN EXP1_05_PIN // D5
237265
#endif
238266
#ifndef RGB_LED_G_PIN
239-
#define RGB_LED_G_PIN 52 // D6
267+
#define RGB_LED_G_PIN EXP1_04_PIN // D6
240268
#endif
241269
#ifndef RGB_LED_B_PIN
242-
#define RGB_LED_B_PIN 53 // D7
270+
#define RGB_LED_B_PIN EXP1_03_PIN // D7
243271
#endif
244272
#elif ENABLED(FYSETC_MINI_12864_2_1)
245-
#define NEOPIXEL_PIN 50 // D5
273+
#define NEOPIXEL_PIN EXP1_05_PIN // D5
246274
#endif
247275

248276
#elif ENABLED(SPARK_FULL_GRAPHICS)
@@ -259,9 +287,9 @@
259287
#endif // SPARK_FULL_GRAPHICS
260288

261289
#if IS_NEWPANEL
262-
#define BTN_EN1 44
263-
#define BTN_EN2 42
264-
#define BTN_ENC 40
290+
#define BTN_EN1 EXP2_08_PIN
291+
#define BTN_EN2 EXP2_06_PIN
292+
#define BTN_ENC EXP1_09_PIN
265293
#endif
266294

267295
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)

0 commit comments

Comments
 (0)