Skip to content

Commit 650e1dd

Browse files
committed
🎨 Minor cleanup of TFT/FSMC pins
1 parent 87cc387 commit 650e1dd

12 files changed

+115
-93
lines changed

Marlin/src/pins/stm32f1/pins_CHITU3D_V5.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,9 @@
117117
#define W25QXX_SCK_PIN PB13
118118

119119
//
120-
// TronXY TFT Support
120+
// TFT with FSMC interface
121121
//
122-
123122
#if HAS_FSMC_TFT
124-
125-
// Shared FSMC
126-
127123
#define TOUCH_CS_PIN PB7 // SPI1_NSS
128124
#define TOUCH_SCK_PIN PA5 // SPI1_SCK
129125
#define TOUCH_MISO_PIN PA6 // SPI1_MISO

Marlin/src/pins/stm32f1/pins_CHITU3D_V6.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,9 @@
132132
#define W25QXX_SCK_PIN PB13
133133

134134
//
135-
// TronXY TFT Support
135+
// TFT with FSMC interface
136136
//
137-
138137
#if HAS_FSMC_TFT
139-
140-
// Shared FSMC
141-
142138
#define TOUCH_CS_PIN PB7 // SPI1_NSS
143139
#define TOUCH_SCK_PIN PA5 // SPI1_SCK
144140
#define TOUCH_MISO_PIN PA6 // SPI1_MISO
@@ -152,7 +148,6 @@
152148
#define FSMC_RS_PIN PD11
153149
#define FSMC_DMA_DEV DMA2
154150
#define FSMC_DMA_CHANNEL DMA_CH5
155-
156151
#endif
157152

158153
#if ENABLED(TFT_LVGL_UI)

Marlin/src/pins/stm32f1/pins_FLSUN_HISPEED.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,9 @@
271271
#error "FLSun HiSpeed default BEEPER_PIN is not a SPEAKER."
272272
#endif
273273

274-
#if HAS_FSMC_TFT || HAS_GRAPHICAL_TFT
275-
#define TFT_CS_PIN PD7 // NE4
276-
#define TFT_RS_PIN PD11 // A0
277-
#endif
278-
274+
//
275+
// TFT with FSMC interface
276+
//
279277
#if HAS_FSMC_TFT
280278
/**
281279
* Note: MKS Robin TFT screens use various TFT controllers
@@ -291,12 +289,16 @@
291289
*/
292290
//#define TFT_RESET_PIN PC6 // FSMC_RST
293291
#define TFT_BACKLIGHT_PIN PD13
294-
#define FSMC_CS_PIN TFT_CS_PIN // NE4
295-
#define FSMC_RS_PIN TFT_RS_PIN // A0
296292

297293
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
294+
#define FSMC_CS_PIN PD7 // NE4
295+
#define FSMC_RS_PIN PD11 // A0
298296
#define FSMC_DMA_DEV DMA2
299297
#define FSMC_DMA_CHANNEL DMA_CH5
298+
299+
#define TFT_CS_PIN TFT_CS_PIN
300+
#define TFT_RS_PIN TFT_RS_PIN
301+
300302
#ifdef TFT_CLASSIC_UI
301303
#define TFT_MARLINBG_COLOR 0x3186 // Grey
302304
#define TFT_MARLINUI_COLOR 0xC7B6 // Green
@@ -307,6 +309,8 @@
307309
#elif HAS_GRAPHICAL_TFT
308310
#define TFT_RESET_PIN PC6
309311
#define TFT_BACKLIGHT_PIN PD13
312+
#define TFT_CS_PIN PD7 // NE4
313+
#define TFT_RS_PIN PD11 // A0
310314
#endif
311315

312316
#if NEED_TOUCH_PINS

Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
* ║║ ╦╠═╣│ │├┬┘│ │├┬┘├─┤╠╣ │ │├┬┘│ ││││ │ │ ││││
2727
* ╚╝╚═╝╩ ╩└─┘┴└─└─┘┴└─┴ ┴╚ └─┘┴└─└─┘┴ ┴o└─┘└─┘┴ ┴
2828
* Pin assignments for 32-bit JGAurora A5S & A1
29+
*
30+
* https://jgaurorawiki.com/_media/jgaurora_a5s_a1_pinout.png
2931
*/
3032

3133
#include "env_validate.h"
@@ -102,15 +104,20 @@
102104
#define FIL_RUNOUT_PIN PC7
103105

104106
//
105-
// LCD
107+
// TFT with FSMC interface
106108
//
107-
#define LCD_BACKLIGHT_PIN PF11
108-
#define FSMC_CS_PIN PD7
109-
#define FSMC_RS_PIN PG0
109+
#if HAS_FSMC_TFT
110+
#define LCD_BACKLIGHT_PIN PF11
111+
#define FSMC_CS_PIN PD7
112+
#define FSMC_RS_PIN PG0
110113

