Browse Source

Unify BTT Motor Expansion Options (#21823)

Keith Bennett 3 years ago
parent
commit
b12d0d06eb
No account linked to committer's email address

+ 1
- 1
Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_4.h View File

@@ -279,7 +279,7 @@
279 279
     #undef SPEAKER
280 280
   #endif
281 281
 
282
-#elif HAS_WIRED_LCD && !HAS_BTT_EXP_MOT
282
+#elif HAS_WIRED_LCD && !BTT_MOTOR_EXPANSION
283 283
 
284 284
   #if ENABLED(ANET_FULL_GRAPHICS_LCD_ALT_WIRING)
285 285
     #error "CAUTION! ANET_FULL_GRAPHICS_LCD_ALT_WIRING requires wiring modifications. See 'pins_BTT_SKR_V1_4.h' for details. Comment out this line to continue."

+ 13
- 14
Marlin/src/pins/lpc1768/pins_BTT_SKR_common.h View File

@@ -23,11 +23,11 @@
23 23
 
24 24
 #include "env_validate.h"
25 25
 
26
-// If you have the Big tree tech driver expansion module, enable HAS_BTT_EXP_MOT
26
+// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
27 27
 // https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
28
-//#define HAS_BTT_EXP_MOT 1
28
+//#define BTT_MOTOR_EXPANSION
29 29
 
30
-#if BOTH(HAS_WIRED_LCD, HAS_BTT_EXP_MOT)
30
+#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
31 31
   #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
32 32
     #define EXP_MOT_USE_EXP2_ONLY 1
33 33
   #else
@@ -138,16 +138,15 @@
138 138
   #error "No custom SD drive cable defined for this board."
139 139
 #endif
140 140
 
141
-#if HAS_BTT_EXP_MOT
142
-
143
-  /**              _____                                      _____
144
-   *           NC | · · | GND                             NC | · · | GND
145
-   *           NC | · · | 1.31 (M1EN)            (M2EN) 1.23 | · · | 1.22 (M3EN)
146
-   * (M1STP) 0.18 | · ·   3.25 (M1DIR)           (M1RX) 1.21 | · ·   1.20 (M1DIAG)
147
-   * (M2DIR) 0.16 | · · | 3.26 (M2STP)           (M2RX) 1.19 | · · | 1.18 (M2DIAG)
148
-   * (M3DIR) 0.15 | · · | 0.17 (M3STP)           (M3RX) 0.28 | · · | 1.30 (M3DIAG)
149
-   *               -----                                      -----
150
-   *               EXP2                                       EXP1
141
+#if ENABLED(BTT_MOTOR_EXPANSION)
142
+  /**       _____                        _____
143
+   *    NC | . . | GND               NC | . . | GND
144
+   *    NC | . . | M1EN            M2EN | . . | M3EN
145
+   * M1STP | . .   M1DIR           M1RX | . .   M1DIAG
146
+   * M2DIR | . . | M2STP           M2RX | . . | M2DIAG
147
+   * M3DIR | . . | M3STP           M3RX | . . | M3DIAG
148
+   *        -----                        -----
149
+   *        EXP2                         EXP1
151 150
    *
152 151
    * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
153 152
    */
@@ -195,4 +194,4 @@
195 194
     #define E4_ENABLE_PIN            EXP2_04_PIN
196 195
   #endif
197 196
 
198
-#endif // HAS_BTT_EXP_MOT
197
+#endif // BTT_MOTOR_EXPANSION

+ 44
- 28
Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h View File

@@ -23,11 +23,16 @@
23 23
 
24 24
 #include "env_validate.h"
25 25
 
26
-// BigTreeTech driver expansion module https://bit.ly/3ptRRoj
26
+// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
27
+// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
27 28
 //#define BTT_MOTOR_EXPANSION
28 29
 
29 30
 #if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
30
-  #error "It's not possible to have both LCD and motor expansion module on EXP1/EXP2."
31
+  #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
32
+    #define EXP_MOT_USE_EXP2_ONLY 1
33
+  #else
34
+    #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time."
35
+  #endif
31 36
 #endif
32 37
 
33 38
 // Use one of these or SDCard-based Emulation will be used
@@ -311,48 +316,59 @@
311 316
 #endif
312 317
 
313 318
 #if ENABLED(BTT_MOTOR_EXPANSION)
314
-  /**
315
-   *               _____                                      _____
316
-   *           NC | · · | GND                             NC | · · | GND
317
-   *           NC | · · | PF12 (M1EN)            (M2EN)  PG7 | · · | PG6  (M3EN)
318
-   * (M1STP) PB15 | · ·   PF11 (M1DIR)           (M1RX)  PG3 | · ·   PG2  (M1DIAG)
319
-   * (M2DIR) PB12 | · · | PG10 (M2STP)           (M2RX) PD10 | · · | PD11 (M2DIAG)
320
-   * (M3DIR) PB13 | · · | PB14 (M3STP)           (M3RX)  PA8 | · · | PG4  (M3DIAG)
321
-   *               -----                                      -----
322
-   *               EXP2                                       EXP1
319
+  /**       _____                        _____
320
+   *    NC | . . | GND               NC | . . | GND
321
+   *    NC | . . | M1EN            M2EN | . . | M3EN
322
+   * M1STP | . .   M1DIR           M1RX | . .   M1DIAG
323
+   * M2DIR | . . | M2STP           M2RX | . . | M2DIAG
324
+   * M3DIR | . . | M3STP           M3RX | . . | M3DIAG
325
+   *        -----                        -----
326
+   *        EXP2                         EXP1
327
+   *
328
+   * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
323 329
    */
324 330
 
325 331
   // M1 on Driver Expansion Module
326 332
   #define E3_STEP_PIN                EXP2_05_PIN
327 333
   #define E3_DIR_PIN                 EXP2_06_PIN
328 334
   #define E3_ENABLE_PIN              EXP2_04_PIN
329
-  #define E3_DIAG_PIN                EXP1_06_PIN
330
-  #define E3_CS_PIN                  EXP1_05_PIN
331
-  #if HAS_TMC_UART
332
-    #define E3_SERIAL_TX_PIN         EXP1_05_PIN
333
-    #define E3_SERIAL_RX_PIN         EXP1_05_PIN
335
+  #if !EXP_MOT_USE_EXP2_ONLY
336
+    #define E3_DIAG_PIN              EXP1_06_PIN
337
+    #define E3_CS_PIN                EXP1_05_PIN
338
+    #if HAS_TMC_UART
339
+      #define E3_SERIAL_TX_PIN       EXP1_05_PIN
340
+      #define E3_SERIAL_RX_PIN       EXP1_05_PIN
341
+    #endif
334 342
   #endif
335 343
 
336 344
   // M2 on Driver Expansion Module
337 345
   #define E4_STEP_PIN                EXP2_08_PIN
338 346
   #define E4_DIR_PIN                 EXP2_07_PIN
339
-  #define E4_ENABLE_PIN              EXP1_03_PIN
340
-  #define E4_DIAG_PIN                EXP1_08_PIN
341
-  #define E4_CS_PIN                  EXP1_07_PIN
342
-  #if HAS_TMC_UART
343
-    #define E4_SERIAL_TX_PIN         EXP1_07_PIN
344
-    #define E4_SERIAL_RX_PIN         EXP1_07_PIN
347
+  #if !EXP_MOT_USE_EXP2_ONLY
348
+    #define E4_ENABLE_PIN            EXP1_03_PIN
349
+    #define E4_DIAG_PIN              EXP1_08_PIN
350
+    #define E4_CS_PIN                EXP1_07_PIN
351
+    #if HAS_TMC_UART
352
+      #define E4_SERIAL_TX_PIN       EXP1_07_PIN
353
+      #define E4_SERIAL_RX_PIN       EXP1_07_PIN
354
+    #endif
355
+  #else
356
+    #define E4_ENABLE_PIN            EXP2_04_PIN
345 357
   #endif
346 358
 
347 359
   // M3 on Driver Expansion Module
348 360
   #define E5_STEP_PIN                EXP2_10_PIN
349 361
   #define E5_DIR_PIN                 EXP2_09_PIN
350
-  #define E5_ENABLE_PIN              EXP1_04_PIN
351
-  #define E5_DIAG_PIN                EXP1_10_PIN
352
-  #define E5_CS_PIN                  EXP1_09_PIN
353
-  #if HAS_TMC_UART
354
-    #define E5_SERIAL_TX_PIN         EXP1_09_PIN
355
-    #define E5_SERIAL_RX_PIN         EXP1_09_PIN
362
+  #if !EXP_MOT_USE_EXP2_ONLY
363
+    #define E5_ENABLE_PIN            EXP1_04_PIN
364
+    #define E5_DIAG_PIN              EXP1_10_PIN
365
+    #define E5_CS_PIN                EXP1_09_PIN
366
+    #if HAS_TMC_UART
367
+      #define E5_SERIAL_TX_PIN       EXP1_09_PIN
368
+      #define E5_SERIAL_RX_PIN       EXP1_09_PIN
369
+    #endif
370
+  #else
371
+    #define E5_ENABLE_PIN            EXP2_04_PIN
356 372
   #endif
357 373
 
358 374
 #endif // BTT_MOTOR_EXPANSION

+ 56
- 33
Marlin/src/pins/stm32f4/pins_BTT_SKR_V2_0_common.h View File

@@ -23,6 +23,18 @@
23 23
 
24 24
 #include "env_validate.h"
25 25
 
26
+// If you have the BigTreeTech driver expansion module, enable BTT_MOTOR_EXPANSION
27
+// https://github.com/bigtreetech/BTT-Expansion-module/tree/master/BTT%20EXP-MOT
28
+//#define BTT_MOTOR_EXPANSION
29
+
30
+#if BOTH(HAS_WIRED_LCD, BTT_MOTOR_EXPANSION)
31
+  #if EITHER(CR10_STOCKDISPLAY, ENDER2_STOCKDISPLAY)
32
+    #define EXP_MOT_USE_EXP2_ONLY 1
33
+  #else
34
+    #error "You can't use both an LCD and a Motor Expansion Module on EXP1/EXP2 at the same time."
35
+  #endif
36
+#endif
37
+
26 38
 // Use one of these or SDCard-based Emulation will be used
27 39
 #if NO_EEPROM_SELECTED
28 40
   //#define SRAM_EEPROM_EMULATION                 // Use BackSRAM-based EEPROM emulation
@@ -349,48 +361,59 @@
349 361
 #endif
350 362
 
351 363
 #if ENABLED(BTT_MOTOR_EXPANSION)
352
-  /**
353
-   *               _____                                      _____
354
-   *           NC | · · | GND                             NC | · · | GND
355
-   *           NC | · · | PF12 (M1EN)            (M2EN)  PG7 | · · | PG6  (M3EN)
356
-   * (M1STP) PB15 | · ·   PF11 (M1DIR)           (M1RX)  PG3 | · ·   PG2  (M1DIAG)
357
-   * (M2DIR) PB12 | · · | PG10 (M2STP)           (M2RX) PD10 | · · | PD11 (M2DIAG)
358
-   * (M3DIR) PB13 | · · | PB14 (M3STP)           (M3RX)  PA8 | · · | PG4  (M3DIAG)
359
-   *               -----                                      -----
360
-   *               EXP2                                       EXP1
364
+  /**       _____                        _____
365
+   *    NC | . . | GND               NC | . . | GND
366
+   *    NC | . . | M1EN            M2EN | . . | M3EN
367
+   * M1STP | . .   M1DIR           M1RX | . .   M1DIAG
368
+   * M2DIR | . . | M2STP           M2RX | . . | M2DIAG
369
+   * M3DIR | . . | M3STP           M3RX | . . | M3DIAG
370
+   *        -----                        -----
371
+   *        EXP2                         EXP1
372
+   *
373
+   * NB In EXP_MOT_USE_EXP2_ONLY mode EXP1 is not used and M2EN and M3EN need to be jumpered to M1EN
361 374
    */
362 375
 
363 376
   // M1 on Driver Expansion Module
364
-  #define E3_STEP_PIN                EXP2_05_PIN
365
-  #define E3_DIR_PIN                 EXP2_06_PIN
366
-  #define E3_ENABLE_PIN              EXP2_04_PIN
367
-  #define E3_DIAG_PIN                EXP1_06_PIN
368
-  #define E3_CS_PIN                  EXP1_05_PIN
369
-  #if HAS_TMC_UART
370
-    #define E3_SERIAL_TX_PIN         EXP1_05_PIN
371
-    #define E3_SERIAL_RX_PIN         EXP1_05_PIN
377
+  #define E2_STEP_PIN                EXP2_05_PIN
378
+  #define E2_DIR_PIN                 EXP2_06_PIN
379
+  #define E2_ENABLE_PIN              EXP2_04_PIN
380
+  #if !EXP_MOT_USE_EXP2_ONLY
381
+    #define E2_DIAG_PIN              EXP1_06_PIN
382
+    #define E2_CS_PIN                EXP1_05_PIN
383
+    #if HAS_TMC_UART
384
+      #define E2_SERIAL_TX_PIN       EXP1_05_PIN
385
+      #define E2_SERIAL_RX_PIN       EXP1_05_PIN
386
+    #endif
372 387
   #endif
373 388
 
374 389
   // M2 on Driver Expansion Module
375
-  #define E4_STEP_PIN                EXP2_08_PIN
376
-  #define E4_DIR_PIN                 EXP2_07_PIN
377
-  #define E4_ENABLE_PIN              EXP1_03_PIN
378
-  #define E4_DIAG_PIN                EXP1_08_PIN
379
-  #define E4_CS_PIN                  EXP1_07_PIN
380
-  #if HAS_TMC_UART
381
-    #define E4_SERIAL_TX_PIN         EXP1_07_PIN
382
-    #define E4_SERIAL_RX_PIN         EXP1_07_PIN
390
+  #define E3_STEP_PIN                EXP2_08_PIN
391
+  #define E3_DIR_PIN                 EXP2_07_PIN
392
+  #if !EXP_MOT_USE_EXP2_ONLY
393
+    #define E3_ENABLE_PIN            EXP1_03_PIN
394
+    #define E3_DIAG_PIN              EXP1_08_PIN
395
+    #define E3_CS_PIN                EXP1_07_PIN
396
+    #if HAS_TMC_UART
397
+      #define E3_SERIAL_TX_PIN       EXP1_07_PIN
398
+      #define E3_SERIAL_RX_PIN       EXP1_07_PIN
399
+    #endif
400
+  #else
401
+    #define E3_ENABLE_PIN            EXP2_04_PIN
383 402
   #endif
384 403
 
385 404
   // M3 on Driver Expansion Module
386
-  #define E5_STEP_PIN                EXP2_10_PIN
387
-  #define E5_DIR_PIN                 EXP2_09_PIN
388
-  #define E5_ENABLE_PIN              EXP1_04_PIN
389
-  #define E5_DIAG_PIN                EXP1_10_PIN
390
-  #define E5_CS_PIN                  EXP1_09_PIN
391
-  #if HAS_TMC_UART
392
-    #define E5_SERIAL_TX_PIN         EXP1_09_PIN
393
-    #define E5_SERIAL_RX_PIN         EXP1_09_PIN
405
+  #define E4_STEP_PIN                EXP2_10_PIN
406
+  #define E4_DIR_PIN                 EXP2_09_PIN
407
+  #if !EXP_MOT_USE_EXP2_ONLY
408
+    #define E4_ENABLE_PIN            EXP1_04_PIN
409
+    #define E4_DIAG_PIN              EXP1_10_PIN
410
+    #define E4_CS_PIN                EXP1_09_PIN
411
+    #if HAS_TMC_UART
412
+      #define E4_SERIAL_TX_PIN       EXP1_09_PIN
413
+      #define E4_SERIAL_RX_PIN       EXP1_09_PIN
414
+    #endif
415
+  #else
416
+    #define E4_ENABLE_PIN            EXP2_04_PIN
394 417
   #endif
395 418
 
396 419
 #endif // BTT_MOTOR_EXPANSION

Loading…
Cancel
Save