|
@@ -0,0 +1,526 @@
|
|
1
|
+/**
|
|
2
|
+ * Marlin 3D Printer Firmware
|
|
3
|
+ * Copyright (c) 2021 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
|
+#include "env_validate.h"
|
|
25
|
+
|
|
26
|
+// Onboard I2C EEPROM
|
|
27
|
+#define I2C_EEPROM
|
|
28
|
+#define MARLIN_EEPROM_SIZE 0x8000 // 32KB (24C32A)
|
|
29
|
+#define I2C_SCL_PIN PB8
|
|
30
|
+#define I2C_SDA_PIN PB9
|
|
31
|
+
|
|
32
|
+// USB Flash Drive support
|
|
33
|
+#define HAS_OTG_USB_HOST_SUPPORT
|
|
34
|
+
|
|
35
|
+// Avoid conflict with TIMER_TONE
|
|
36
|
+#define STEP_TIMER 10
|
|
37
|
+
|
|
38
|
+//
|
|
39
|
+// Servos
|
|
40
|
+#define SERVO0_PIN PB6
|
|
41
|
+
|
|
42
|
+//
|
|
43
|
+// Misc. Functions
|
|
44
|
+//
|
|
45
|
+#define LED_PIN PA13
|
|
46
|
+
|
|
47
|
+//
|
|
48
|
+// Trinamic Stallguard pins
|
|
49
|
+//
|
|
50
|
+#define X_DIAG_PIN PG6 // X-STOP
|
|
51
|
+#define Y_DIAG_PIN PG9 // Y-STOP
|
|
52
|
+#define Z_DIAG_PIN PG10 // Z-STOP
|
|
53
|
+#define Z2_DIAG_PIN PG11 // Z2-STOP
|
|
54
|
+#define E0_DIAG_PIN PG12 // E0DET
|
|
55
|
+#define E1_DIAG_PIN PG13 // E1DET
|
|
56
|
+#define E2_DIAG_PIN PG14 // E2DET
|
|
57
|
+#define E3_DIAG_PIN PG15 // E3DET
|
|
58
|
+
|
|
59
|
+// Z Probe (when not Z_MIN_PIN)
|
|
60
|
+//
|
|
61
|
+#ifndef Z_MIN_PROBE_PIN
|
|
62
|
+ #define Z_MIN_PROBE_PIN PB7
|
|
63
|
+#endif
|
|
64
|
+
|
|
65
|
+//
|
|
66
|
+// Limit Switches
|
|
67
|
+//
|
|
68
|
+#ifdef X_STALL_SENSITIVITY
|
|
69
|
+ #define X_STOP_PIN X_DIAG_PIN
|
|
70
|
+ #if X_HOME_TO_MIN
|
|
71
|
+ #define X_MAX_PIN E0_DIAG_PIN // E0DET
|
|
72
|
+ #else
|
|
73
|
+ #define X_MIN_PIN E0_DIAG_PIN // E0DET
|
|
74
|
+ #endif
|
|
75
|
+#elif ENABLED(X_DUAL_ENDSTOPS)
|
|
76
|
+ #ifndef X_MIN_PIN
|
|
77
|
+ #define X_MIN_PIN X_DIAG_PIN // X-STOP
|
|
78
|
+ #endif
|
|
79
|
+ #ifndef X_MAX_PIN
|
|
80
|
+ #define X_MAX_PIN E0_DIAG_PIN // E0DET
|
|
81
|
+ #endif
|
|
82
|
+#else
|
|
83
|
+ #define X_STOP_PIN X_DIAG_PIN // X-STOP
|
|
84
|
+#endif
|
|
85
|
+
|
|
86
|
+#ifdef Y_STALL_SENSITIVITY
|
|
87
|
+ #define Y_STOP_PIN Y_DIAG_PIN
|
|
88
|
+ #if Y_HOME_TO_MIN
|
|
89
|
+ #define Y_MAX_PIN E1_DIAG_PIN // E1DET
|
|
90
|
+ #else
|
|
91
|
+ #define Y_MIN_PIN E1_DIAG_PIN // E1DET
|
|
92
|
+ #endif
|
|
93
|
+#elif ENABLED(Y_DUAL_ENDSTOPS)
|
|
94
|
+ #ifndef Y_MIN_PIN
|
|
95
|
+ #define Y_MIN_PIN Y_DIAG_PIN // Y-STOP
|
|
96
|
+ #endif
|
|
97
|
+ #ifndef Y_MAX_PIN
|
|
98
|
+ #define Y_MAX_PIN E1_DIAG_PIN // E1DET
|
|
99
|
+ #endif
|
|
100
|
+#else
|
|
101
|
+ #define Y_STOP_PIN Y_DIAG_PIN // Y-STOP
|
|
102
|
+#endif
|
|
103
|
+
|
|
104
|
+#ifdef Z_STALL_SENSITIVITY
|
|
105
|
+ #define Z_STOP_PIN Z_DIAG_PIN
|
|
106
|
+ #if Z_HOME_TO_MIN
|
|
107
|
+ #define Z_MAX_PIN E2_DIAG_PIN // PWRDET
|
|
108
|
+ #else
|
|
109
|
+ #define Z_MIN_PIN E2_DIAG_PIN // PWRDET
|
|
110
|
+ #endif
|
|
111
|
+#elif ENABLED(Z_MULTI_ENDSTOPS)
|
|
112
|
+ #ifndef Z_MIN_PIN
|
|
113
|
+ #define Z_MIN_PIN Z_DIAG_PIN // Z-STOP
|
|
114
|
+ #endif
|
|
115
|
+ #ifndef Z_MAX_PIN
|
|
116
|
+ #define Z_MAX_PIN E2_DIAG_PIN // PWRDET
|
|
117
|
+ #endif
|
|
118
|
+#else
|
|
119
|
+ #define Z_STOP_PIN Z_DIAG_PIN // Z-STOP
|
|
120
|
+#endif
|
|
121
|
+
|
|
122
|
+//
|
|
123
|
+// Filament Runout Sensor
|
|
124
|
+//
|
|
125
|
+#define FIL_RUNOUT_PIN PG12 // E0DET
|
|
126
|
+#define FIL_RUNOUT2_PIN PG13 // E1DET
|
|
127
|
+#define FIL_RUNOUT3_PIN PG14 // E2DET
|
|
128
|
+#define FIL_RUNOUT4_PIN PG15 // E3DET
|
|
129
|
+
|
|
130
|
+//
|
|
131
|
+// Power Supply Control
|
|
132
|
+//
|
|
133
|
+#ifndef PS_ON_PIN
|
|
134
|
+ #define PS_ON_PIN PE11 // PS-ON
|
|
135
|
+#endif
|
|
136
|
+
|
|
137
|
+//
|
|
138
|
+// Power Loss Detection
|
|
139
|
+//
|
|
140
|
+#ifndef POWER_LOSS_PIN
|
|
141
|
+ #define POWER_LOSS_PIN PC0 // PWRDET
|
|
142
|
+#endif
|
|
143
|
+
|
|
144
|
+//
|
|
145
|
+// NeoPixel LED
|
|
146
|
+//
|
|
147
|
+#ifndef NEOPIXEL_PIN
|
|
148
|
+ #define NEOPIXEL_PIN PB0
|
|
149
|
+#endif
|
|
150
|
+
|
|
151
|
+//
|
|
152
|
+// Steppers
|
|
153
|
+//
|
|
154
|
+#define X_STEP_PIN PF13 // MOTOR 0
|
|
155
|
+#define X_DIR_PIN PF12
|
|
156
|
+#define X_ENABLE_PIN PF14
|
|
157
|
+#ifndef X_CS_PIN
|
|
158
|
+ #define X_CS_PIN PC4
|
|
159
|
+#endif
|
|
160
|
+
|
|
161
|
+#define Y_STEP_PIN PG0 // MOTOR 1
|
|
162
|
+#define Y_DIR_PIN PG1
|
|
163
|
+#define Y_ENABLE_PIN PF15
|
|
164
|
+#ifndef Y_CS_PIN
|
|
165
|
+ #define Y_CS_PIN PD11
|
|
166
|
+#endif
|
|
167
|
+
|
|
168
|
+#define Z_STEP_PIN PF11 // MOTOR 2
|
|
169
|
+#define Z_DIR_PIN PG3
|
|
170
|
+#define Z_ENABLE_PIN PG5
|
|
171
|
+#ifndef Z_CS_PIN
|
|
172
|
+ #define Z_CS_PIN PC6
|
|
173
|
+#endif
|
|
174
|
+
|
|
175
|
+#define Z2_STEP_PIN PG4 // MOTOR 3
|
|
176
|
+#define Z2_DIR_PIN PC1
|
|
177
|
+#define Z2_ENABLE_PIN PA0
|
|
178
|
+#ifndef Z2_CS_PIN
|
|
179
|
+ #define Z2_CS_PIN PC7
|
|
180
|
+#endif
|
|
181
|
+
|
|
182
|
+#define E0_STEP_PIN PF9 // MOTOR 4
|
|
183
|
+#define E0_DIR_PIN PF10
|
|
184
|
+#define E0_ENABLE_PIN PG2
|
|
185
|
+#ifndef E0_CS_PIN
|
|
186
|
+ #define E0_CS_PIN PF2
|
|
187
|
+#endif
|
|
188
|
+
|
|
189
|
+#define E1_STEP_PIN PC13 // MOTOR 5
|
|
190
|
+#define E1_DIR_PIN PF0
|
|
191
|
+#define E1_ENABLE_PIN PF1
|
|
192
|
+#ifndef E1_CS_PIN
|
|
193
|
+ #define E1_CS_PIN PE4
|
|
194
|
+#endif
|
|
195
|
+
|
|
196
|
+#define E2_STEP_PIN PE2 // MOTOR 6
|
|
197
|
+#define E2_DIR_PIN PE3
|
|
198
|
+#define E2_ENABLE_PIN PD4
|
|
199
|
+#ifndef E2_CS_PIN
|
|
200
|
+
|
|
201
|
+ #define E2_CS_PIN PE1
|
|
202
|
+#endif
|
|
203
|
+
|
|
204
|
+#define E3_STEP_PIN PE6 // MOTOR 7
|
|
205
|
+#define E3_DIR_PIN PA14
|
|
206
|
+#define E3_ENABLE_PIN PE0
|
|
207
|
+#ifndef E3_CS_PIN
|
|
208
|
+ #define E3_CS_PIN PD3
|
|
209
|
+#endif
|
|
210
|
+
|
|
211
|
+//
|
|
212
|
+// Temperature Sensors
|
|
213
|
+//
|
|
214
|
+#define TEMP_BED_PIN PF3 // TB
|
|
215
|
+#if TEMP_SENSOR_0 == 20
|
|
216
|
+ #define TEMP_0_PIN PF8 // PT100 Connector
|
|
217
|
+#else
|
|
218
|
+ #define TEMP_0_PIN PF4 // TH0
|
|
219
|
+#endif
|
|
220
|
+#define TEMP_1_PIN PF5 // TH1
|
|
221
|
+#define TEMP_2_PIN PF6 // TH2
|
|
222
|
+#define TEMP_3_PIN PF7 // TH3
|
|
223
|
+
|
|
224
|
+//
|
|
225
|
+// Heaters / Fans
|
|
226
|
+//
|
|
227
|
+#define HEATER_BED_PIN PA1 // Hotbed
|
|
228
|
+#define HEATER_0_PIN PA2 // Heater0
|
|
229
|
+#define HEATER_1_PIN PA3 // Heater1
|
|
230
|
+#define HEATER_2_PIN PB10 // Heater2
|
|
231
|
+#define HEATER_3_PIN PB11 // Heater3
|
|
232
|
+
|
|
233
|
+#define FAN_PIN PA8 // Fan0
|
|
234
|
+#define FAN1_PIN PE5 // Fan1
|
|
235
|
+#define FAN2_PIN PD12 // Fan2
|
|
236
|
+#define FAN3_PIN PD13 // Fan3
|
|
237
|
+#define FAN4_PIN PD14 // Fan4
|
|
238
|
+#define FAN5_PIN PD15 // Fan5
|
|
239
|
+
|
|
240
|
+//
|
|
241
|
+// SD Support
|
|
242
|
+//
|
|
243
|
+#ifndef SDCARD_CONNECTION
|
|
244
|
+ #if HAS_WIRED_LCD
|
|
245
|
+ #define SDCARD_CONNECTION LCD
|
|
246
|
+ #else
|
|
247
|
+ #define SDCARD_CONNECTION ONBOARD
|
|
248
|
+ #endif
|
|
249
|
+#endif
|
|
250
|
+
|
|
251
|
+//
|
|
252
|
+// Software SPI pins for TMC2130 stepper drivers
|
|
253
|
+//
|
|
254
|
+#if ENABLED(TMC_USE_SW_SPI)
|
|
255
|
+ #ifndef TMC_SW_MOSI
|
|
256
|
+ #define TMC_SW_MOSI PA7
|
|
257
|
+ #endif
|
|
258
|
+ #ifndef TMC_SW_MISO
|
|
259
|
+ #define TMC_SW_MISO PA6
|
|
260
|
+ #endif
|
|
261
|
+ #ifndef TMC_SW_SCK
|
|
262
|
+ #define TMC_SW_SCK PA5
|
|
263
|
+ #endif
|
|
264
|
+#endif
|
|
265
|
+
|
|
266
|
+#if HAS_TMC_UART
|
|
267
|
+ /**
|
|
268
|
+ * TMC2208/TMC2209 stepper drivers
|
|
269
|
+ *
|
|
270
|
+ * Hardware serial communication ports.
|
|
271
|
+ * If undefined software serial is used according to the pins below
|
|
272
|
+ */
|
|
273
|
+ //#define X_HARDWARE_SERIAL Serial1
|
|
274
|
+ //#define X2_HARDWARE_SERIAL Serial1
|
|
275
|
+ //#define Y_HARDWARE_SERIAL Serial1
|
|
276
|
+ //#define Y2_HARDWARE_SERIAL Serial1
|
|
277
|
+ //#define Z_HARDWARE_SERIAL Serial1
|
|
278
|
+ //#define Z2_HARDWARE_SERIAL Serial1
|
|
279
|
+ //#define E0_HARDWARE_SERIAL Serial1
|
|
280
|
+ //#define E1_HARDWARE_SERIAL Serial1
|
|
281
|
+ //#define E2_HARDWARE_SERIAL Serial1
|
|
282
|
+ //#define E3_HARDWARE_SERIAL Serial1
|
|
283
|
+ //#define E4_HARDWARE_SERIAL Serial1
|
|
284
|
+
|
|
285
|
+ //
|
|
286
|
+ // Software serial
|
|
287
|
+ //
|
|
288
|
+ #define X_SERIAL_TX_PIN PC4
|
|
289
|
+ #define X_SERIAL_RX_PIN PC4
|
|
290
|
+
|
|
291
|
+ #define Y_SERIAL_TX_PIN PD11
|
|
292
|
+ #define Y_SERIAL_RX_PIN PD11
|
|
293
|
+
|
|
294
|
+ #define Z_SERIAL_TX_PIN PC6
|
|
295
|
+ #define Z_SERIAL_RX_PIN PC6
|
|
296
|
+
|
|
297
|
+ #define Z2_SERIAL_TX_PIN PC7
|
|
298
|
+ #define Z2_SERIAL_RX_PIN PC7
|
|
299
|
+
|
|
300
|
+ #define E0_SERIAL_TX_PIN PF2
|
|
301
|
+ #define E0_SERIAL_RX_PIN PF2
|
|
302
|
+
|
|
303
|
+ #define E1_SERIAL_TX_PIN PE4
|
|
304
|
+ #define E1_SERIAL_RX_PIN PE4
|
|
305
|
+
|
|
306
|
+ #define E2_SERIAL_TX_PIN PE1
|
|
307
|
+ #define E2_SERIAL_RX_PIN PE1
|
|
308
|
+
|
|
309
|
+ #define E3_SERIAL_TX_PIN PD3
|
|
310
|
+ #define E3_SERIAL_RX_PIN PD3
|
|
311
|
+
|
|
312
|
+ // Reduce baud rate to improve software serial reliability
|
|
313
|
+ #define TMC_BAUD_RATE 19200
|
|
314
|
+#endif
|
|
315
|
+
|
|
316
|
+/**
|
|
317
|
+ * ______ ______
|
|
318
|
+ * NC | 1 2 | GND 5V | 1 2 | GND
|
|
319
|
+ * RESET | 3 4 | PC15 (SD_DETECT) (LCD_D7) PE15 | 3 4 | PE14 (LCD_D6)
|
|
320
|
+ * (MOSI) PA7 | 5 6 PB1 (BTN_EN2) (LCD_D5) PE13 | 5 6 PE12 (LCD_D4)
|
|
321
|
+ * (SD_SS) PA4 | 7 8 | PB2 (BTN_EN1) (LCD_RS) PE10 | 7 8 | PE9 (LCD_EN)
|
|
322
|
+ * (SCK) PA5 | 9 10 | PA6 (MISO) (BTN_ENC) PE7 | 9 10 | PE8 (BEEPER)
|
|
323
|
+ * ------ -----
|
|
324
|
+ * EXP2 EXP1
|
|
325
|
+ */
|
|
326
|
+
|
|
327
|
+#define EXP1_03_PIN PE15
|
|
328
|
+#define EXP1_04_PIN PE14
|
|
329
|
+#define EXP1_05_PIN PE13
|
|
330
|
+#define EXP1_06_PIN PE12
|
|
331
|
+#define EXP1_07_PIN PE10
|
|
332
|
+#define EXP1_08_PIN PE9
|
|
333
|
+#define EXP1_09_PIN PE7
|
|
334
|
+#define EXP1_10_PIN PE8
|
|
335
|
+
|
|
336
|
+#define EXP2_03_PIN -1
|
|
337
|
+#define EXP2_04_PIN PC15
|
|
338
|
+#define EXP2_05_PIN PA7
|
|
339
|
+#define EXP2_06_PIN PB2
|
|
340
|
+#define EXP2_07_PIN PA4
|
|
341
|
+#define EXP2_08_PIN PB1
|
|
342
|
+#define EXP2_09_PIN PA5
|
|
343
|
+#define EXP2_10_PIN PA6
|
|
344
|
+
|
|
345
|
+//
|
|
346
|
+// Onboard SD card
|
|
347
|
+// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
|
|
348
|
+//
|
|
349
|
+#if SD_CONNECTION_IS(ONBOARD)
|
|
350
|
+ #define SDIO_SUPPORT // Use SDIO for onboard SD
|
|
351
|
+ #ifndef SD_DETECT_STATE
|
|
352
|
+ #define SD_DETECT_STATE HIGH
|
|
353
|
+ #elif SD_DETECT_STATE == LOW
|
|
354
|
+ #error "BOARD_BTT_OCTOPUS_V1_0 onboard SD requires SD_DETECT_STATE set to HIGH."
|
|
355
|
+ #endif
|
|
356
|
+ #define SD_DETECT_PIN PC14
|
|
357
|
+#elif SD_CONNECTION_IS(LCD)
|
|
358
|
+
|
|
359
|
+ #define CUSTOM_SPI_PINS
|
|
360
|
+ #define SDSS PA4
|
|
361
|
+ #define SD_SS_PIN SDSS
|
|
362
|
+ #define SD_SCK_PIN PA5
|
|
363
|
+ #define SD_MISO_PIN PA6
|
|
364
|
+ #define SD_MOSI_PIN PA7
|
|
365
|
+ #define SD_DETECT_PIN PC15
|
|
366
|
+
|
|
367
|
+#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
|
368
|
+ #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
|
|
369
|
+#endif
|
|
370
|
+
|
|
371
|
+#if ENABLED(BTT_MOTOR_EXPANSION)
|
|
372
|
+ /**
|
|
373
|
+ * ______ ______
|
|
374
|
+ * NC | 1 2 | GND NC | 1 2 | GND
|
|
375
|
+ * NC | 3 4 | M1EN M2EN | 3 4 | M3EN
|
|
376
|
+ * M1STP | 5 6 M1DIR M1RX | 5 6 M1DIAG
|
|
377
|
+ * M2DIR | 7 8 | M2STP M2RX | 7 8 | M2DIAG
|
|
378
|
+ * M3DIR | 9 10 | M3STP M3RX | 9 10 | M3DIAG
|
|
379
|
+ * ------ ------
|
|
380
|
+ * EXP2 EXP1
|
|
381
|
+ */
|
|
382
|
+
|
|
383
|
+ // M1 on Driver Expansion Module
|
|
384
|
+ #define E4_STEP_PIN EXP2_05_PIN
|
|
385
|
+ #define E4_DIR_PIN EXP2_06_PIN
|
|
386
|
+ #define E4_ENABLE_PIN EXP2_04_PIN
|
|
387
|
+ #define E4_DIAG_PIN EXP1_06_PIN
|
|
388
|
+ #define E4_CS_PIN EXP1_05_PIN
|
|
389
|
+ #if HAS_TMC_UART
|
|
390
|
+ #define E4_SERIAL_TX_PIN EXP1_05_PIN
|
|
391
|
+ #define E4_SERIAL_RX_PIN EXP1_05_PIN
|
|
392
|
+ #endif
|
|
393
|
+
|
|
394
|
+ // M2 on Driver Expansion Module
|
|
395
|
+ #define E5_STEP_PIN EXP2_08_PIN
|
|
396
|
+ #define E5_DIR_PIN EXP2_07_PIN
|
|
397
|
+ #define E5_ENABLE_PIN EXP1_03_PIN
|
|
398
|
+ #define E5_DIAG_PIN EXP1_08_PIN
|
|
399
|
+ #define E5_CS_PIN EXP1_07_PIN
|
|
400
|
+ #if HAS_TMC_UART
|
|
401
|
+ #define E5_SERIAL_TX_PIN EXP1_07_PIN
|
|
402
|
+ #define E5_SERIAL_RX_PIN EXP1_07_PIN
|
|
403
|
+ #endif
|
|
404
|
+
|
|
405
|
+ // M3 on Driver Expansion Module
|
|
406
|
+ #define E6_STEP_PIN EXP2_10_PIN
|
|
407
|
+ #define E6_DIR_PIN EXP2_09_PIN
|
|
408
|
+ #define E6_ENABLE_PIN EXP1_04_PIN
|
|
409
|
+ #define E6_DIAG_PIN EXP1_10_PIN
|
|
410
|
+ #define E6_CS_PIN EXP1_09_PIN
|
|
411
|
+ #if HAS_TMC_UART
|
|
412
|
+ #define E6_SERIAL_TX_PIN EXP1_09_PIN
|
|
413
|
+ #define E6_SERIAL_RX_PIN EXP1_09_PIN
|
|
414
|
+ #endif
|
|
415
|
+
|
|
416
|
+#endif // BTT_MOTOR_EXPANSION
|
|
417
|
+
|
|
418
|
+//
|
|
419
|
+// LCDs and Controllers
|
|
420
|
+//
|
|
421
|
+#if IS_TFTGLCD_PANEL
|
|
422
|
+
|
|
423
|
+ #if ENABLED(TFTGLCD_PANEL_SPI)
|
|
424
|
+ #define TFTGLCD_CS EXP2_08_PIN
|
|
425
|
+ #endif
|
|
426
|
+
|
|
427
|
+#elif HAS_WIRED_LCD
|
|
428
|
+
|
|
429
|
+ #define BEEPER_PIN EXP1_10_PIN
|
|
430
|
+ #define BTN_ENC EXP1_09_PIN
|
|
431
|
+
|
|
432
|
+ #if ENABLED(CR10_STOCKDISPLAY)
|
|
433
|
+
|
|
434
|
+ #define LCD_PINS_RS EXP1_04_PIN
|
|
435
|
+
|
|
436
|
+ #define BTN_EN1 EXP1_08_PIN
|
|
437
|
+ #define BTN_EN2 EXP1_06_PIN
|
|
438
|
+
|
|
439
|
+ #define LCD_PINS_ENABLE EXP1_03_PIN
|
|
440
|
+ #define LCD_PINS_D4 EXP1_05_PIN
|
|
441
|
+
|
|
442
|
+ // CR10_STOCKDISPLAY default timing is too fast
|
|
443
|
+ #undef BOARD_ST7920_DELAY_1
|
|
444
|
+ #undef BOARD_ST7920_DELAY_2
|
|
445
|
+ #undef BOARD_ST7920_DELAY_3
|
|
446
|
+
|
|
447
|
+ #else
|
|
448
|
+
|
|
449
|
+ #define LCD_PINS_RS EXP1_07_PIN
|
|
450
|
+
|
|
451
|
+ #define BTN_EN1 EXP2_08_PIN
|
|
452
|
+ #define BTN_EN2 EXP2_06_PIN
|
|
453
|
+
|
|
454
|
+ #define LCD_PINS_ENABLE EXP1_08_PIN
|
|
455
|
+ #define LCD_PINS_D4 EXP1_06_PIN
|
|
456
|
+
|
|
457
|
+ #if ENABLED(FYSETC_MINI_12864)
|
|
458
|
+ #define DOGLCD_CS EXP1_08_PIN
|
|
459
|
+ #define DOGLCD_A0 EXP1_07_PIN
|
|
460
|
+ //#define LCD_BACKLIGHT_PIN -1
|
|
461
|
+ #define LCD_RESET_PIN EXP1_06_PIN // Must be high or open for LCD to operate normally.
|
|
462
|
+ #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
|
463
|
+ #ifndef RGB_LED_R_PIN
|
|
464
|
+ #define RGB_LED_R_PIN EXP1_05_PIN
|
|
465
|
+ #endif
|
|
466
|
+ #ifndef RGB_LED_G_PIN
|
|
467
|
+ #define RGB_LED_G_PIN EXP1_04_PIN
|
|
468
|
+ #endif
|
|
469
|
+ #ifndef RGB_LED_B_PIN
|
|
470
|
+ #define RGB_LED_B_PIN EXP1_03_PIN
|
|
471
|
+ #endif
|
|
472
|
+ #elif ENABLED(FYSETC_MINI_12864_2_1)
|
|
473
|
+ #define NEOPIXEL_PIN EXP1_05_PIN
|
|
474
|
+ #endif
|
|
475
|
+ #endif // !FYSETC_MINI_12864
|
|
476
|
+
|
|
477
|
+ #if IS_ULTIPANEL
|
|
478
|
+ #define LCD_PINS_D5 EXP1_05_PIN
|
|
479
|
+ #define LCD_PINS_D6 EXP1_04_PIN
|
|
480
|
+ #define LCD_PINS_D7 EXP1_03_PIN
|
|
481
|
+
|
|
482
|
+ #if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
|
483
|
+ #define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
|
484
|
+ #endif
|
|
485
|
+
|
|
486
|
+ #endif
|
|
487
|
+
|
|
488
|
+ #endif
|
|
489
|
+#endif // HAS_WIRED_LCD
|
|
490
|
+
|
|
491
|
+// Alter timing for graphical display
|
|
492
|
+#if HAS_MARLINUI_U8GLIB
|
|
493
|
+ #ifndef BOARD_ST7920_DELAY_1
|
|
494
|
+ #define BOARD_ST7920_DELAY_1 DELAY_NS(120) // DELAY_NS(96)
|
|
495
|
+ #endif
|
|
496
|
+ #ifndef BOARD_ST7920_DELAY_2
|
|
497
|
+ #define BOARD_ST7920_DELAY_2 DELAY_NS(80) // DELAY_NS(48)
|
|
498
|
+ #endif
|
|
499
|
+ #ifndef BOARD_ST7920_DELAY_3
|
|
500
|
+ #define BOARD_ST7920_DELAY_3 DELAY_NS(580) // DELAY_NS(600)
|
|
501
|
+ #endif
|
|
502
|
+#endif
|
|
503
|
+
|
|
504
|
+//
|
|
505
|
+// WIFI
|
|
506
|
+//
|
|
507
|
+
|
|
508
|
+/**
|
|
509
|
+ * -------
|
|
510
|
+ * GND | 9 | | 8 | 3.3V
|
|
511
|
+ * (ESP-CS) PB12 | 10 | | 7 | PB15 (ESP-MOSI)
|
|
512
|
+ * 3.3V | 11 | | 6 | PB14 (ESP-MISO)
|
|
513
|
+ * (ESP-IO0) PD7 | 12 | | 5 | PB13 (ESP-CLK)
|
|
514
|
+ * (ESP-IO4) PD10 | 13 | | 4 | NC
|
|
515
|
+ * NC | 14 | | 3 | PE15 (ESP-EN)
|
|
516
|
+ * (ESP-RX) PD8 | 15 | | 2 | NC
|
|
517
|
+ * (ESP-TX) PD9 | 16 | | 1 | PE14 (ESP-RST)
|
|
518
|
+ * -------
|
|
519
|
+ * WIFI
|
|
520
|
+ */
|
|
521
|
+#define ESP_WIFI_MODULE_COM 3 // Must also set either SERIAL_PORT or SERIAL_PORT_2 to this
|
|
522
|
+#define ESP_WIFI_MODULE_BAUDRATE BAUDRATE // Must use same BAUDRATE as SERIAL_PORT & SERIAL_PORT_2
|
|
523
|
+#define ESP_WIFI_MODULE_RESET_PIN PG7
|
|
524
|
+#define ESP_WIFI_MODULE_ENABLE_PIN PG8
|
|
525
|
+#define ESP_WIFI_MODULE_GPIO0_PIN PD7
|
|
526
|
+#define ESP_WIFI_MODULE_GPIO4_PIN PD10
|