111-
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
112-
#define FSMC_DMA_DEV DMA2
113-
#define FSMC_DMA_CHANNEL DMA_CH5
114+
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
115+
#define FSMC_DMA_DEV DMA2
116+
#define FSMC_DMA_CHANNEL DMA_CH5
117+
118+
#define TFT_CS_PIN FSMC_CS_PIN
119+
#define TFT_RS_PIN FSMC_RS_PIN
120+
#endif
114121

115122
//
116123
// SD Card
@@ -129,4 +136,7 @@
129136
#if NEED_TOUCH_PINS
130137
#define TOUCH_CS_PIN PA4
131138
#define TOUCH_INT_PIN PC4
139+
#define TOUCH_MISO_PIN PA6
140+
#define TOUCH_MOSI_PIN PA7
141+
#define TOUCH_SCK_PIN PA5
132142
#endif

Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,28 @@
117117
//#undef Z_MAX_PIN // Uncomment if using ZMAX connector (PE5)
118118
#endif
119119

120-
#define TFT_RESET_PIN PC4 // pin 33
121-
#define TFT_BACKLIGHT_PIN PD12 // pin 59
122-
#define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1
123-
#define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed
120+
//
121+
// TFT with FSMC interface
122+
//
123+
#if HAS_FSMC_TFT
124+
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
125+
#define FSMC_CS_PIN PD7 // pin 88 = FSMC_NE1
126+
#define FSMC_RS_PIN PD11 // pin 58 A16 Register. Only one address needed
127+
#define FSMC_DMA_DEV DMA2
128+
#define FSMC_DMA_CHANNEL DMA_CH5
124129

125-
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
126-
#define FSMC_DMA_DEV DMA2
127-
#define FSMC_DMA_CHANNEL DMA_CH5
130+
#define TFT_CS_PIN FSMC_CS_PIN
131+
#define TFT_RS_PIN FSMC_RS_PIN
128132

129-
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
130-
#define DOGLCD_SCK -1
133+
#define TFT_RESET_PIN PC4 // pin 33
134+
#define TFT_BACKLIGHT_PIN PD12 // pin 59
131135

132-
// Buffer for Color UI
133-
#define TFT_BUFFER_SIZE 3200
136+
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
137+
#define DOGLCD_SCK -1
138+
139+
// Buffer for Color UI
140+
#define TFT_BUFFER_SIZE 3200
141+
#endif
134142

135143
/**
136144
* Note: Alfawise U20/U30 boards DON'T use SPI2, as the hardware designer

Marlin/src/pins/stm32f1/pins_MINGDA_MPX_ARM_MINI.h

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@
133133
//
134134
#define BEEPER_PIN PE4
135135

136-
/**
137-
* Note: MKS Robin TFT screens use various TFT controllers.
138-
* If the screen stays white, disable 'LCD_RESET_PIN'
139-
* to let the bootloader init the screen.
140-
*/
136+
//
137+
// TFT with FSMC interface
138+
//
141139
#if HAS_FSMC_TFT
142140
/**
143141
* Note: MKS Robin TFT screens use various TFT controllers
@@ -151,18 +149,17 @@
151149
* Setting an 'TFT_RESET_PIN' may cause a flicker when entering the LCD menu
152150
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
153151
*/
154-
#define TFT_CS_PIN PD7 // NE4
155-
#define TFT_RS_PIN PG0 // A0
156-
157-
#define FSMC_CS_PIN TFT_CS_PIN
158-
#define FSMC_RS_PIN TFT_RS_PIN
152+
#define TFT_RESET_PIN PF15
153+
#define TFT_BACKLIGHT_PIN PF11
159154

160155
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
156+
#define FSMC_CS_PIN PD7 // NE4
157+
#define FSMC_RS_PIN PG0 // A0
161158
#define FSMC_DMA_DEV DMA2
162159
#define FSMC_DMA_CHANNEL DMA_CH5
163160

164-
#define TFT_RESET_PIN PF15
165-
#define TFT_BACKLIGHT_PIN PF11
161+
#define TFT_CS_PIN FSMC_CS_PIN
162+
#define TFT_RS_PIN FSMC_RS_PIN
166163

167164
#define TOUCH_BUTTONS_HW_SPI
168165
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1

Marlin/src/pins/stm32f1/pins_MKS_ROBIN.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
#define WIFI_IO0_PIN PG1
156156

157157
//
158-
// LCD screen
158+
// TFT with FSMC interface
159159
//
160160
#if HAS_FSMC_TFT
161161
/**
@@ -170,18 +170,17 @@
170170
* Setting an 'TFT_RESET_PIN' may cause a flicker when entering the LCD menu
171171
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
172172
*/
173-
#define TFT_CS_PIN PG12 // NE4
174-
#define TFT_RS_PIN PF0 // A0
175-
176-
#define FSMC_CS_PIN TFT_CS_PIN
177-
#define FSMC_RS_PIN TFT_RS_PIN
173+
#define TFT_RESET_PIN PF6
174+
#define TFT_BACKLIGHT_PIN PG11
178175

