Parcourir la source

BTT Motor Expansion for SKR Pro (#20123)

Minims il y a 3 ans
Parent
révision
189306d24e
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 111 ajouts et 39 suppressions
  1. 111
    39
      Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h

+ 111
- 39
Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h Voir le fichier

@@ -25,6 +25,13 @@
25 25
   #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
26 26
 #endif
27 27
 
28
+// BigTreeTech driver expansion module https://bit.ly/3ptRRoj
29
+//#define BTT_MOTOR_EXPANSION
30
+
31
+#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
32
+  #error "It's not possible to have both LCD and motor expansion module on EXP1/EXP2."
33
+#endif
34
+
28 35
 // Use one of these or SDCard-based Emulation will be used
29 36
 #if NO_EEPROM_SELECTED
30 37
   //#define SRAM_EEPROM_EMULATION                 // Use BackSRAM-based EEPROM emulation
@@ -247,14 +254,43 @@
247 254
   #define SDCARD_CONNECTION                  LCD
248 255
 #endif
249 256
 
257
+/**
258
+ *               -----                                             -----
259
+ *           NC | 1 2 | GND                                    5V | 1 2 | GND
260
+ *        RESET | 3 4 | PF12(SD_DETECT)             (LCD_D7)  PG7 | 3 4 | PG6  (LCD_D6)
261
+ *   (MOSI)PB15 | 5 6   PF11(BTN_EN2)               (LCD_D5)  PG3 | 5 6   PG2  (LCD_D4)
262
+ *  (SD_SS)PB12 | 7 8 | PG10(BTN_EN1)               (LCD_RS) PD10 | 7 8 | PD11 (LCD_EN)
263
+ *    (SCK)PB13 | 9 10| PB14(MISO)                 (BTN_ENC)  PA8 | 9 10| PG4  (BEEPER)
264
+ *               -----                                             -----
265
+ *               EXP2                                              EXP1
266
+ */
267
+
268
+#define EXPA1_03_PIN                        PG7
269
+#define EXPA1_04_PIN                        PG6
270
+#define EXPA1_05_PIN                        PG3
271
+#define EXPA1_06_PIN                        PG2
272
+#define EXPA1_07_PIN                        PD10
273
+#define EXPA1_08_PIN                        PD11
274
+#define EXPA1_09_PIN                        PA8
275
+#define EXPA1_10_PIN                        PG4
276
+
277
+#define EXPA2_03_PIN                        -1
278
+#define EXPA2_04_PIN                        PF12
279
+#define EXPA2_05_PIN                        PB15
280
+#define EXPA2_06_PIN                        PF11
281
+#define EXPA2_07_PIN                        PB12
282
+#define EXPA2_08_PIN                        PG10
283
+#define EXPA2_09_PIN                        PB13
284
+#define EXPA2_10_PIN                        PB14
285
+
250 286
 //
251 287
 // Onboard SD card
252 288
 // Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
253 289
 //
254 290
 #if SD_CONNECTION_IS(LCD)
255 291
 
256
-  #define SD_DETECT_PIN                     PF12
257
-  #define SDSS                              PB12
292
+  #define SD_DETECT_PIN             EXPA2_04_PIN
293
+  #define SDSS                      EXPA2_07_PIN
258 294
 
259 295
 #elif SD_CONNECTION_IS(ONBOARD)
260 296
 
@@ -273,16 +309,52 @@
273 309
   #error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for this board"
274 310
 #endif
275 311
 
276
-/**
277
- *               -----                                             -----
278
- *           NC | · · | GND                                    5V | · · | GND
279
- *        RESET | · · | PF12(SD_DETECT)             (LCD_D7)  PG7 | · · | PG6  (LCD_D6)
280
- *   (MOSI)PB15 | · · | PF11(BTN_EN2)               (LCD_D5)  PG3 | · · | PG2  (LCD_D4)
281
- *  (SD_SS)PB12 | · · | PG10(BTN_EN1)               (LCD_RS) PD10 | · · | PD11 (LCD_EN)
282
- *    (SCK)PB13 | · · | PB14(MISO)                 (BTN_ENC)  PA8 | · · | PG4  (BEEPER)
283
- *               -----                                             -----
284
- *               EXP2                                              EXP1
285
- */
312
+#if ENABLED(BTT_MOTOR_EXPANSION)
313
+  /**
314
+   *               _____                                      _____
315
+   *           NC | · · | GND                             NC | · · | GND
316
+   *           NC | · · | PF12 (M1EN)            (M2EN)  PG7 | · · | PG6  (M3EN)
317
+   * (M1STP) PB15 | · ·   PF11 (M1DIR)           (M1RX)  PG3 | · ·   PG2  (M1DIAG)
318
+   * (M2DIR) PB12 | · · | PG10 (M2STP)           (M2RX) PD10 | · · | PD11 (M2DIAG)
319
+   * (M3DIR) PB13 | · · | PB14 (M3STP)           (M3RX)  PA8 | · · | PG4  (M3DIAG)
320
+   *               -----                                      -----
321
+   *               EXP2                                       EXP1
322
+   */
323
+
324
+  // M1 on Driver Expansion Module
325
+  #define E3_STEP_PIN               EXPA2_05_PIN
326
+  #define E3_DIR_PIN                EXPA2_06_PIN
327
+  #define E3_ENABLE_PIN             EXPA2_04_PIN
328
+  #define E3_DIAG_PIN               EXPA1_06_PIN
329
+  #define E3_CS_PIN                 EXPA1_05_PIN
330
+  #if HAS_TMC_UART
331
+    #define E3_SERIAL_TX_PIN        EXPA1_05_PIN
332
+    #define E3_SERIAL_RX_PIN        EXPA1_05_PIN
333
+  #endif
334
+
335
+  // M2 on Driver Expansion Module
336
+  #define E4_STEP_PIN               EXPA2_08_PIN
337
+  #define E4_DIR_PIN                EXPA2_07_PIN
338
+  #define E4_ENABLE_PIN             EXPA1_03_PIN
339
+  #define E4_DIAG_PIN               EXPA1_08_PIN
340
+  #define E4_CS_PIN                 EXPA1_07_PIN
341
+  #if HAS_TMC_UART
342
+    #define E4_SERIAL_TX_PIN        EXPA1_07_PIN
343
+    #define E4_SERIAL_RX_PIN        EXPA1_07_PIN
344
+  #endif
345
+
346
+  // M3 on Driver Expansion Module
347
+  #define E5_STEP_PIN               EXPA2_10_PIN
348
+  #define E5_DIR_PIN                EXPA2_09_PIN
349
+  #define E5_ENABLE_PIN             EXPA1_04_PIN
350
+  #define E5_DIAG_PIN               EXPA1_10_PIN
351
+  #define E5_CS_PIN                 EXPA1_09_PIN
352
+  #if HAS_TMC_UART
353
+    #define E5_SERIAL_TX_PIN        EXPA1_09_PIN
354
+    #define E5_SERIAL_RX_PIN        EXPA1_09_PIN
355
+  #endif
356
+
357
+#endif // BTT_MOTOR_EXPANSION
286 358
 
287 359
 //
288 360
 // LCDs and Controllers
@@ -290,23 +362,23 @@
290 362
 #if IS_TFTGLCD_PANEL
291 363
 
292 364
   #if ENABLED(TFTGLCD_PANEL_SPI)
293
-    #define TFTGLCD_CS                      PG10
365
+    #define TFTGLCD_CS              EXPA2_08_PIN
294 366
   #endif
295 367
 
296 368
 #elif HAS_WIRED_LCD
297 369
 
298
-  #define BEEPER_PIN                        PG4
299
-  #define BTN_ENC                           PA8
370
+  #define BEEPER_PIN                EXPA1_10_PIN
371
+  #define BTN_ENC                   EXPA1_09_PIN
300 372
 
301 373
   #if ENABLED(CR10_STOCKDISPLAY)
302 374
 
303
-    #define LCD_PINS_RS                     PG6
375
+    #define LCD_PINS_RS             EXPA1_04_PIN
304 376
 
305
-    #define BTN_EN1                         PD11
306
-    #define BTN_EN2                         PG2
377
+    #define BTN_EN1                 EXPA1_08_PIN
378
+    #define BTN_EN2                 EXPA1_06_PIN
307 379
 
308
-    #define LCD_PINS_ENABLE                 PG7
309
-    #define LCD_PINS_D4                     PG3
380
+    #define LCD_PINS_ENABLE         EXPA1_03_PIN
381
+    #define LCD_PINS_D4             EXPA1_05_PIN
310 382
 
311 383
     // CR10_STOCKDISPLAY default timing is too fast
312 384
     #undef BOARD_ST7920_DELAY_1
@@ -315,45 +387,45 @@
315 387
 
316 388
   #elif ENABLED(MKS_MINI_12864)
317 389
 
318
-    #define DOGLCD_A0                       PG6
319
-    #define DOGLCD_CS                       PG3
320
-    #define BTN_EN1                         PG10
321
-    #define BTN_EN2                         PF11
390
+    #define DOGLCD_A0               EXPA1_04_PIN
391
+    #define DOGLCD_CS               EXPA1_05_PIN
392
+    #define BTN_EN1                 EXPA2_08_PIN
393
+    #define BTN_EN2                 EXPA2_06_PIN
322 394
 
323 395
   #else
324 396
 
325
-    #define LCD_PINS_RS                     PD10
397
+    #define LCD_PINS_RS             EXPA1_07_PIN
326 398
 
327
-    #define BTN_EN1                         PG10
328
-    #define BTN_EN2                         PF11
399
+    #define BTN_EN1                 EXPA2_08_PIN
400
+    #define BTN_EN2                 EXPA2_06_PIN
329 401
 
330
-    #define LCD_PINS_ENABLE                 PD11
331
-    #define LCD_PINS_D4                     PG2
402
+    #define LCD_PINS_ENABLE         EXPA1_08_PIN
403
+    #define LCD_PINS_D4             EXPA1_06_PIN
332 404
 
333 405
     #if ENABLED(FYSETC_MINI_12864)
334
-      #define DOGLCD_CS                     PD11
335
-      #define DOGLCD_A0                     PD10
406
+      #define DOGLCD_CS             EXPA1_08_PIN
407
+      #define DOGLCD_A0             EXPA1_07_PIN
336 408
       //#define LCD_BACKLIGHT_PIN           -1
337
-      #define LCD_RESET_PIN                 PG2   // Must be high or open for LCD to operate normally.
409
+      #define LCD_RESET_PIN         EXPA1_06_PIN  // Must be high or open for LCD to operate normally.
338 410
       #if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
339 411
         #ifndef RGB_LED_R_PIN
340
-          #define RGB_LED_R_PIN             PG3
412
+          #define RGB_LED_R_PIN     EXPA1_05_PIN
341 413
         #endif
342 414
         #ifndef RGB_LED_G_PIN
343
-          #define RGB_LED_G_PIN             PG6
415
+          #define RGB_LED_G_PIN     EXPA1_04_PIN
344 416
         #endif
345 417
         #ifndef RGB_LED_B_PIN
346
-          #define RGB_LED_B_PIN             PG7
418
+          #define RGB_LED_B_PIN     EXPA1_03_PIN
347 419
         #endif
348 420
       #elif ENABLED(FYSETC_MINI_12864_2_1)
349
-        #define NEOPIXEL_PIN                PG3
421
+        #define NEOPIXEL_PIN        EXPA1_05_PIN
350 422
       #endif
351 423
     #endif // !FYSETC_MINI_12864
352 424
 
353 425
     #if IS_ULTIPANEL
354
-      #define LCD_PINS_D5                   PG3
355
-      #define LCD_PINS_D6                   PG6
356
-      #define LCD_PINS_D7                   PG7
426
+      #define LCD_PINS_D5           EXPA1_05_PIN
427
+      #define LCD_PINS_D6           EXPA1_04_PIN
428
+      #define LCD_PINS_D7           EXPA1_03_PIN
357 429
     #endif
358 430
 
359 431
   #endif

Chargement…
Annuler
Enregistrer