|
@@ -0,0 +1,366 @@
|
|
1
|
+/**
|
|
2
|
+ * Marlin 3D Printer Firmware
|
|
3
|
+ * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
|
4
|
+ *
|
|
5
|
+ * Based on Sprinter and grbl.
|
|
6
|
+ * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
|
7
|
+ *
|
|
8
|
+ * This program is free software: you can redistribute it and/or modify
|
|
9
|
+ * it under the terms of the GNU General Public License as published by
|
|
10
|
+ * the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+ * (at your option) any later version.
|
|
12
|
+ *
|
|
13
|
+ * This program is distributed in the hope that it will be useful,
|
|
14
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+ * GNU General Public License for more details.
|
|
17
|
+ *
|
|
18
|
+ * You should have received a copy of the GNU General Public License
|
|
19
|
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+ *
|
|
21
|
+ */
|
|
22
|
+#pragma once
|
|
23
|
+
|
|
24
|
+/**
|
|
25
|
+ * FLSUN HiSpeed V1 (STM32F103VET6) board pin assignments
|
|
26
|
+ * FLSun Hispeed (clone MKS_Robin_miniV2) board.
|
|
27
|
+ *
|
|
28
|
+ * MKS Robin Mini USB uses UART3 (PB10-TX, PB11-RX)
|
|
29
|
+ * #define SERIAL_PORT_2 3
|
|
30
|
+ */
|
|
31
|
+
|
|
32
|
+#if NOT_TARGET(__STM32F1__, STM32F1xx)
|
|
33
|
+ #error "Oops! Select an STM32F1 board in 'Tools > Board.'"
|
|
34
|
+#elif HOTENDS > 1 || E_STEPPERS > 1
|
|
35
|
+ #error "FLSUN HiSpeedV1 supports 1 hotend / E-stepper. Comment out this line to continue."
|
|
36
|
+#endif
|
|
37
|
+
|
|
38
|
+#define BOARD_INFO_NAME "FLSun HiSpeedV1"
|
|
39
|
+#define BOARD_WEBSITE_URL "github.com/Foxies-CSTL"
|
|
40
|
+
|
|
41
|
+//
|
|
42
|
+// Release PB4 (Y_ENABLE_PIN) from JTAG NRST role
|
|
43
|
+//
|
|
44
|
+#define DISABLE_DEBUG
|
|
45
|
+
|
|
46
|
+//
|
|
47
|
+// EEPROM
|
|
48
|
+//
|
|
49
|
+#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
|
|
50
|
+ #define FLASH_EEPROM_EMULATION
|
|
51
|
+ #define EEPROM_PAGE_SIZE (0x800U) // 2KB
|
|
52
|
+ #define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
|
|
53
|
+ #define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE // 2KB
|
|
54
|
+#endif
|
|
55
|
+
|
|
56
|
+// SPI
|
|
57
|
+// Note: FLSun Hispeed (clone MKS_Robin_miniV2) board is using SPI2 interface.
|
|
58
|
+//
|
|
59
|
+#define ENABLE_SPI2
|
|
60
|
+
|
|
61
|
+// SPI Flash
|
|
62
|
+#define HAS_SPI_FLASH 1
|
|
63
|
+#define SPI_FLASH_SIZE 0x1000000 // 16MB
|
|
64
|
+
|
|
65
|
+#if HAS_SPI_FLASH
|
|
66
|
+ // SPI 2
|
|
67
|
+ #define W25QXX_CS_PIN PB12 // SPI2_NSS / Flash chip-select
|
|
68
|
+ #define W25QXX_MOSI_PIN PB15
|
|
69
|
+ #define W25QXX_MISO_PIN PB14
|
|
70
|
+ #define W25QXX_SCK_PIN PB13
|
|
71
|
+#endif
|
|
72
|
+
|
|
73
|
+//
|
|
74
|
+// Servos
|
|
75
|
+//
|
|
76
|
+//#define SERVO0_PIN PA8 // use IO0 to enable BLTOUCH support/remove Mks_Wifi
|
|
77
|
+
|
|
78
|
+//
|
|
79
|
+// Limit Switches
|
|
80
|
+//
|
|
81
|
+#define X_STOP_PIN PA15 // -X
|
|
82
|
+#define Y_STOP_PIN PA12 // -Y
|
|
83
|
+#define Z_MIN_PIN PA11 // -Z
|
|
84
|
+#define Z_MAX_PIN PC4 // +Z
|
|
85
|
+
|
|
86
|
+#ifndef FIL_RUNOUT_PIN
|
|
87
|
+ #define FIL_RUNOUT_PIN MT_DET_1_PIN
|
|
88
|
+#endif
|
|
89
|
+
|
|
90
|
+//
|
|
91
|
+// Steppers
|
|
92
|
+//
|
|
93
|
+#define X_ENABLE_PIN PE4 // X_EN
|
|
94
|
+#define X_STEP_PIN PE3 // X_STEP
|
|
95
|
+#define X_DIR_PIN PE2 // X_DIR
|
|
96
|
+
|
|
97
|
+#define Y_ENABLE_PIN PE1 // Y_EN
|
|
98
|
+#define Y_STEP_PIN PE0 // Y_STEP
|
|
99
|
+#define Y_DIR_PIN PB9 // Y_DIR
|
|
100
|
+
|
|
101
|
+#define Z_ENABLE_PIN PB8 // Z_EN
|
|
102
|
+#define Z_STEP_PIN PB5 // Z_STEP
|
|
103
|
+#define Z_DIR_PIN PB4 // Z_DIR
|
|
104
|
+
|
|
105
|
+#define E0_ENABLE_PIN PB3 // E0_EN
|
|
106
|
+#define E0_STEP_PIN PD6 // E0_STEP
|
|
107
|
+#define E0_DIR_PIN PD3 // E0_DIR
|
|
108
|
+
|
|
109
|
+//
|
|
110
|
+// Drivers
|
|
111
|
+//
|
|
112
|
+#if HAS_TMC220x
|
|
113
|
+
|
|
114
|
+ #if ENABLED(HARDWARE_SERIAL) /* TMC2209 */
|
|
115
|
+ #define X_SLAVE_ADDRESS 3 // | | :
|
|
116
|
+ #define Y_SLAVE_ADDRESS 2 // : | :
|
|
117
|
+ #define Z_SLAVE_ADDRESS 1 // | : :
|
|
118
|
+ //#define E0_SLAVE_ADDRESS 0 // : : :
|
|
119
|
+
|
|
120
|
+ #define X_SERIAL_TX_PIN PA9 // TXD1
|
|
121
|
+ #define X_SERIAL_RX_PIN PA9 // TXD1
|
|
122
|
+
|
|
123
|
+ #define Y_SERIAL_TX_PIN PA9 // TXD1
|
|
124
|
+ #define Y_SERIAL_RX_PIN PA9 // TXD1
|
|
125
|
+
|
|
126
|
+ #define Z_SERIAL_TX_PIN PA9 // TXD1
|
|
127
|
+ #define Z_SERIAL_RX_PIN PA9 // TXD1
|
|
128
|
+
|
|
129
|
+ #elif ENABLED(SOFTWARE_SERIAL) /* TMC220x */
|
|
130
|
+ /**
|
|
131
|
+ * TMC2208 stepper UART-configurable by PDN_UART pin
|
|
132
|
+ * Software serial
|
|
133
|
+ */
|
|
134
|
+ #define X_SLAVE_ADDRESS 0
|
|
135
|
+ #define Y_SLAVE_ADDRESS 0
|
|
136
|
+ #define Z_SLAVE_ADDRESS 0
|
|
137
|
+
|
|
138
|
+ #define X_SERIAL_TX_PIN PA10 // RXD1
|
|
139
|
+ #define X_SERIAL_RX_PIN PA10 // RXD1
|
|
140
|
+
|
|
141
|
+ #define Y_SERIAL_TX_PIN PA9 // TXD1
|
|
142
|
+ #define Y_SERIAL_RX_PIN PA9 // TXD1
|
|
143
|
+
|
|
144
|
+ #define Z_SERIAL_TX_PIN PC7 // IO1
|
|
145
|
+ #define Z_SERIAL_RX_PIN PC7 // IO1
|
|
146
|
+
|
|
147
|
+ #endif
|
|
148
|
+ // Reduce baud rate to improve software serial reliability
|
|
149
|
+ #define TMC_BAUD_RATE 19200
|
|
150
|
+#else
|
|
151
|
+
|
|
152
|
+ // Motor current PWM pins
|
|
153
|
+ #define MOTOR_CURRENT_PWM_XY_PIN PA6 // VREF2/3 CONTROL XY
|
|
154
|
+ #define MOTOR_CURRENT_PWM_Z_PIN PA7 // VREF4 CONTROL Z
|
|
155
|
+ #define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp
|
|
156
|
+ #ifndef DEFAULT_PWM_MOTOR_CURRENT
|
|
157
|
+ #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
|
|
158
|
+ #endif
|
|
159
|
+
|
|
160
|
+ /**
|
|
161
|
+ * src: MKS Robin_Mini V2
|
|
162
|
+ * __ESP(M1)__ -J1-
|
|
163
|
+ * GND| 15 | | 08 |+3v3 (22)=>RXD1(PA10) //
|
|
164
|
+ * | 16 | | 07 |MOSI (21)=>TXD1(PA9) // active low, probably OK to leave floating
|
|
165
|
+ * IO2| 17 | | 06 |MISO (19)=>IO1(PC7) // Leave as unused (ESP3D software configures this with a pullup so OK to leave as floating)
|
|
166
|
+ * IO0| 18 | | 05 |CLK (18)=>IO0(PA8) // must be high (ESP3D software configures this with a pullup so OK to leave as floating)
|
|
167
|
+ * IO1| 19 | | 03 |EN (03)=>WIFI_EN() // Must be high for module to run
|
|
168
|
+ * | nc | | nc | (01)=>WIFI_CTRL(PA5)
|
|
169
|
+ * RX| 21 | | nc |
|
|
170
|
+ * TX| 22 | | 01 |RST
|
|
171
|
+ *  ̄ ̄ AE ̄ ̄
|
|
172
|
+ *
|
|
173
|
+ */
|
|
174
|
+ #ifdef ESP_WIFI
|
|
175
|
+ #define WIFI_IO0_PIN PA8 // PC13 MKS ESP WIFI IO0 PIN
|
|
176
|
+ #define WIFI_IO1_PIN PC7 // MKS ESP WIFI IO1 PIN
|
|
177
|
+ #define WIFI_RESET_PIN PA5 // MKS ESP WIFI RESET PIN
|
|
178
|
+ #endif
|
|
179
|
+#endif
|
|
180
|
+
|
|
181
|
+//
|
|
182
|
+// EXTRUDER
|
|
183
|
+//
|
|
184
|
+#if AXIS_DRIVER_TYPE(E0,TMC2208)||AXIS_DRIVER_TYPE(E0,TMC2209)
|
|
185
|
+ #define E0_SLAVE_ADDRESS 0
|
|
186
|
+
|
|
187
|
+ #define E0_SERIAL_TX_PIN PA8 // IO0
|
|
188
|
+ #define E0_SERIAL_RX_PIN PA8 // IO0
|
|
189
|
+ #define TMC_BAUD_RATE 19200
|
|
190
|
+#else
|
|
191
|
+ // Motor current PWM pins
|
|
192
|
+ #define MOTOR_CURRENT_PWM_E_PIN PB0 // VREF1 CONTROL E
|
|
193
|
+ #define MOTOR_CURRENT_PWM_RANGE 1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp
|
|
194
|
+ #ifndef DEFAULT_PWM_MOTOR_CURRENT
|
|
195
|
+ #define DEFAULT_PWM_MOTOR_CURRENT { 800, 800, 800 }
|
|
196
|
+ #endif
|
|
197
|
+#endif
|
|
198
|
+
|
|
199
|
+//
|
|
200
|
+// Temperature Sensors(THM)
|
|
201
|
+//
|
|
202
|
+#define TEMP_0_PIN PC1 // TEMP_E0
|
|
203
|
+#define TEMP_BED_PIN PC0 // TEMP_BED
|
|
204
|
+
|
|
205
|
+//
|
|
206
|
+// Heaters / Fans
|
|
207
|
+//
|
|
208
|
+#define HEATER_0_PIN PC3 // HEATER_E0
|
|
209
|
+#define HEATER_BED_PIN PA0 // HEATER_BED-WKUP
|
|
210
|
+
|
|
211
|
+#define FAN_PIN PB1 // E_FAN
|
|
212
|
+//#define CONTROLLER_FAN_PIN PD6 // BOARD FAN
|
|
213
|
+
|
|
214
|
+//
|
|
215
|
+// Misc. Functions
|
|
216
|
+//
|
|
217
|
+//#define POWER_LOSS_PIN PA1 // PW_SO
|
|
218
|
+#if ENABLED(BACKUP_POWER_SUPPLY)
|
|
219
|
+ #define POWER_LOSS_PIN PA2 // PW_DET (UPS) MKSPWC
|
|
220
|
+#endif
|
|
221
|
+
|
|
222
|
+//
|
|
223
|
+// Power Supply Control
|
|
224
|
+//
|
|
225
|
+#if ENABLED(PSU_CONTROL)
|
|
226
|
+ #define KILL_PIN PA2 // PW_DET
|
|
227
|
+ #define KILL_PIN_INVERTING true //
|
|
228
|
+ //#define PS_ON_PIN PA3 // PW_CN /PW_OFF
|
|
229
|
+#endif
|
|
230
|
+
|
|
231
|
+#define MT_DET_1_PIN PA4 // MT_DET
|
|
232
|
+#define MT_DET_2_PIN PE6 // FALA_CRTL
|
|
233
|
+#define MT_DET_PIN_INVERTING false
|
|
234
|
+
|
|
235
|
+//
|
|
236
|
+// LED / NEOPixel
|
|
237
|
+//
|
|
238
|
+//#define LED_PIN PB2 // BOOT1
|
|
239
|
+
|
|
240
|
+#if ENABLED(NEOPIXEL_LED)
|
|
241
|
+ #define LED_PWM PA8
|
|
242
|
+ #ifndef NEOPIXEL_PIN
|
|
243
|
+ #define NEOPIXEL_PIN LED_PWM // USED WIFI IO0/IO1/TX/RX PIN
|
|
244
|
+ #endif
|
|
245
|
+#endif
|
|
246
|
+
|
|
247
|
+//Others test.
|
|
248
|
+//#define SERVO0_PIN PA5 // WIFI CRTL
|
|
249
|
+//#define GPIO_CLEAR PA8 // IO0
|
|
250
|
+//#define GPIO_SET PA5
|
|
251
|
+
|
|
252
|
+//
|
|
253
|
+// SD Card
|
|
254
|
+//
|
|
255
|
+#define SDIO_SUPPORT
|
|
256
|
+#define SDIO_CLOCK 4500000 // 4.5 MHz /* 18 MHz (18000000) or 4.5MHz (450000) */
|
|
257
|
+//#define SDIO_CLOCK 18000000 // 18 MHz (18000000)
|
|
258
|
+#if ENABLED(SDIO_SUPPORT)
|
|
259
|
+ #define SCK_PIN PB13 // SPI2
|
|
260
|
+ #define MISO_PIN PB14 // SPI2
|
|
261
|
+ #define MOSI_PIN PB15 // SPI2
|
|
262
|
+ #define SD_DETECT_PIN PD12 // SD_CD
|
|
263
|
+#endif
|
|
264
|
+
|
|
265
|
+//
|
|
266
|
+// LCD / Controller
|
|
267
|
+//
|
|
268
|
+#ifndef BEEPER_PIN
|
|
269
|
+ #define BEEPER_PIN PC5
|
|
270
|
+#endif
|
|
271
|
+
|
|
272
|
+/**
|
|
273
|
+ * Note: MKS Robin TFT screens use various TFT controllers
|
|
274
|
+ * Supported screens are based on the ILI9341, ST7789V and ILI9328 (320x240)
|
|
275
|
+ * ILI9488 is not supported
|
|
276
|
+ * Define init sequences for other screens in u8g_dev_tft_320x240_upscale_from_128x64.cpp
|
|
277
|
+ *
|
|
278
|
+ * If the screen stays white, disable 'LCD_RESET_PIN'
|
|
279
|
+ * to let the bootloader init the screen.
|
|
280
|
+ *
|
|
281
|
+ * Setting an 'LCD_RESET_PIN' may cause a flicker when entering the LCD menu
|
|
282
|
+ * because Marlin uses the reset as a failsafe to revive a glitchy LCD.
|
|
283
|
+ */
|
|
284
|
+
|
|
285
|
+// MKS Robin TFT v2.0 with ILI9341
|
|
286
|
+// Read display identification information (0xD3 on ILI9341)
|
|
287
|
+//#define XPT2046_X_CALIBRATION 12013
|
|
288
|
+//#define XPT2046_Y_CALIBRATION -8711
|
|
289
|
+//#define XPT2046_X_OFFSET -32
|
|
290
|
+//#define XPT2046_Y_OFFSET 256
|
|
291
|
+
|
|
292
|
+// MKS Robin TFT v1.1 with ILI9328
|
|
293
|
+//#define XPT2046_X_CALIBRATION -11792
|
|
294
|
+//#define XPT2046_Y_CALIBRATION 8947
|
|
295
|
+//#define XPT2046_X_OFFSET 342
|
|
296
|
+//#define XPT2046_Y_OFFSET -19
|
|
297
|
+
|
|
298
|
+// MKS Robin TFT v1.1 with R61505
|
|
299
|
+//#define XPT2046_X_CALIBRATION 12489
|
|
300
|
+//#define XPT2046_Y_CALIBRATION 9210
|
|
301
|
+//#define XPT2046_X_OFFSET -52
|
|
302
|
+//#define XPT2046_Y_OFFSET -17
|
|
303
|
+
|
|
304
|
+// QQS-Pro uses MKS Robin TFT v2.0
|
|
305
|
+
|
|
306
|
+// Shared FSMC Configs
|
|
307
|
+#if HAS_FSMC_TFT
|
|
308
|
+ #define DOGLCD_MOSI -1 // Prevent auto-define by Conditionals_post.h
|
|
309
|
+ #define DOGLCD_SCK -1
|
|
310
|
+
|
|
311
|
+ #define FSMC_CS_PIN PD7 // NE4
|
|
312
|
+ #define FSMC_RS_PIN PD11 // A0
|
|
313
|
+
|
|
314
|
+ #define TFT_RESET_PIN PC6 // FSMC_RST
|
|
315
|
+ #define TFT_BACKLIGHT_PIN PD13
|
|
316
|
+
|
|
317
|
+ #define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
|
|
318
|
+ #define FSMC_DMA_DEV DMA2
|
|
319
|
+ #define FSMC_DMA_CHANNEL DMA_CH5
|
|
320
|
+
|
|
321
|
+ #define TOUCH_BUTTONS_HW_SPI
|
|
322
|
+ #define TOUCH_BUTTONS_HW_SPI_DEVICE 2
|
|
323
|
+#endif
|
|
324
|
+
|
|
325
|
+// XPT2046 Touch Screen calibration
|
|
326
|
+#if EITHER(TFT_LVGL_UI_FSMC, TFT_COLOR_UI)
|
|
327
|
+ #define TFT_BUFFER_SIZE 14400
|
|
328
|
+
|
|
329
|
+ #ifndef XPT2046_X_CALIBRATION
|
|
330
|
+ #define XPT2046_X_CALIBRATION 12218
|
|
331
|
+ #endif
|
|
332
|
+ #ifndef XPT2046_Y_CALIBRATION
|
|
333
|
+ #define XPT2046_Y_CALIBRATION -8814
|
|
334
|
+ #endif
|
|
335
|
+ #ifndef XPT2046_X_OFFSET
|
|
336
|
+ #define XPT2046_X_OFFSET -35
|
|
337
|
+ #endif
|
|
338
|
+ #ifndef XPT2046_Y_OFFSET
|
|
339
|
+ #define XPT2046_Y_OFFSET 256
|
|
340
|
+ #endif
|
|
341
|
+
|
|
342
|
+#elif ENABLED(TFT_CLASSIC_UI)
|
|
343
|
+ #ifndef XPT2046_X_CALIBRATION
|
|
344
|
+ #define XPT2046_X_CALIBRATION 12149
|
|
345
|
+ #endif
|
|
346
|
+ #ifndef XPT2046_Y_CALIBRATION
|
|
347
|
+ #define XPT2046_Y_CALIBRATION -8746
|
|
348
|
+ #endif
|
|
349
|
+ #ifndef XPT2046_X_OFFSET
|
|
350
|
+ #define XPT2046_X_OFFSET -35
|
|
351
|
+ #endif
|
|
352
|
+ #ifndef XPT2046_Y_OFFSET
|
|
353
|
+ #define XPT2046_Y_OFFSET 256
|
|
354
|
+ #endif
|
|
355
|
+
|
|
356
|
+ #define TFT_MARLINUI_COLOR 0xFFFF // White
|
|
357
|
+ #define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow
|
|
358
|
+ #define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan
|
|
359
|
+#endif
|
|
360
|
+
|
|
361
|
+#if NEED_TOUCH_PINS
|
|
362
|
+ #define TOUCH_CS_PIN PC2 // SPI2_NSS
|
|
363
|
+ #define TOUCH_SCK_PIN PB13 // SPI2_SCK
|
|
364
|
+ #define TOUCH_MISO_PIN PB14 // SPI2_MISO
|
|
365
|
+ #define TOUCH_MOSI_PIN PB15 // SPI2_MOSI
|
|
366
|
+#endif
|