179176
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
177+
#define FSMC_CS_PIN PG12 // NE4
178+
#define FSMC_RS_PIN PF0 // A0
180179
#define FSMC_DMA_DEV DMA2
181180
#define FSMC_DMA_CHANNEL DMA_CH5
182181

183-
#define TFT_RESET_PIN PF6
184-
#define TFT_BACKLIGHT_PIN PG11
182+
#define TFT_CS_PIN FSMC_CS_PIN
183+
#define TFT_RS_PIN FSMC_RS_PIN
185184

186185
#define TOUCH_BUTTONS_HW_SPI
187186
#define TOUCH_BUTTONS_HW_SPI_DEVICE 2

Marlin/src/pins/stm32f1/pins_MKS_ROBIN_NANO.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,18 @@
172172
//
173173
#define BEEPER_PIN PC5
174174

175-
/**
176-
* Note: MKS Robin TFT screens use various TFT controllers.
177-
* If the screen stays white, disable 'TFT_RESET_PIN'
178-
* to let the bootloader init the screen.
179-
*/
180-
// Shared FSMC Configs
175+
//
176+
// TFT with FSMC interface
177+
//
181178
#if HAS_FSMC_TFT
179+
/**
180+
* Note: MKS Robin TFT screens use various TFT controllers.
181+
* If the screen stays white, disable 'TFT_RESET_PIN'
182+
* to let the bootloader init the screen.
183+
*/
184+
#define TFT_RESET_PIN PC6 // FSMC_RST
185+
#define TFT_BACKLIGHT_PIN PD13
186+
182187
#define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
183188
#define DOGLCD_SCK -1
184189

@@ -187,9 +192,6 @@
187192
#define TOUCH_MISO_PIN PB14 // SPI2_MISO
188193
#define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
189194

190-
#define TFT_RESET_PIN PC6 // FSMC_RST
191-
#define TFT_BACKLIGHT_PIN PD13
192-
193195
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
194196
#define FSMC_CS_PIN PD7
195197
#define FSMC_RS_PIN PD11

Marlin/src/pins/stm32f1/pins_MKS_ROBIN_PRO.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,18 @@
205205
#error "No custom SD drive cable defined for this board."
206206
#endif
207207

208-
/**
209-
* Note: MKS Robin TFT screens use various TFT controllers.
210-
* If the screen stays white, disable 'LCD_RESET_PIN'
211-
* to let the bootloader init the screen.
212-
*/
208+
//
209+
// TFT with FSMC interface
210+
//
213211
#if HAS_FSMC_TFT
212+
/**
213+
* Note: MKS Robin TFT screens use various TFT controllers.
214+
* If the screen stays white, disable 'LCD_RESET_PIN'
215+
* to let the bootloader init the screen.
216+
*/
217+
#define TFT_RESET_PIN LCD_RESET_PIN
218+
#define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN
219+
214220
#define FSMC_CS_PIN PD7 // NE4
215221
#define FSMC_RS_PIN PD11 // A0
216222
#define FSMC_DMA_DEV DMA2
@@ -221,8 +227,6 @@
221227

222228
#define LCD_RESET_PIN PF6
223229
#define LCD_BACKLIGHT_PIN PD13
224-
#define TFT_RESET_PIN LCD_RESET_PIN
225-
#define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN
226230

227231
#define TFT_BUFFER_SIZE 14400
228232

Marlin/src/pins/stm32f1/pins_TRIGORILLA_PRO.h

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,20 +126,24 @@
126126
//#define POWER_LOSS_PIN PG2 // PG4 PW_DET
127127
#define FIL_RUNOUT_PIN PA15 // MT_DET
128128

129-
/**
130-
* Note: MKS Robin TFT screens use various TFT controllers
131-
* Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240)
132-
* ILI9488 is not supported.
133-
* Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
134-
*
135-
* If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader init the screen.
136-
*
137-
* Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
138-
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
139-
*/
129+
//
130+
// TFT with FSMC interface
131+
//
140132
#if HAS_FSMC_TFT
133+
/**
134+
* Note: MKS Robin TFT screens use various TFT controllers
135+
* Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240)
136+
* ILI9488 is not supported.
137+
* Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
138+
*
139+
* If the screen stays white, disable 'LCD_RESET_PIN' to let the bootloader init the screen.
140+
*
141+
* Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
142+
* because Marlin uses the reset as a failsafe to revive a glitchy LCD.
143+
*/
141144
#define TFT_RESET_PIN PF11
142145
#define TFT_BACKLIGHT_PIN PD13
146+
143147
#define FSMC_CS_PIN PD7 // NE4
144148
#define FSMC_RS_PIN PD11 // A0
145149

0 commit comments

Comments
 (0)