浏览代码

Coolstep for TMC2130, 2209, 5130, 5160 (#16790)

Fabio Santos 4 年前
父节点
当前提交
894762259b
没有帐户链接到提交者的电子邮件

+ 0
- 5
Marlin/Configuration.h 查看文件

674
 //#define X_DRIVER_TYPE  A4988
674
 //#define X_DRIVER_TYPE  A4988
675
 //#define Y_DRIVER_TYPE  A4988
675
 //#define Y_DRIVER_TYPE  A4988
676
 //#define Z_DRIVER_TYPE  A4988
676
 //#define Z_DRIVER_TYPE  A4988
677
-//#define X2_DRIVER_TYPE A4988
678
-//#define Y2_DRIVER_TYPE A4988
679
-//#define Z2_DRIVER_TYPE A4988
680
-//#define Z3_DRIVER_TYPE A4988
681
-//#define Z4_DRIVER_TYPE A4988
682
 //#define E0_DRIVER_TYPE A4988
677
 //#define E0_DRIVER_TYPE A4988
683
 //#define E1_DRIVER_TYPE A4988
678
 //#define E1_DRIVER_TYPE A4988
684
 //#define E2_DRIVER_TYPE A4988
679
 //#define E2_DRIVER_TYPE A4988

+ 160
- 0
Marlin/Configuration_adv.h 查看文件

2276
   #define E7_HYBRID_THRESHOLD     30
2276
   #define E7_HYBRID_THRESHOLD     30
2277
 
2277
 
2278
   /**
2278
   /**
2279
+   * CoolStep. Currently supported for TMC2130, TMC2209, TMC5130 and TMC5160 only.
2280
+   * This mode allows for cooler steppers and energy savings.
2281
+   * The driver will switch to coolStep when stepper speed is over COOLSTEP_THRESHOLD mm/s.
2282
+   *
2283
+   * If SG_RESULT goes below COOLSTEP_LOWER_LOAD_THRESHOLD * 32 stepper current will be increased.
2284
+   * Set to 0 to disable CoolStep.
2285
+   *
2286
+   * If SG_RESULT goes above (COOLSTEP_LOWER_LOAD_THRESHOLD + COOLSTEP_UPPER_LOAD_THRESHOLD + 1) * 32
2287
+   * stepper current will be decreased.
2288
+   *
2289
+   * SEUP sets the increase step width. Value range is 0..3 and computed as 2^SEUP.
2290
+   * SEDN sets the decrease delay. Value range is 0..3, 0 being the slowest.
2291
+   * SEIMIN sets the lower current limit. 0: 1/2 of IRUN, 1:1/4 of IRUN
2292
+   */
2293
+
2294
+  #if AXIS_HAS_COOLSTEP(X)
2295
+    #define X_COOLSTEP_SPEED_THRESHOLD        5
2296
+    #define X_COOLSTEP_LOWER_LOAD_THRESHOLD   7
2297
+    #define X_COOLSTEP_UPPER_LOAD_THRESHOLD   0
2298
+    #define X_COOLSTEP_SEUP                   2
2299
+    #define X_COOLSTEP_SEDN                   0
2300
+    #define X_COOLSTEP_SEIMIN                 1
2301
+  #endif
2302
+
2303
+  #if AXIS_HAS_COOLSTEP(X2)
2304
+    #define X2_COOLSTEP_SPEED_THRESHOLD       5
2305
+    #define X2_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2306
+    #define X2_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2307
+    #define X2_COOLSTEP_SEUP                  2
2308
+    #define X2_COOLSTEP_SEDN                  0
2309
+    #define X2_COOLSTEP_SEIMIN                1
2310
+  #endif
2311
+
2312
+  #if AXIS_HAS_COOLSTEP(Y)
2313
+    #define Y_COOLSTEP_SPEED_THRESHOLD        5
2314
+    #define Y_COOLSTEP_LOWER_LOAD_THRESHOLD   7
2315
+    #define Y_COOLSTEP_UPPER_LOAD_THRESHOLD   0
2316
+    #define Y_COOLSTEP_SEUP                   2
2317
+    #define Y_COOLSTEP_SEDN                   0
2318
+    #define Y_COOLSTEP_SEIMIN                 1
2319
+  #endif
2320
+
2321
+  #if AXIS_HAS_COOLSTEP(Y2)
2322
+    #define Y2_COOLSTEP_SPEED_THRESHOLD       5
2323
+    #define Y2_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2324
+    #define Y2_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2325
+    #define Y2_COOLSTEP_SEUP                  2
2326
+    #define Y2_COOLSTEP_SEDN                  0
2327
+    #define Y2_COOLSTEP_SEIMIN                1
2328
+  #endif
2329
+
2330
+  #if AXIS_HAS_COOLSTEP(Z)
2331
+    #define Z_COOLSTEP_SPEED_THRESHOLD        5
2332
+    #define Z_COOLSTEP_LOWER_LOAD_THRESHOLD   7
2333
+    #define Z_COOLSTEP_UPPER_LOAD_THRESHOLD   0
2334
+    #define Z_COOLSTEP_SEUP                   2
2335
+    #define Z_COOLSTEP_SEDN                   0
2336
+    #define Z_COOLSTEP_SEIMIN                 1
2337
+  #endif
2338
+
2339
+  #if AXIS_HAS_COOLSTEP(Z2)
2340
+    #define Z2_COOLSTEP_SPEED_THRESHOLD       5
2341
+    #define Z2_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2342
+    #define Z2_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2343
+    #define Z2_COOLSTEP_SEUP                  2
2344
+    #define Z2_COOLSTEP_SEDN                  0
2345
+    #define Z2_COOLSTEP_SEIMIN                1
2346
+  #endif
2347
+
2348
+  #if AXIS_HAS_COOLSTEP(Z3)
2349
+    #define Z3_COOLSTEP_SPEED_THRESHOLD       5
2350
+    #define Z3_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2351
+    #define Z3_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2352
+    #define Z3_COOLSTEP_SEUP                  2
2353
+    #define Z3_COOLSTEP_SEDN                  0
2354
+    #define Z3_COOLSTEP_SEIMIN                1
2355
+  #endif
2356
+
2357
+  #if AXIS_HAS_COOLSTEP(Z4)
2358
+    #define Z4_COOLSTEP_SPEED_THRESHOLD       5
2359
+    #define Z4_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2360
+    #define Z4_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2361
+    #define Z4_COOLSTEP_SEUP                  2
2362
+    #define Z4_COOLSTEP_SEDN                  0
2363
+    #define Z4_COOLSTEP_SEIMIN                1
2364
+  #endif
2365
+
2366
+  #if AXIS_HAS_COOLSTEP(E0)
2367
+    #define E0_COOLSTEP_SPEED_THRESHOLD       5
2368
+    #define E0_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2369
+    #define E0_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2370
+    #define E0_COOLSTEP_SEUP                  2
2371
+    #define E0_COOLSTEP_SEDN                  0
2372
+    #define E0_COOLSTEP_SEIMIN                1
2373
+  #endif
2374
+
2375
+  #if AXIS_HAS_COOLSTEP(E1)
2376
+    #define E1_COOLSTEP_SPEED_THRESHOLD       5
2377
+    #define E1_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2378
+    #define E1_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2379
+    #define E1_COOLSTEP_SEUP                  2
2380
+    #define E1_COOLSTEP_SEDN                  0
2381
+    #define E1_COOLSTEP_SEIMIN                1
2382
+  #endif
2383
+
2384
+  #if AXIS_HAS_COOLSTEP(E2)
2385
+    #define E2_COOLSTEP_SPEED_THRESHOLD       5
2386
+    #define E2_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2387
+    #define E2_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2388
+    #define E2_COOLSTEP_SEUP                  2
2389
+    #define E2_COOLSTEP_SEDN                  0
2390
+    #define E2_COOLSTEP_SEIMIN                1
2391
+  #endif
2392
+
2393
+  #if AXIS_HAS_COOLSTEP(E3)
2394
+    #define E3_COOLSTEP_SPEED_THRESHOLD       5
2395
+    #define E3_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2396
+    #define E3_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2397
+    #define E3_COOLSTEP_SEUP                  2
2398
+    #define E3_COOLSTEP_SEDN                  0
2399
+    #define E3_COOLSTEP_SEIMIN                1
2400
+  #endif
2401
+
2402
+  #if AXIS_HAS_COOLSTEP(E4)
2403
+    #define E4_COOLSTEP_SPEED_THRESHOLD       5
2404
+    #define E4_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2405
+    #define E4_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2406
+    #define E4_COOLSTEP_SEUP                  2
2407
+    #define E4_COOLSTEP_SEDN                  0
2408
+    #define E4_COOLSTEP_SEIMIN                1
2409
+  #endif
2410
+
2411
+  #if AXIS_HAS_COOLSTEP(E5)
2412
+    #define E5_COOLSTEP_SPEED_THRESHOLD       5
2413
+    #define E5_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2414
+    #define E5_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2415
+    #define E5_COOLSTEP_SEUP                  2
2416
+    #define E5_COOLSTEP_SEDN                  0
2417
+    #define E5_COOLSTEP_SEIMIN                1
2418
+  #endif
2419
+
2420
+  #if AXIS_HAS_COOLSTEP(E6)
2421
+    #define E6_COOLSTEP_SPEED_THRESHOLD       5
2422
+    #define E6_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2423
+    #define E6_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2424
+    #define E6_COOLSTEP_SEUP                  2
2425
+    #define E6_COOLSTEP_SEDN                  0
2426
+    #define E6_COOLSTEP_SEIMIN                1
2427
+  #endif
2428
+
2429
+  #if AXIS_HAS_COOLSTEP(E7)
2430
+    #define E7_COOLSTEP_SPEED_THRESHOLD       5
2431
+    #define E7_COOLSTEP_LOWER_LOAD_THRESHOLD  7
2432
+    #define E7_COOLSTEP_UPPER_LOAD_THRESHOLD  0
2433
+    #define E7_COOLSTEP_SEUP                  2
2434
+    #define E7_COOLSTEP_SEDN                  0
2435
+    #define E7_COOLSTEP_SEIMIN                1
2436
+  #endif
2437
+
2438
+  /**
2279
    * Use StallGuard2 to home / probe X, Y, Z.
2439
    * Use StallGuard2 to home / probe X, Y, Z.
2280
    *
2440
    *
2281
    * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only
2441
    * TMC2130, TMC2160, TMC2209, TMC2660, TMC5130, and TMC5160 only

+ 1
- 1
Marlin/src/HAL/HAL_AVR/inc/SanityCheck.h 查看文件

60
   #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
60
   #error "TMCStepper includes SoftwareSerial.h which is incompatible with ENDSTOP_INTERRUPTS_FEATURE. Disable ENDSTOP_INTERRUPTS_FEATURE to continue."
61
 #endif
61
 #endif
62
 
62
 
63
-#if TMC_HAS_SW_SERIAL && ENABLED(MONITOR_DRIVER_STATUS)
63
+#if HAS_TMC_SW_SERIAL && ENABLED(MONITOR_DRIVER_STATUS)
64
   #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
64
   #error "MONITOR_DRIVER_STATUS causes performance issues when used with SoftwareSerial-connected drivers. Disable MONITOR_DRIVER_STATUS or use hardware serial to continue."
65
 #endif
65
 #endif

+ 1
- 1
Marlin/src/HAL/HAL_DUE/inc/SanityCheck.h 查看文件

56
   #error "FAST_PWM_FAN is not yet implemented for this platform."
56
   #error "FAST_PWM_FAN is not yet implemented for this platform."
57
 #endif
57
 #endif
58
 
58
 
59
-#if TMC_HAS_SW_SERIAL
59
+#if HAS_TMC_SW_SERIAL
60
   #error "TMC220x Software Serial is not supported on this platform."
60
   #error "TMC220x Software Serial is not supported on this platform."
61
 #endif
61
 #endif

+ 1
- 1
Marlin/src/HAL/HAL_ESP32/inc/SanityCheck.h 查看文件

29
   #error "FAST_PWM_FAN is not yet implemented for this platform."
29
   #error "FAST_PWM_FAN is not yet implemented for this platform."
30
 #endif
30
 #endif
31
 
31
 
32
-#if TMC_HAS_SW_SERIAL
32
+#if HAS_TMC_SW_SERIAL
33
   #error "TMC220x Software Serial is not supported on this platform."
33
   #error "TMC220x Software Serial is not supported on this platform."
34
 #endif
34
 #endif
35
 
35
 

+ 1
- 1
Marlin/src/HAL/HAL_LINUX/inc/SanityCheck.h 查看文件

34
   #error "FAST_PWM_FAN is not yet implemented for this platform."
34
   #error "FAST_PWM_FAN is not yet implemented for this platform."
35
 #endif
35
 #endif
36
 
36
 
37
-#if TMC_HAS_SW_SERIAL
37
+#if HAS_TMC_SW_SERIAL
38
   #error "TMC220x Software Serial is not supported on this platform."
38
   #error "TMC220x Software Serial is not supported on this platform."
39
 #endif
39
 #endif

+ 1
- 1
Marlin/src/HAL/HAL_SAMD51/inc/SanityCheck.h 查看文件

47
   #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator"
47
   #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Activator"
48
 #endif
48
 #endif
49
 
49
 
50
-#if TMC_HAS_SW_SERIAL
50
+#if HAS_TMC_SW_SERIAL
51
   #error "TMC220x Software Serial is not supported on this platform."
51
   #error "TMC220x Software Serial is not supported on this platform."
52
 #endif
52
 #endif

+ 2
- 2
Marlin/src/HAL/HAL_STM32/HAL.cpp 查看文件

28
 #include "../../inc/MarlinConfig.h"
28
 #include "../../inc/MarlinConfig.h"
29
 #include "../shared/Delay.h"
29
 #include "../shared/Delay.h"
30
 
30
 
31
-#if TMC_HAS_SW_SERIAL
31
+#if HAS_TMC_SW_SERIAL
32
   #include "SoftwareSerial.h"
32
   #include "SoftwareSerial.h"
33
 #endif
33
 #endif
34
 
34
 
87
   while (!LL_PWR_IsActiveFlag_BRR());
87
   while (!LL_PWR_IsActiveFlag_BRR());
88
   #endif // EEPROM_EMULATED_SRAM
88
   #endif // EEPROM_EMULATED_SRAM
89
 
89
 
90
-  #if TMC_HAS_SW_SERIAL
90
+  #if HAS_TMC_SW_SERIAL
91
     SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0);
91
     SoftwareSerial::setInterruptPriority(SWSERIAL_TIMER_IRQ_PRIO, 0);
92
   #endif
92
   #endif
93
 }
93
 }

+ 1
- 1
Marlin/src/HAL/HAL_STM32F1/inc/SanityCheck.h 查看文件

37
   #error "FAST_PWM_FAN is not yet implemented for this platform."
37
   #error "FAST_PWM_FAN is not yet implemented for this platform."
38
 #endif
38
 #endif
39
 
39
 
40
-#if !defined(HAVE_SW_SERIAL) && TMC_HAS_SW_SERIAL
40
+#if !defined(HAVE_SW_SERIAL) && HAS_TMC_SW_SERIAL
41
   #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
41
   #warning "With TMC2208/9 consider using SoftwareSerialM with HAVE_SW_SERIAL and appropriate SS_TIMER."
42
   #error "Missing SoftwareSerial implementation."
42
   #error "Missing SoftwareSerial implementation."
43
 #endif
43
 #endif

+ 1
- 1
Marlin/src/HAL/HAL_STM32_F4_F7/inc/SanityCheck.h 查看文件

36
   #error "FAST_PWM_FAN is not yet implemented for this platform."
36
   #error "FAST_PWM_FAN is not yet implemented for this platform."
37
 #endif
37
 #endif
38
 
38
 
39
-#if TMC_HAS_SW_SERIAL
39
+#if HAS_TMC_SW_SERIAL
40
   #error "TMC220x Software Serial is not supported on this platform."
40
   #error "TMC220x Software Serial is not supported on this platform."
41
 #endif
41
 #endif

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY31_32/inc/SanityCheck.h 查看文件

33
   #error "FAST_PWM_FAN is not yet implemented for this platform."
33
   #error "FAST_PWM_FAN is not yet implemented for this platform."
34
 #endif
34
 #endif
35
 
35
 
36
-#if TMC_HAS_SW_SERIAL
36
+#if HAS_TMC_SW_SERIAL
37
   #error "TMC220x Software Serial is not supported on this platform."
37
   #error "TMC220x Software Serial is not supported on this platform."
38
 #endif
38
 #endif

+ 1
- 1
Marlin/src/HAL/HAL_TEENSY35_36/inc/SanityCheck.h 查看文件

33
   #error "FAST_PWM_FAN is not yet implemented for this platform."
33
   #error "FAST_PWM_FAN is not yet implemented for this platform."
34
 #endif
34
 #endif
35
 
35
 
36
-#if TMC_HAS_SW_SERIAL
36
+#if HAS_TMC_SW_SERIAL
37
   #error "TMC220x Software Serial is not supported on this platform."
37
   #error "TMC220x Software Serial is not supported on this platform."
38
 #endif
38
 #endif

+ 1
- 1
Marlin/src/MarlinCore.cpp 查看文件

892
   SERIAL_ECHOLNPGM("start");
892
   SERIAL_ECHOLNPGM("start");
893
   SERIAL_ECHO_START();
893
   SERIAL_ECHO_START();
894
 
894
 
895
-  #if TMC_HAS_SPI
895
+  #if HAS_TMC_SPI
896
     #if DISABLED(TMC_USE_SW_SPI)
896
     #if DISABLED(TMC_USE_SW_SPI)
897
       SPI.begin();
897
       SPI.begin();
898
     #endif
898
     #endif

+ 21
- 8
Marlin/src/core/drivers.h 查看文件

52
 #define _TMC5160_STANDALONE 0x5160B
52
 #define _TMC5160_STANDALONE 0x5160B
53
 
53
 
54
 #define _DRIVER_ID(V) _CAT(_, V)
54
 #define _DRIVER_ID(V) _CAT(_, V)
55
-#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _CAT(_, T))
55
+#define _AXIS_DRIVER_TYPE(A,T) (_DRIVER_ID(A##_DRIVER_TYPE) == _DRIVER_ID(T))
56
 
56
 
57
 #define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T)
57
 #define AXIS_DRIVER_TYPE_X(T) _AXIS_DRIVER_TYPE(X,T)
58
 #define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T)
58
 #define AXIS_DRIVER_TYPE_Y(T) _AXIS_DRIVER_TYPE(Y,T)
148
                                    || AXIS_DRIVER_TYPE(A,TMC5130) \
148
                                    || AXIS_DRIVER_TYPE(A,TMC5130) \
149
                                    || AXIS_DRIVER_TYPE(A,TMC5160) )
149
                                    || AXIS_DRIVER_TYPE(A,TMC5160) )
150
 
150
 
151
+#define AXIS_HAS_SG_RESULT(A)    (    AXIS_DRIVER_TYPE(A,TMC2130) \
152
+                                   || AXIS_DRIVER_TYPE(A,TMC2160) \
153
+                                   || AXIS_DRIVER_TYPE(A,TMC2208) \
154
+                                   || AXIS_DRIVER_TYPE(A,TMC2209) )
155
+
156
+#define AXIS_HAS_COOLSTEP(A)     (    AXIS_DRIVER_TYPE(A,TMC2130) \
157
+                                   || AXIS_DRIVER_TYPE(A,TMC2209) \
158
+                                   || AXIS_DRIVER_TYPE(A,TMC5130) \
159
+                                   || AXIS_DRIVER_TYPE(A,TMC5160) )
160
+
161
+#define _OR_EAH(N,T)    || AXIS_HAS_##T(E##N)
162
+#define E_AXIS_HAS(T)   (0 RREPEAT2(E_STEPPERS, _OR_EAH, T))
163
+
151
 #define ANY_AXIS_HAS(T) (    AXIS_HAS_##T(X)  || AXIS_HAS_##T(X2) \
164
 #define ANY_AXIS_HAS(T) (    AXIS_HAS_##T(X)  || AXIS_HAS_##T(X2) \
152
                           || AXIS_HAS_##T(Y)  || AXIS_HAS_##T(Y2) \
165
                           || AXIS_HAS_##T(Y)  || AXIS_HAS_##T(Y2) \
153
                           || AXIS_HAS_##T(Z)  || AXIS_HAS_##T(Z2) \
166
                           || AXIS_HAS_##T(Z)  || AXIS_HAS_##T(Z2) \
154
-                          || AXIS_HAS_##T(Z3) \
155
-                          || AXIS_HAS_##T(E0) || AXIS_HAS_##T(E1) \
156
-                          || AXIS_HAS_##T(E2) || AXIS_HAS_##T(E3) \
157
-                          || AXIS_HAS_##T(E4) || AXIS_HAS_##T(E5) \
158
-                          || AXIS_HAS_##T(E6) || AXIS_HAS_##T(E7) )
167
+                          || AXIS_HAS_##T(Z3) || AXIS_HAS_##T(Z4) \
168
+                          || E_AXIS_HAS(T) )
159
 
169
 
160
 #define HAS_STEALTHCHOP    ANY_AXIS_HAS(STEALTHCHOP)
170
 #define HAS_STEALTHCHOP    ANY_AXIS_HAS(STEALTHCHOP)
161
 #define HAS_STALLGUARD     ANY_AXIS_HAS(STALLGUARD)
171
 #define HAS_STALLGUARD     ANY_AXIS_HAS(STALLGUARD)
162
-#define TMC_HAS_SPI        ANY_AXIS_HAS(SPI)
163
-#define TMC_HAS_SW_SERIAL  ANY_AXIS_HAS(SW_SERIAL)
172
+#define HAS_SG_RESULT      ANY_AXIS_HAS(SG_RESULT)
173
+#define HAS_COOLSTEP       ANY_AXIS_HAS(COOLSTEP)
174
+#define HAS_TMC_UART       ANY_AXIS_HAS(UART)
175
+#define HAS_TMC_SPI        ANY_AXIS_HAS(SPI)
176
+#define HAS_TMC_SW_SERIAL  ANY_AXIS_HAS(SW_SERIAL)
164
 
177
 
165
 //
178
 //
166
 // Stretching 'drivers.h' to include LPC/SAMD51 SD options
179
 // Stretching 'drivers.h' to include LPC/SAMD51 SD options

+ 20
- 11
Marlin/src/feature/tmc_util.cpp 查看文件

629
         default: break;
629
         default: break;
630
       }
630
       }
631
     }
631
     }
632
+
633
+    #if HAS_DRIVER(TMC2209)
634
+      static void _tmc_parse_drv_status(TMC2209Stepper &st, const TMC_drv_status_enum i) {
635
+        switch (i) {
636
+          case TMC_SG_RESULT: SERIAL_PRINT(st.SG_RESULT(), DEC); break;
637
+          default:            _tmc_parse_drv_status(static_cast<TMC2208Stepper &>(st), i); break;
638
+        }
639
+      }
640
+    #endif
632
   #endif
641
   #endif
633
 
642
 
634
   #if HAS_DRIVER(TMC2660)
643
   #if HAS_DRIVER(TMC2660)
891
     TMC_REPORT("stealthChop",        TMC_STEALTHCHOP);
900
     TMC_REPORT("stealthChop",        TMC_STEALTHCHOP);
892
     TMC_REPORT("msteps\t",           TMC_MICROSTEPS);
901
     TMC_REPORT("msteps\t",           TMC_MICROSTEPS);
893
     TMC_REPORT("tstep\t",            TMC_TSTEP);
902
     TMC_REPORT("tstep\t",            TMC_TSTEP);
894
-    TMC_REPORT("pwm\nthreshold",     TMC_TPWMTHRS);
903
+    TMC_REPORT("PWM thresh.",        TMC_TPWMTHRS);
895
     TMC_REPORT("[mm/s]\t",           TMC_TPWMTHRS_MMS);
904
     TMC_REPORT("[mm/s]\t",           TMC_TPWMTHRS_MMS);
896
     TMC_REPORT("OT prewarn",         TMC_OTPW);
905
     TMC_REPORT("OT prewarn",         TMC_OTPW);
897
     #if ENABLED(MONITOR_DRIVER_STATUS)
906
     #if ENABLED(MONITOR_DRIVER_STATUS)
898
-      TMC_REPORT("OT prewarn has\n"
899
-                 "been triggered",   TMC_OTPW_TRIGGERED);
907
+      TMC_REPORT("triggered\n OTP\t", TMC_OTPW_TRIGGERED);
900
     #endif
908
     #endif
901
     TMC_REPORT("off time",           TMC_TOFF);
909
     TMC_REPORT("off time",           TMC_TOFF);
902
     TMC_REPORT("blank time",         TMC_TBL);
910
     TMC_REPORT("blank time",         TMC_TBL);
903
-    TMC_REPORT("hysteresis\n-end\t", TMC_HEND);
904
-    TMC_REPORT("-start\t",           TMC_HSTRT);
911
+    TMC_REPORT("hysteresis\n -end\t", TMC_HEND);
912
+    TMC_REPORT(" -start\t",          TMC_HSTRT);
905
     TMC_REPORT("Stallguard thrs",    TMC_SGT);
913
     TMC_REPORT("Stallguard thrs",    TMC_SGT);
906
-
907
     DRV_REPORT("DRVSTATUS",          TMC_DRV_CODES);
914
     DRV_REPORT("DRVSTATUS",          TMC_DRV_CODES);
908
-    #if HAS_TMCX1X0
909
-      DRV_REPORT("stallguard\t",     TMC_STALLGUARD);
915
+    #if HAS_TMCX1X0 || HAS_TMC220x
910
       DRV_REPORT("sg_result",        TMC_SG_RESULT);
916
       DRV_REPORT("sg_result",        TMC_SG_RESULT);
911
-      DRV_REPORT("fsactive\t",       TMC_FSACTIVE);
917
+    #endif
918
+    #if HAS_TMCX1X0
919
+      DRV_REPORT("stallguard",       TMC_STALLGUARD);
920
+      DRV_REPORT("fsactive",         TMC_FSACTIVE);
912
     #endif
921
     #endif
913
     DRV_REPORT("stst\t",             TMC_STST);
922
     DRV_REPORT("stst\t",             TMC_STST);
914
     DRV_REPORT("olb\t",              TMC_OLB);
923
     DRV_REPORT("olb\t",              TMC_OLB);
1103
 
1112
 
1104
 #endif // USE_SENSORLESS
1113
 #endif // USE_SENSORLESS
1105
 
1114
 
1106
-#if TMC_HAS_SPI
1115
+#if HAS_TMC_SPI
1107
   #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH)
1116
   #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH)
1108
   void tmc_init_cs_pins() {
1117
   void tmc_init_cs_pins() {
1109
     #if AXIS_HAS_SPI(X)
1118
     #if AXIS_HAS_SPI(X)
1155
       SET_CS_PIN(E7);
1164
       SET_CS_PIN(E7);
1156
     #endif
1165
     #endif
1157
   }
1166
   }
1158
-#endif // TMC_HAS_SPI
1167
+#endif // HAS_TMC_SPI
1159
 
1168
 
1160
 template<typename TMC>
1169
 template<typename TMC>
1161
 static bool test_connection(TMC &st) {
1170
 static bool test_connection(TMC &st) {

+ 21
- 2
Marlin/src/feature/tmc_util.h 查看文件

110
       inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); }
110
       inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); }
111
       inline bool get_stealthChop_status() { return this->en_pwm_mode(); }
111
       inline bool get_stealthChop_status() { return this->en_pwm_mode(); }
112
     #endif
112
     #endif
113
+
113
     #if ENABLED(HYBRID_THRESHOLD)
114
     #if ENABLED(HYBRID_THRESHOLD)
114
       uint32_t get_pwm_thrs() {
115
       uint32_t get_pwm_thrs() {
115
         return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
116
         return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
121
         #endif
122
         #endif
122
       }
123
       }
123
     #endif
124
     #endif
125
+
124
     #if USE_SENSORLESS
126
     #if USE_SENSORLESS
125
       inline int16_t homing_threshold() { return TMC::sgt(); }
127
       inline int16_t homing_threshold() { return TMC::sgt(); }
126
       void homing_threshold(int16_t sgt_val) {
128
       void homing_threshold(int16_t sgt_val) {
135
       #endif
137
       #endif
136
     #endif
138
     #endif
137
 
139
 
140
+    uint32_t get_cool_thrs() {
141
+      return _tmc_thrs(this->microsteps(), this->TCOOLTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
142
+    }
143
+    void set_cool_thrs(const uint32_t thrs) {
144
+      TMC::TCOOLTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
145
+    }
146
+
138
     #if HAS_LCD_MENU
147
     #if HAS_LCD_MENU
139
       inline void refresh_stepper_current() { rms_current(this->val_mA); }
148
       inline void refresh_stepper_current() { rms_current(this->val_mA); }
140
 
149
 
149
     static constexpr int8_t sgt_min = -64,
158
     static constexpr int8_t sgt_min = -64,
150
                             sgt_max =  63;
159
                             sgt_max =  63;
151
 };
160
 };
161
+
152
 template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
162
 template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
153
 class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC2208Stepper, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
163
 class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> : public TMC2208Stepper, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
154
   public:
164
   public:
172
       inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
182
       inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
173
       inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
183
       inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
174
     #endif
184
     #endif
185
+
175
     #if ENABLED(HYBRID_THRESHOLD)
186
     #if ENABLED(HYBRID_THRESHOLD)
176
       uint32_t get_pwm_thrs() {
187
       uint32_t get_pwm_thrs() {
177
         return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
188
         return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
217
       inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
228
       inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
218
       inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
229
       inline bool get_stealthChop_status() { return !this->en_spreadCycle(); }
219
     #endif
230
     #endif
231
+
220
     #if ENABLED(HYBRID_THRESHOLD)
232
     #if ENABLED(HYBRID_THRESHOLD)
221
       uint32_t get_pwm_thrs() {
233
       uint32_t get_pwm_thrs() {
222
         return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
234
         return _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
228
         #endif
240
         #endif
229
       }
241
       }
230
     #endif
242
     #endif
243
+
244
+    uint32_t get_cool_thrs() {
245
+      return _tmc_thrs(this->microsteps(), this->TCOOLTHRS(), planner.settings.axis_steps_per_mm[AXIS_ID]);
246
+    }
247
+    void set_cool_thrs(const uint32_t thrs) {
248
+      TMC2209Stepper::TCOOLTHRS(_tmc_thrs(this->microsteps(), thrs, planner.settings.axis_steps_per_mm[AXIS_ID]));
249
+    }
250
+
231
     #if USE_SENSORLESS
251
     #if USE_SENSORLESS
232
       inline int16_t homing_threshold() { return TMC2209Stepper::SGTHRS(); }
252
       inline int16_t homing_threshold() { return TMC2209Stepper::SGTHRS(); }
233
       void homing_threshold(int16_t sgt_val) {
253
       void homing_threshold(int16_t sgt_val) {
241
 
261
 
242
     #if HAS_LCD_MENU
262
     #if HAS_LCD_MENU
243
       inline void refresh_stepper_current() { rms_current(this->val_mA); }
263
       inline void refresh_stepper_current() { rms_current(this->val_mA); }
244
-
245
       #if ENABLED(HYBRID_THRESHOLD)
264
       #if ENABLED(HYBRID_THRESHOLD)
246
         inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
265
         inline void refresh_hybrid_thrs() { set_pwm_thrs(this->stored.hybrid_thrs); }
247
       #endif
266
       #endif
391
 
410
 
392
 #endif // USE_SENSORLESS
411
 #endif // USE_SENSORLESS
393
 
412
 
394
-#if TMC_HAS_SPI
413
+#if HAS_TMC_SPI
395
   void tmc_init_cs_pins();
414
   void tmc_init_cs_pins();
396
 #endif
415
 #endif
397
 
416
 

+ 57
- 1
Marlin/src/inc/SanityCheck.h 查看文件

2041
 #endif
2041
 #endif
2042
 
2042
 
2043
 /**
2043
 /**
2044
+ * Make sure CoolStep settings exist
2045
+ */
2046
+#if HAS_COOLSTEP
2047
+  #define NEEDS_COOLSTEP(A) AXIS_HAS_COOLSTEP(A) && !(defined(A##_COOLSTEP_SPEED_THRESHOLD) && defined(A##_COOLSTEP_LOWER_LOAD_THRESHOLD) && defined(A##_COOLSTEP_UPPER_LOAD_THRESHOLD) && defined(A##_COOLSTEP_SEUP) && defined(A##_COOLSTEP_SEDN) && defined(A##_COOLSTEP_SEIMIN))
2048
+  #if NEEDS_COOLSTEP(X)
2049
+    #error "X COOLSTEP settings must be defined in Configuration_adv.h."
2050
+  #endif
2051
+  #if NEEDS_COOLSTEP(X2)
2052
+    #error "X2 COOLSTEP settings must be defined in Configuration_adv.h."
2053
+  #endif
2054
+  #if NEEDS_COOLSTEP(Y)
2055
+    #error "Y COOLSTEP settings must be defined in Configuration_adv.h."
2056
+  #endif
2057
+  #if NEEDS_COOLSTEP(Y2)
2058
+    #error "Y2 COOLSTEP settings must be defined in Configuration_adv.h."
2059
+  #endif
2060
+  #if NEEDS_COOLSTEP(Z)
2061
+    #error "Z COOLSTEP settings must be defined in Configuration_adv.h."
2062
+  #endif
2063
+  #if NEEDS_COOLSTEP(Z2)
2064
+    #error "Z2 COOLSTEP settings must be defined in Configuration_adv.h."
2065
+  #endif
2066
+  #if NEEDS_COOLSTEP(Z3)
2067
+    #error "Z3 COOLSTEP settings must be defined in Configuration_adv.h."
2068
+  #endif
2069
+  #if NEEDS_COOLSTEP(Z4)
2070
+    #error "Z4 COOLSTEP settings must be defined in Configuration_adv.h."
2071
+  #endif
2072
+  #if NEEDS_COOLSTEP(E0)
2073
+    #error "E0 COOLSTEP settings must be defined in Configuration_adv.h."
2074
+  #endif
2075
+  #if NEEDS_COOLSTEP(E1)
2076
+    #error "E1 COOLSTEP settings must be defined in Configuration_adv.h."
2077
+  #endif
2078
+  #if NEEDS_COOLSTEP(E2)
2079
+    #error "E2 COOLSTEP settings must be defined in Configuration_adv.h."
2080
+  #endif
2081
+  #if NEEDS_COOLSTEP(E3)
2082
+    #error "E3 COOLSTEP settings must be defined in Configuration_adv.h."
2083
+  #endif
2084
+  #if NEEDS_COOLSTEP(E4)
2085
+    #error "E4 COOLSTEP settings must be defined in Configuration_adv.h."
2086
+  #endif
2087
+  #if NEEDS_COOLSTEP(E5)
2088
+    #error "E5 COOLSTEP settings must be defined in Configuration_adv.h."
2089
+  #endif
2090
+  #if NEEDS_COOLSTEP(E6)
2091
+    #error "E6 COOLSTEP settings must be defined in Configuration_adv.h."
2092
+  #endif
2093
+  #if NEEDS_COOLSTEP(E7)
2094
+    #error "E7 COOLSTEP settings must be defined in Configuration_adv.h."
2095
+  #endif
2096
+  #undef NEEDS_COOLSTEP
2097
+#endif
2098
+
2099
+/**
2044
  * Check existing CS pins against enabled TMC SPI drivers.
2100
  * Check existing CS pins against enabled TMC SPI drivers.
2045
  */
2101
  */
2046
 #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
2102
 #define INVALID_TMC_SPI(ST) (AXIS_HAS_SPI(ST) && !PIN_EXISTS(ST##_CS))
2650
  * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
2706
  * Check to make sure MONITOR_DRIVER_STATUS isn't enabled
2651
  * on boards where TMC drivers share the SPI bus with SD.
2707
  * on boards where TMC drivers share the SPI bus with SD.
2652
  */
2708
  */
2653
-#if TMC_HAS_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
2709
+#if HAS_TMC_SPI && ALL(MONITOR_DRIVER_STATUS, SDSUPPORT, USES_SHARED_SPI)
2654
   #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
2710
   #error "MONITOR_DRIVER_STATUS and SDSUPPORT cannot be used together on boards with shared SPI."
2655
 #endif
2711
 #endif

+ 1
- 1
Marlin/src/module/stepper.cpp 查看文件

1496
     #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
1496
     #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
1497
     #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN
1497
     #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN
1498
 
1498
 
1499
-    // Determine if pulses are needed
1499
+    // Determine if a pulse is needed using Bresenham
1500
     #define PULSE_PREP(AXIS) do{ \
1500
     #define PULSE_PREP(AXIS) do{ \
1501
       delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \
1501
       delta_error[_AXIS(AXIS)] += advance_dividend[_AXIS(AXIS)]; \
1502
       step_needed[_AXIS(AXIS)] = (delta_error[_AXIS(AXIS)] >= 0); \
1502
       step_needed[_AXIS(AXIS)] = (delta_error[_AXIS(AXIS)] >= 0); \

+ 149
- 36
Marlin/src/module/stepper/trinamic.cpp 查看文件

36
 #include <SPI.h>
36
 #include <SPI.h>
37
 
37
 
38
 enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
38
 enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
39
-#define _TMC_INIT(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, stealthchop_by_axis[STEALTH_INDEX])
39
+#define _TMC_INIT_1(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS)
40
+#define _TMC_INIT_2(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, stealthchop_by_axis[STEALTH_INDEX], ST##_HYBRID_THRESHOLD)
41
+#define _TMC_INIT_3(ST, STEALTH_INDEX) tmc_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, stealthchop_by_axis[STEALTH_INDEX], ST##_HYBRID_THRESHOLD, ST##_COOLSTEP_SPEED_THRESHOLD, ST##_COOLSTEP_LOWER_LOAD_THRESHOLD, ST##_COOLSTEP_UPPER_LOAD_THRESHOLD, ST##_COOLSTEP_SEUP, ST##_COOLSTEP_SEDN, ST##_COOLSTEP_SEIMIN)
42
+#define _TMC_INIT_TMC2660(ST, STEALTH_INDEX) _TMC_INIT_1(ST, STEALTH_INDEX)
43
+#define _TMC_INIT_TMC2160(ST, STEALTH_INDEX) _TMC_INIT_2(ST, STEALTH_INDEX)
44
+#define _TMC_INIT_TMC2208(ST, STEALTH_INDEX) _TMC_INIT_2(ST, STEALTH_INDEX)
45
+#define _TMC_INIT_TMC5130(ST, STEALTH_INDEX) _TMC_INIT_3(ST, STEALTH_INDEX)
46
+#define _TMC_INIT_TMC5160(ST, STEALTH_INDEX) _TMC_INIT_3(ST, STEALTH_INDEX)
47
+#define _TMC_INIT_TMC2130(ST, STEALTH_INDEX) _TMC_INIT_3(ST, STEALTH_INDEX)
48
+#define _TMC_INIT_TMC2209(ST, STEALTH_INDEX) _TMC_INIT_3(ST, STEALTH_INDEX)
49
+#define __TMC_INIT(DRV, ST, STEALTH_INDEX) _TMC_INIT_##DRV(ST, STEALTH_INDEX)
50
+#define _TMC_INIT(DRV, ST, STEALTH_INDEX) __TMC_INIT(DRV, ST, STEALTH_INDEX)
51
+#define TMC_INIT(ST, STEALTH_INDEX) _TMC_INIT(ST##_DRIVER_TYPE, ST, STEALTH_INDEX)
40
 
52
 
41
 //   IC = TMC model number
53
 //   IC = TMC model number
42
 //   ST = Stepper object letter
54
 //   ST = Stepper object letter
122
 
134
 
123
 #if HAS_DRIVER(TMC2130)
135
 #if HAS_DRIVER(TMC2130)
124
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
136
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
125
-  void tmc_init(TMCMarlin<TMC2130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) {
137
+  void tmc_init(
138
+    TMCMarlin<TMC2130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
139
+    const uint16_t mA,
140
+    const uint16_t microsteps,
141
+    const bool stealth,
142
+    const uint32_t hyb_thrs,
143
+    const uint32_t cool_thrs,
144
+    const uint8_t cool_semin,
145
+    const uint8_t cool_semax,
146
+    const uint8_t cool_seup,
147
+    const uint8_t cool_sedn,
148
+    const bool cool_seimin
149
+  ) {
126
     st.begin();
150
     st.begin();
127
 
151
 
128
     CHOPCONF_t chopconf{0};
152
     CHOPCONF_t chopconf{0};
152
     st.PWMCONF(pwmconf.sr);
176
     st.PWMCONF(pwmconf.sr);
153
 
177
 
154
     #if ENABLED(HYBRID_THRESHOLD)
178
     #if ENABLED(HYBRID_THRESHOLD)
155
-      st.set_pwm_thrs(thrs);
179
+      st.set_pwm_thrs(hyb_thrs);
156
     #else
180
     #else
157
-      UNUSED(thrs);
181
+      UNUSED(hyb_thrs);
158
     #endif
182
     #endif
159
 
183
 
184
+    st.set_cool_thrs(cool_thrs);  // (mm/s)
185
+    COOLCONF_t coolconf{0};
186
+    coolconf.semin = cool_semin;
187
+    coolconf.semax = cool_semax;
188
+    coolconf.seup = cool_seup;
189
+    coolconf.sedn = cool_sedn;
190
+    coolconf.seimin = cool_seimin;
191
+    st.COOLCONF(coolconf.sr);
192
+
160
     st.GSTAT(); // Clear GSTAT
193
     st.GSTAT(); // Clear GSTAT
161
   }
194
   }
162
 #endif // TMC2130
195
 #endif // TMC2130
163
 
196
 
164
 #if HAS_DRIVER(TMC2160)
197
 #if HAS_DRIVER(TMC2160)
165
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
198
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
166
-  void tmc_init(TMCMarlin<TMC2160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) {
199
+  void tmc_init(
200
+    TMCMarlin<TMC2160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
201
+    const uint16_t mA,
202
+    const uint16_t microsteps,
203
+    const bool stealth,
204
+    const uint32_t hyb_thrs
205
+  ) {
167
     st.begin();
206
     st.begin();
168
 
207
 
169
     CHOPCONF_t chopconf{0};
208
     CHOPCONF_t chopconf{0};
196
     st.PWMCONF(pwmconf.sr);
235
     st.PWMCONF(pwmconf.sr);
197
 
236
 
198
     #if ENABLED(HYBRID_THRESHOLD)
237
     #if ENABLED(HYBRID_THRESHOLD)
199
-      st.set_pwm_thrs(thrs);
238
+      st.set_pwm_thrs(hyb_thrs);
200
     #else
239
     #else
201
-      UNUSED(thrs);
240
+      UNUSED(hyb_thrs);
202
     #endif
241
     #endif
203
 
242
 
204
     st.GSTAT(); // Clear GSTAT
243
     st.GSTAT(); // Clear GSTAT
440
 
479
 
441
 #if HAS_DRIVER(TMC2208)
480
 #if HAS_DRIVER(TMC2208)
442
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
481
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
443
-  void tmc_init(TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) {
482
+  void tmc_init(
483
+    TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
484
+    const uint16_t mA,
485
+    const uint16_t microsteps,
486
+    const bool stealth,
487
+    const uint32_t hyb_thrs
488
+  ) {
444
     TMC2208_n::GCONF_t gconf{0};
489
     TMC2208_n::GCONF_t gconf{0};
445
     gconf.pdn_disable = true; // Use UART
490
     gconf.pdn_disable = true; // Use UART
446
     gconf.mstep_reg_select = true; // Select microsteps with UART
491
     gconf.mstep_reg_select = true; // Select microsteps with UART
476
     st.PWMCONF(pwmconf.sr);
521
     st.PWMCONF(pwmconf.sr);
477
 
522
 
478
     #if ENABLED(HYBRID_THRESHOLD)
523
     #if ENABLED(HYBRID_THRESHOLD)
479
-      st.set_pwm_thrs(thrs);
524
+      st.set_pwm_thrs(hyb_thrs);
480
     #else
525
     #else
481
-      UNUSED(thrs);
526
+      UNUSED(hyb_thrs);
482
     #endif
527
     #endif
483
 
528
 
484
     st.GSTAT(0b111); // Clear
529
     st.GSTAT(0b111); // Clear
488
 
533
 
489
 #if HAS_DRIVER(TMC2209)
534
 #if HAS_DRIVER(TMC2209)
490
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
535
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
491
-  void tmc_init(TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) {
536
+  void tmc_init(
537
+    TMCMarlin<TMC2209Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
538
+    const uint16_t mA,
539
+    const uint16_t microsteps,
540
+    const bool stealth,
541
+    const uint32_t hyb_thrs,
542
+    const uint32_t cool_thrs,
543
+    const uint8_t cool_semin,
544
+    const uint8_t cool_semax,
545
+    const uint8_t cool_seup,
546
+    const uint8_t cool_sedn,
547
+    const bool cool_seimin
548
+  ) {
492
     TMC2208_n::GCONF_t gconf{0};
549
     TMC2208_n::GCONF_t gconf{0};
493
     gconf.pdn_disable = true; // Use UART
550
     gconf.pdn_disable = true; // Use UART
494
     gconf.mstep_reg_select = true; // Select microsteps with UART
551
     gconf.mstep_reg_select = true; // Select microsteps with UART
524
     st.PWMCONF(pwmconf.sr);
581
     st.PWMCONF(pwmconf.sr);
525
 
582
 
526
     #if ENABLED(HYBRID_THRESHOLD)
583
     #if ENABLED(HYBRID_THRESHOLD)
527
-      st.set_pwm_thrs(thrs);
584
+      st.set_pwm_thrs(hyb_thrs);
528
     #else
585
     #else
529
-      UNUSED(thrs);
586
+      UNUSED(hyb_thrs);
530
     #endif
587
     #endif
531
 
588
 
589
+    st.set_cool_thrs(cool_thrs);  // (mm/s)
590
+    COOLCONF_t coolconf{0};
591
+    coolconf.semin = cool_semin;
592
+    coolconf.semax = cool_semax;
593
+    coolconf.seup = cool_seup;
594
+    coolconf.sedn = cool_sedn;
595
+    coolconf.seimin = cool_seimin;
596
+    st.COOLCONF(coolconf.sr);
597
+
532
     st.GSTAT(0b111); // Clear
598
     st.GSTAT(0b111); // Clear
533
     delay(200);
599
     delay(200);
534
   }
600
   }
536
 
602
 
537
 #if HAS_DRIVER(TMC2660)
603
 #if HAS_DRIVER(TMC2660)
538
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
604
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
539
-  void tmc_init(TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const bool) {
605
+  void tmc_init(
606
+    TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
607
+    const uint16_t mA,
608
+    const uint16_t microsteps
609
+  ) {
540
     st.begin();
610
     st.begin();
541
 
611
 
542
     TMC2660_n::CHOPCONF_t chopconf{0};
612
     TMC2660_n::CHOPCONF_t chopconf{0};
563
 
633
 
564
 #if HAS_DRIVER(TMC5130)
634
 #if HAS_DRIVER(TMC5130)
565
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
635
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
566
-  void tmc_init(TMCMarlin<TMC5130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) {
636
+  void tmc_init(
637
+    TMCMarlin<TMC5130Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
638
+    const uint16_t mA,
639
+    const uint16_t microsteps,
640
+    const bool stealth,
641
+    const uint32_t hyb_thrs,
642
+    const uint32_t cool_thrs,
643
+    const uint8_t cool_semin,
644
+    const uint8_t cool_semax,
645
+    const uint8_t cool_seup,
646
+    const uint8_t cool_sedn,
647
+    const bool cool_seimin
648
+  ) {
567
     st.begin();
649
     st.begin();
568
 
650
 
569
     CHOPCONF_t chopconf{0};
651
     CHOPCONF_t chopconf{0};
593
     st.PWMCONF(pwmconf.sr);
675
     st.PWMCONF(pwmconf.sr);
594
 
676
 
595
     #if ENABLED(HYBRID_THRESHOLD)
677
     #if ENABLED(HYBRID_THRESHOLD)
596
-      st.set_pwm_thrs(thrs);
678
+      st.set_pwm_thrs(hyb_thrs);
597
     #else
679
     #else
598
-      UNUSED(thrs);
680
+      UNUSED(hyb_thrs);
599
     #endif
681
     #endif
600
 
682
 
683
+    st.set_cool_thrs(cool_thrs);  // (mm/s)
684
+    COOLCONF_t coolconf{0};
685
+    coolconf.semin = cool_semin;
686
+    coolconf.semax = cool_semax;
687
+    coolconf.seup = cool_seup;
688
+    coolconf.sedn = cool_sedn;
689
+    coolconf.seimin = cool_seimin;
690
+    st.COOLCONF(coolconf.sr);
691
+
601
     st.GSTAT(); // Clear GSTAT
692
     st.GSTAT(); // Clear GSTAT
602
   }
693
   }
603
 #endif // TMC5130
694
 #endif // TMC5130
604
 
695
 
605
 #if HAS_DRIVER(TMC5160)
696
 #if HAS_DRIVER(TMC5160)
606
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
697
   template<char AXIS_LETTER, char DRIVER_ID, AxisEnum AXIS_ID>
607
-  void tmc_init(TMCMarlin<TMC5160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const bool stealth) {
698
+  void tmc_init(
699
+    TMCMarlin<TMC5160Stepper, AXIS_LETTER, DRIVER_ID, AXIS_ID> &st,
700
+    const uint16_t mA,
701
+    const uint16_t microsteps,
702
+    const bool stealth,
703
+    const uint32_t hyb_thrs,
704
+    const uint32_t cool_thrs,
705
+    const uint8_t cool_semin,
706
+    const uint8_t cool_semax,
707
+    const uint8_t cool_seup,
708
+    const uint8_t cool_sedn,
709
+    const bool cool_seimin
710
+  ) {
608
     st.begin();
711
     st.begin();
609
 
712
 
610
     CHOPCONF_t chopconf{0};
713
     CHOPCONF_t chopconf{0};
637
     st.PWMCONF(pwmconf.sr);
740
     st.PWMCONF(pwmconf.sr);
638
 
741
 
639
     #if ENABLED(HYBRID_THRESHOLD)
742
     #if ENABLED(HYBRID_THRESHOLD)
640
-      st.set_pwm_thrs(thrs);
743
+      st.set_pwm_thrs(hyb_thrs);
641
     #else
744
     #else
642
-      UNUSED(thrs);
745
+      UNUSED(hyb_thrs);
643
     #endif
746
     #endif
747
+
748
+    st.set_cool_thrs(cool_thrs);  // (mm/s)
749
+    COOLCONF_t coolconf{0};
750
+    coolconf.semin = cool_semin;
751
+    coolconf.semax = cool_semax;
752
+    coolconf.seup = cool_seup;
753
+    coolconf.sedn = cool_sedn;
754
+    coolconf.seimin = cool_seimin;
755
+    st.COOLCONF(coolconf.sr);
756
+
644
     st.GSTAT(); // Clear GSTAT
757
     st.GSTAT(); // Clear GSTAT
645
   }
758
   }
646
 #endif // TMC5160
759
 #endif // TMC5160
718
   };
831
   };
719
 
832
 
720
   #if AXIS_IS_TMC(X)
833
   #if AXIS_IS_TMC(X)
721
-    _TMC_INIT(X, STEALTH_AXIS_XY);
834
+    TMC_INIT(X, STEALTH_AXIS_XY);
722
   #endif
835
   #endif
723
   #if AXIS_IS_TMC(X2)
836
   #if AXIS_IS_TMC(X2)
724
-    _TMC_INIT(X2, STEALTH_AXIS_XY);
837
+    TMC_INIT(X2, STEALTH_AXIS_XY);
725
   #endif
838
   #endif
726
   #if AXIS_IS_TMC(Y)
839
   #if AXIS_IS_TMC(Y)
727
-    _TMC_INIT(Y, STEALTH_AXIS_XY);
840
+    TMC_INIT(Y, STEALTH_AXIS_XY);
728
   #endif
841
   #endif
729
   #if AXIS_IS_TMC(Y2)
842
   #if AXIS_IS_TMC(Y2)
730
-    _TMC_INIT(Y2, STEALTH_AXIS_XY);
843
+    TMC_INIT(Y2, STEALTH_AXIS_XY);
731
   #endif
844
   #endif
732
   #if AXIS_IS_TMC(Z)
845
   #if AXIS_IS_TMC(Z)
733
-    _TMC_INIT(Z, STEALTH_AXIS_Z);
846
+    TMC_INIT(Z, STEALTH_AXIS_Z);
734
   #endif
847
   #endif
735
   #if AXIS_IS_TMC(Z2)
848
   #if AXIS_IS_TMC(Z2)
736
-    _TMC_INIT(Z2, STEALTH_AXIS_Z);
849
+    TMC_INIT(Z2, STEALTH_AXIS_Z);
737
   #endif
850
   #endif
738
   #if AXIS_IS_TMC(Z3)
851
   #if AXIS_IS_TMC(Z3)
739
-    _TMC_INIT(Z3, STEALTH_AXIS_Z);
852
+    TMC_INIT(Z3, STEALTH_AXIS_Z);
740
   #endif
853
   #endif
741
   #if AXIS_IS_TMC(Z4)
854
   #if AXIS_IS_TMC(Z4)
742
-    _TMC_INIT(Z4, STEALTH_AXIS_Z);
855
+    TMC_INIT(Z4, STEALTH_AXIS_Z);
743
   #endif
856
   #endif
744
   #if AXIS_IS_TMC(E0)
857
   #if AXIS_IS_TMC(E0)
745
-    _TMC_INIT(E0, STEALTH_AXIS_E);
858
+    TMC_INIT(E0, STEALTH_AXIS_E);
746
   #endif
859
   #endif
747
   #if AXIS_IS_TMC(E1)
860
   #if AXIS_IS_TMC(E1)
748
-    _TMC_INIT(E1, STEALTH_AXIS_E);
861
+    TMC_INIT(E1, STEALTH_AXIS_E);
749
   #endif
862
   #endif
750
   #if AXIS_IS_TMC(E2)
863
   #if AXIS_IS_TMC(E2)
751
-    _TMC_INIT(E2, STEALTH_AXIS_E);
864
+    TMC_INIT(E2, STEALTH_AXIS_E);
752
   #endif
865
   #endif
753
   #if AXIS_IS_TMC(E3)
866
   #if AXIS_IS_TMC(E3)
754
-    _TMC_INIT(E3, STEALTH_AXIS_E);
867
+    TMC_INIT(E3, STEALTH_AXIS_E);
755
   #endif
868
   #endif
756
   #if AXIS_IS_TMC(E4)
869
   #if AXIS_IS_TMC(E4)
757
-    _TMC_INIT(E4, STEALTH_AXIS_E);
870
+    TMC_INIT(E4, STEALTH_AXIS_E);
758
   #endif
871
   #endif
759
   #if AXIS_IS_TMC(E5)
872
   #if AXIS_IS_TMC(E5)
760
-    _TMC_INIT(E5, STEALTH_AXIS_E);
873
+    TMC_INIT(E5, STEALTH_AXIS_E);
761
   #endif
874
   #endif
762
   #if AXIS_IS_TMC(E6)
875
   #if AXIS_IS_TMC(E6)
763
-    _TMC_INIT(E6, STEALTH_AXIS_E);
876
+    TMC_INIT(E6, STEALTH_AXIS_E);
764
   #endif
877
   #endif
765
   #if AXIS_IS_TMC(E7)
878
   #if AXIS_IS_TMC(E7)
766
-    _TMC_INIT(E7, STEALTH_AXIS_E);
879
+    TMC_INIT(E7, STEALTH_AXIS_E);
767
   #endif
880
   #endif
768
 
881
 
769
   #if USE_SENSORLESS
882
   #if USE_SENSORLESS

+ 1
- 1
Marlin/src/pins/lpc1768/pins_GMARSH_X6_REV1.h 查看文件

82
 //
82
 //
83
 // TMC2208 UART pins
83
 // TMC2208 UART pins
84
 //
84
 //
85
-#if HAS_DRIVER(TMC2208)
85
+#if HAS_TMC_UART
86
   #define X_SERIAL_TX_PIN  P1_00
86
   #define X_SERIAL_TX_PIN  P1_00
87
   #define X_SERIAL_RX_PIN  P1_00
87
   #define X_SERIAL_RX_PIN  P1_00
88
   #define Y_SERIAL_TX_PIN  P1_09
88
   #define Y_SERIAL_TX_PIN  P1_09

+ 2
- 2
Marlin/src/pins/lpc1769/pins_TH3D_EZBOARD.h 查看文件

74
 #define E1_DIR_PIN         P2_13
74
 #define E1_DIR_PIN         P2_13
75
 #define E1_ENABLE_PIN      P4_29
75
 #define E1_ENABLE_PIN      P4_29
76
 
76
 
77
-#if HAS_DRIVER(TMC2208)
77
+#if HAS_TMC_UART
78
   //
78
   //
79
-  // TMC2208 stepper drivers
79
+  // TMC220x stepper drivers
80
   // Software serial
80
   // Software serial
81
   //
81
   //
82
   #define X_SERIAL_TX_PIN  P0_04
82
   #define X_SERIAL_TX_PIN  P0_04

+ 3
- 3
Marlin/src/pins/mega/pins_MIGHTYBOARD_REVE.h 查看文件

264
 #define SD_DETECT_PIN       9   // H6
264
 #define SD_DETECT_PIN       9   // H6
265
 
265
 
266
 //
266
 //
267
-//TMC 2208
267
+// TMC 220x
268
 //
268
 //
269
-#if HAS_DRIVER(TMC2208)
269
+#if HAS_TMC_UART
270
   /**
270
   /**
271
-   * TMC2208 stepper drivers
271
+   * TMC220x stepper drivers
272
    *
272
    *
273
    * Hardware serial communication ports.
273
    * Hardware serial communication ports.
274
    * If undefined software serial is used according to the pins below
274
    * If undefined software serial is used according to the pins below

+ 22
- 0
Marlin/src/pins/pins.h 查看文件

1189
 #define _PEXI(p,q) __PEXI(p,q)
1189
 #define _PEXI(p,q) __PEXI(p,q)
1190
 #define __EPIN(p,q) E##p##_##q##_PIN
1190
 #define __EPIN(p,q) E##p##_##q##_PIN
1191
 #define _EPIN(p,q) __EPIN(p,q)
1191
 #define _EPIN(p,q) __EPIN(p,q)
1192
+#define __EDRV(p) E##p##_DRIVER_TYPE
1193
+#define _EDRV(p) __EDRV(p)
1192
 #define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN)
1194
 #define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN)
1193
 
1195
 
1194
 // The X2 axis, if any, should be the next open extruder port
1196
 // The X2 axis, if any, should be the next open extruder port
1195
 #define X2_E_INDEX E_STEPPERS
1197
 #define X2_E_INDEX E_STEPPERS
1196
 
1198
 
1197
 #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
1199
 #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
1200
+  #ifndef X2_DRIVER_TYPE
1201
+    #define X2_DRIVER_TYPE _EDRV(X2_E_INDEX)
1202
+  #endif
1203
+
1198
   #ifndef X2_STEP_PIN
1204
   #ifndef X2_STEP_PIN
1199
     #define X2_STEP_PIN   _EPIN(X2_E_INDEX, STEP)
1205
     #define X2_STEP_PIN   _EPIN(X2_E_INDEX, STEP)
1200
     #define X2_DIR_PIN    _EPIN(X2_E_INDEX, DIR)
1206
     #define X2_DIR_PIN    _EPIN(X2_E_INDEX, DIR)
1268
 
1274
 
1269
 // The Y2 axis, if any, should be the next open extruder port
1275
 // The Y2 axis, if any, should be the next open extruder port
1270
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
1276
 #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
1277
+  #ifndef Y2_DRIVER_TYPE
1278
+    #define Y2_DRIVER_TYPE _EDRV(Y2_E_INDEX)
1279
+  #endif
1280
+
1271
   #ifndef Y2_STEP_PIN
1281
   #ifndef Y2_STEP_PIN
1272
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
1282
     #define Y2_STEP_PIN   _EPIN(Y2_E_INDEX, STEP)
1273
     #define Y2_DIR_PIN    _EPIN(Y2_E_INDEX, DIR)
1283
     #define Y2_DIR_PIN    _EPIN(Y2_E_INDEX, DIR)
1336
 
1346
 
1337
 // The Z2 axis, if any, should be the next open extruder port
1347
 // The Z2 axis, if any, should be the next open extruder port
1338
 #if NUM_Z_STEPPER_DRIVERS >= 2
1348
 #if NUM_Z_STEPPER_DRIVERS >= 2
1349
+  #ifndef Z2_DRIVER_TYPE
1350
+    #define Z2_DRIVER_TYPE _EDRV(Z2_E_INDEX)
1351
+  #endif
1352
+
1339
   #ifndef Z2_STEP_PIN
1353
   #ifndef Z2_STEP_PIN
1340
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
1354
     #define Z2_STEP_PIN   _EPIN(Z2_E_INDEX, STEP)
1341
     #define Z2_DIR_PIN    _EPIN(Z2_E_INDEX, DIR)
1355
     #define Z2_DIR_PIN    _EPIN(Z2_E_INDEX, DIR)
1403
 #endif
1417
 #endif
1404
 
1418
 
1405
 #if NUM_Z_STEPPER_DRIVERS >= 3
1419
 #if NUM_Z_STEPPER_DRIVERS >= 3
1420
+  #ifndef Z3_DRIVER_TYPE
1421
+    #define Z3_DRIVER_TYPE _EDRV(Z3_E_INDEX)
1422
+  #endif
1423
+
1406
   #ifndef Z3_STEP_PIN
1424
   #ifndef Z3_STEP_PIN
1407
     #define Z3_STEP_PIN   _EPIN(Z3_E_INDEX, STEP)
1425
     #define Z3_STEP_PIN   _EPIN(Z3_E_INDEX, STEP)
1408
     #define Z3_DIR_PIN    _EPIN(Z3_E_INDEX, DIR)
1426
     #define Z3_DIR_PIN    _EPIN(Z3_E_INDEX, DIR)
1470
 #endif
1488
 #endif
1471
 
1489
 
1472
 #if NUM_Z_STEPPER_DRIVERS >= 4
1490
 #if NUM_Z_STEPPER_DRIVERS >= 4
1491
+  #ifndef Z4_DRIVER_TYPE
1492
+    #define Z4_DRIVER_TYPE _EDRV(Z4_E_INDEX)
1493
+  #endif
1494
+
1473
   #ifndef Z4_STEP_PIN
1495
   #ifndef Z4_STEP_PIN
1474
     #define Z4_STEP_PIN   _EPIN(Z4_E_INDEX, STEP)
1496
     #define Z4_STEP_PIN   _EPIN(Z4_E_INDEX, STEP)
1475
     #define Z4_DIR_PIN    _EPIN(Z4_E_INDEX, DIR)
1497
     #define Z4_DIR_PIN    _EPIN(Z4_E_INDEX, DIR)

+ 2
- 2
Marlin/src/pins/ramps/pins_Z_BOLT_X_SERIES.h 查看文件

193
   #endif
193
   #endif
194
 #endif
194
 #endif
195
 
195
 
196
-#if HAS_DRIVER(TMC2208)
196
+#if HAS_TMC_UART
197
   /**
197
   /**
198
-   * TMC2208 stepper drivers
198
+   * TMC220x stepper drivers
199
    *
199
    *
200
    * Hardware serial communication ports.
200
    * Hardware serial communication ports.
201
    * If undefined software serial is used according to the pins below
201
    * If undefined software serial is used according to the pins below

+ 2
- 2
Marlin/src/pins/stm32/pins_BTT_SKR_MINI_E3_V1_0.h 查看文件

26
 #define BOARD_INFO_NAME "BIGTREE SKR Mini E3"
26
 #define BOARD_INFO_NAME "BIGTREE SKR Mini E3"
27
 
27
 
28
 /**
28
 /**
29
- * TMC2209 stepper drivers
29
+ * TMC220x stepper drivers
30
  * Hardware serial communication ports.
30
  * Hardware serial communication ports.
31
  */
31
  */
32
-#if HAS_DRIVER(TMC2209)
32
+#if HAS_TMC_UART
33
   #define X_HARDWARE_SERIAL  Serial4
33
   #define X_HARDWARE_SERIAL  Serial4
34
   #define Y_HARDWARE_SERIAL  Serial4
34
   #define Y_HARDWARE_SERIAL  Serial4
35
   #define Z_HARDWARE_SERIAL  Serial4
35
   #define Z_HARDWARE_SERIAL  Serial4

正在加载...
取消
保存