Browse Source

Improved STMicro L64XX stepper driver support (#16452)

Bob Kuhn 4 years ago
parent
commit
1ad53cee1f
100 changed files with 4002 additions and 2756 deletions
  1. 3
    2
      Marlin/Configuration.h
  2. 57
    38
      Marlin/Configuration_adv.h
  3. 1
    2
      Marlin/src/HAL/HAL_STM32/timers.h
  4. 44
    33
      Marlin/src/HAL/shared/HAL_spi_L6470.cpp
  5. 5
    5
      Marlin/src/MarlinCore.cpp
  6. 21
    34
      Marlin/src/MarlinCore.h
  7. 8
    0
      Marlin/src/core/drivers.h
  8. 3
    5
      Marlin/src/core/serial.cpp
  9. 13
    6
      Marlin/src/gcode/calibrate/G28.cpp
  10. 80
    53
      Marlin/src/gcode/feature/L6470/M122.cpp
  11. 180
    104
      Marlin/src/gcode/feature/L6470/M906.cpp
  12. 328
    201
      Marlin/src/gcode/feature/L6470/M916-918.cpp
  13. 1
    1
      Marlin/src/gcode/gcode.cpp
  14. 1
    1
      Marlin/src/gcode/gcode.h
  15. 18
    20
      Marlin/src/gcode/host/M114.cpp
  16. 1
    1
      Marlin/src/inc/SanityCheck.h
  17. 0
    105
      Marlin/src/libs/L6470/000_l6470_read_me.md
  18. 0
    793
      Marlin/src/libs/L6470/L6470_Marlin.cpp
  19. 0
    72
      Marlin/src/libs/L6470/L6470_Marlin.h
  20. 892
    0
      Marlin/src/libs/L64XX/L64XX_Marlin.cpp
  21. 141
    0
      Marlin/src/libs/L64XX/L64XX_Marlin.h
  22. 98
    0
      Marlin/src/libs/L64XX/README.md
  23. 28
    26
      Marlin/src/module/stepper.cpp
  24. 0
    143
      Marlin/src/module/stepper/L6470.cpp
  25. 0
    176
      Marlin/src/module/stepper/L6470.h
  26. 210
    0
      Marlin/src/module/stepper/L64xx.cpp
  27. 263
    0
      Marlin/src/module/stepper/L64xx.h
  28. 2
    2
      Marlin/src/module/stepper/indirection.cpp
  29. 2
    2
      Marlin/src/module/stepper/indirection.h
  30. 9
    1
      buildroot/share/tests/megaatmega2560-tests
  31. 3
    2
      config/default/Configuration.h
  32. 45
    26
      config/default/Configuration_adv.h
  33. 3
    2
      config/examples/3DFabXYZ/Migbot/Configuration.h
  34. 45
    26
      config/examples/3DFabXYZ/Migbot/Configuration_adv.h
  35. 3
    2
      config/examples/ADIMLab/Gantry v1/Configuration.h
  36. 45
    26
      config/examples/ADIMLab/Gantry v1/Configuration_adv.h
  37. 3
    2
      config/examples/ADIMLab/Gantry v2/Configuration.h
  38. 45
    26
      config/examples/ADIMLab/Gantry v2/Configuration_adv.h
  39. 3
    2
      config/examples/AlephObjects/TAZ4/Configuration.h
  40. 45
    26
      config/examples/AlephObjects/TAZ4/Configuration_adv.h
  41. 3
    2
      config/examples/Alfawise/U20-bltouch/Configuration.h
  42. 45
    26
      config/examples/Alfawise/U20-bltouch/Configuration_adv.h
  43. 3
    2
      config/examples/Alfawise/U20/Configuration.h
  44. 45
    26
      config/examples/Alfawise/U20/Configuration_adv.h
  45. 3
    2
      config/examples/AliExpress/CL-260/Configuration.h
  46. 3
    2
      config/examples/AliExpress/UM2pExt/Configuration.h
  47. 45
    26
      config/examples/AliExpress/UM2pExt/Configuration_adv.h
  48. 3
    2
      config/examples/Anet/A2/Configuration.h
  49. 45
    26
      config/examples/Anet/A2/Configuration_adv.h
  50. 3
    2
      config/examples/Anet/A2plus/Configuration.h
  51. 45
    26
      config/examples/Anet/A2plus/Configuration_adv.h
  52. 3
    2
      config/examples/Anet/A6/Configuration.h
  53. 45
    26
      config/examples/Anet/A6/Configuration_adv.h
  54. 3
    2
      config/examples/Anet/A8/Configuration.h
  55. 45
    26
      config/examples/Anet/A8/Configuration_adv.h
  56. 3
    2
      config/examples/Anet/A8plus/Configuration.h
  57. 45
    26
      config/examples/Anet/A8plus/Configuration_adv.h
  58. 3
    2
      config/examples/Anet/E10/Configuration.h
  59. 45
    26
      config/examples/Anet/E10/Configuration_adv.h
  60. 3
    2
      config/examples/Anet/E16/Configuration.h
  61. 45
    26
      config/examples/Anet/E16/Configuration_adv.h
  62. 3
    2
      config/examples/AnyCubic/i3/Configuration.h
  63. 45
    26
      config/examples/AnyCubic/i3/Configuration_adv.h
  64. 3
    2
      config/examples/ArmEd/Configuration.h
  65. 45
    26
      config/examples/ArmEd/Configuration_adv.h
  66. 3
    2
      config/examples/Artillery/Genius/Configuration.h
  67. 45
    26
      config/examples/Artillery/Genius/Configuration_adv.h
  68. 3
    2
      config/examples/Artillery/Sidewinder X1/Configuration.h
  69. 45
    26
      config/examples/Artillery/Sidewinder X1/Configuration_adv.h
  70. 3
    2
      config/examples/Azteeg/X5GT/Configuration.h
  71. 3
    2
      config/examples/BIBO/TouchX/cyclops/Configuration.h
  72. 45
    26
      config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
  73. 3
    2
      config/examples/BIBO/TouchX/default/Configuration.h
  74. 45
    26
      config/examples/BIBO/TouchX/default/Configuration_adv.h
  75. 3
    2
      config/examples/BQ/Hephestos/Configuration.h
  76. 45
    26
      config/examples/BQ/Hephestos/Configuration_adv.h
  77. 3
    2
      config/examples/BQ/Hephestos_2/Configuration.h
  78. 45
    26
      config/examples/BQ/Hephestos_2/Configuration_adv.h
  79. 3
    2
      config/examples/BQ/WITBOX/Configuration.h
  80. 45
    26
      config/examples/BQ/WITBOX/Configuration_adv.h
  81. 3
    2
      config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h
  82. 45
    26
      config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h
  83. 3
    2
      config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h
  84. 45
    26
      config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h
  85. 3
    2
      config/examples/Cartesio/Configuration.h
  86. 45
    26
      config/examples/Cartesio/Configuration_adv.h
  87. 3
    2
      config/examples/Creality/CR-10/Configuration.h
  88. 45
    26
      config/examples/Creality/CR-10/Configuration_adv.h
  89. 3
    2
      config/examples/Creality/CR-10S/Configuration.h
  90. 45
    26
      config/examples/Creality/CR-10S/Configuration_adv.h
  91. 3
    2
      config/examples/Creality/CR-10_5S/Configuration.h
  92. 45
    26
      config/examples/Creality/CR-10_5S/Configuration_adv.h
  93. 3
    2
      config/examples/Creality/CR-10mini/Configuration.h
  94. 45
    26
      config/examples/Creality/CR-10mini/Configuration_adv.h
  95. 3
    2
      config/examples/Creality/CR-20 Pro/Configuration.h
  96. 45
    26
      config/examples/Creality/CR-20 Pro/Configuration_adv.h
  97. 3
    2
      config/examples/Creality/CR-20/Configuration.h
  98. 45
    26
      config/examples/Creality/CR-20/Configuration_adv.h
  99. 3
    2
      config/examples/Creality/CR-8/Configuration.h
  100. 0
    0
      config/examples/Creality/CR-8/Configuration_adv.h

+ 3
- 2
Marlin/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'powerSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 57
- 38
Marlin/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS          0  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252
-    #define X2_CHAIN_POS        -1
2259
+    #define X2_CHAIN_POS         0
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260
-    #define Y_CHAIN_POS         -1
2268
+    #define Y_CHAIN_POS          0
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268
-    #define Y2_CHAIN_POS        -1
2277
+    #define Y2_CHAIN_POS         0
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276
-    #define Z_CHAIN_POS         -1
2286
+    #define Z_CHAIN_POS          0
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284
-    #define Z2_CHAIN_POS        -1
2295
+    #define Z2_CHAIN_POS         0
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292
-    #define Z3_CHAIN_POS        -1
2304
+    #define Z3_CHAIN_POS         0
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300
-    #define E0_CHAIN_POS        -1
2313
+    #define E0_CHAIN_POS         0
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308
-    #define E1_CHAIN_POS        -1
2322
+    #define E1_CHAIN_POS         0
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316
-    #define E2_CHAIN_POS        -1
2331
+    #define E2_CHAIN_POS         0
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324
-    #define E3_CHAIN_POS        -1
2340
+    #define E3_CHAIN_POS         0
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332
-    #define E4_CHAIN_POS        -1
2349
+    #define E4_CHAIN_POS         0
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340
-    #define E5_CHAIN_POS        -1
2358
+    #define E5_CHAIN_POS         0
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 1
- 2
Marlin/src/HAL/HAL_STM32/timers.h View File

@@ -33,7 +33,6 @@
33 33
 #define hal_timer_t uint32_t
34 34
 #define HAL_TIMER_TYPE_MAX 0xFFFFFFFF // Timers can be 16 or 32 bit
35 35
 
36
-
37 36
 #ifdef STM32F0xx
38 37
 
39 38
   #define HAL_TIMER_RATE (F_CPU) // frequency of timer peripherals
@@ -63,7 +62,7 @@
63 62
   #define HAL_TIMER_RATE (F_CPU/2) // frequency of timer peripherals
64 63
 
65 64
   #ifndef STEP_TIMER
66
-    #define STEP_TIMER 6
65
+    #define STEP_TIMER 9  // STM32F401 has no TIM6, TIM7, or TIM8
67 66
   #endif
68 67
 
69 68
   #ifndef TEMP_TIMER

+ 44
- 33
Marlin/src/HAL/shared/HAL_spi_L6470.cpp View File

@@ -27,12 +27,12 @@
27 27
 
28 28
 #include "../../inc/MarlinConfig.h"
29 29
 
30
-#if HAS_DRIVER(L6470)
30
+#if HAS_L64XX
31 31
 
32 32
 #include "Delay.h"
33 33
 
34 34
 #include "../../core/serial.h"
35
-#include "../../libs/L6470/L6470_Marlin.h"
35
+#include "../../libs/L64XX/L64XX_Marlin.h"
36 36
 
37 37
 // Make sure GCC optimizes this file.
38 38
 // Note that this line triggers a bug in GCC which is fixed by casting.
@@ -40,7 +40,7 @@
40 40
 #pragma GCC optimize (3)
41 41
 
42 42
 // run at ~4Mhz
43
-uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
43
+inline uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
44 44
   for (uint8_t bits = 8; bits--;) {
45 45
     WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80);
46 46
     b <<= 1;        // little setup time
@@ -56,39 +56,60 @@ uint8_t L6470_SpiTransfer_Mode_0(uint8_t b) { // using Mode 0
56 56
   return b;
57 57
 }
58 58
 
59
-uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
59
+inline uint8_t L6470_SpiTransfer_Mode_3(uint8_t b) { // using Mode 3
60 60
   for (uint8_t bits = 8; bits--;) {
61 61
     WRITE(L6470_CHAIN_SCK_PIN, LOW);
62 62
     WRITE(L6470_CHAIN_MOSI_PIN, b & 0x80);
63 63
 
64 64
     DELAY_NS(125);  // 10 cycles @ 84mhz
65
-
66 65
     WRITE(L6470_CHAIN_SCK_PIN, HIGH);
66
+    DELAY_NS(125);  // Need more delay for fast CPUs
67 67
 
68 68
     b <<= 1;        // little setup time
69 69
     b |= (READ(L6470_CHAIN_MISO_PIN) != 0);
70 70
   }
71
-
72
-  DELAY_NS(125);  // 10 cycles @ 84mhz
71
+  DELAY_NS(125);    // 10 cycles @ 84mhz
73 72
   return b;
74 73
 }
75 74
 
76 75
 /**
77
- * The following are weak-linked and defined as do-nothing
78
- * functions by the L6470-Arduino library. They must be
79
- * defined by the client (Marlin) to provide an SPI interface.
76
+ * L64XX methods for SPI init and transfer
80 77
  */
78
+void L64XX_Marlin::spi_init() {
79
+  OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH);
80
+  OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH);
81
+  OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
82
+  SET_INPUT(L6470_CHAIN_MISO_PIN);
83
+
84
+  #if PIN_EXISTS(L6470_BUSY)
85
+    SET_INPUT(L6470_BUSY_PIN);
86
+  #endif
81 87
 
82
-uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_position) {
88
+  OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
89
+}
90
+
91
+uint8_t L64XX_Marlin::transfer_single(uint8_t data, int16_t ss_pin) {
92
+  // First device in chain has data sent last
93
+  extDigitalWrite(ss_pin, LOW);
94
+
95
+  DISABLE_ISRS(); // Disable interrupts during SPI transfer (can't allow partial command to chips)
96
+  const uint8_t data_out = L6470_SpiTransfer_Mode_3(data);
97
+  ENABLE_ISRS();  // Enable interrupts
98
+
99
+  extDigitalWrite(ss_pin, HIGH);
100
+  return data_out;
101
+}
102
+
103
+uint8_t L64XX_Marlin::transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position) {
83 104
   uint8_t data_out = 0;
84 105
 
85 106
   // first device in chain has data sent last
86 107
   extDigitalWrite(ss_pin, LOW);
87 108
 
88
-  for (uint8_t i = L6470::chain[0]; (i >= 1) && !spi_abort; i--) {    // stop sending data if spi_abort is active
89
-    DISABLE_ISRS();  // disable interrupts during SPI transfer (can't allow partial command to chips)
90
-    uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP));
91
-    ENABLE_ISRS();  // enable interrupts
109
+  for (uint8_t i = L64XX::chain[0]; !L64xxManager.spi_abort && i >= 1; i--) {   // Send data unless aborted
110
+    DISABLE_ISRS();   // Disable interrupts during SPI transfer (can't allow partial command to chips)
111
+    const uint8_t temp = L6470_SpiTransfer_Mode_3(uint8_t(i == chain_position ? data : dSPIN_NOP));
112
+    ENABLE_ISRS();    // Enable interrupts
92 113
     if (i == chain_position) data_out = temp;
93 114
   }
94 115
 
@@ -96,11 +117,14 @@ uint8_t L6470_transfer(uint8_t data, int16_t ss_pin, const uint8_t chain_positio
96 117
   return data_out;
97 118
 }
98 119
 
99
-void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) {
100
-  // first device in chain has data sent last
120
+/**
121
+ * Platform-supplied L6470 buffer transfer method
122
+ */
123
+void L64XX_Marlin::transfer(uint8_t L6470_buf[], const uint8_t length) {
124
+  // First device in chain has its data sent last
101 125
 
102
-  if (spi_active) {                    // interrupted SPI transfer so need to
103
-    WRITE(L6470_CHAIN_SS_PIN, HIGH);   // guarantee min high of 650nS
126
+  if (spi_active) {                   // Interrupted SPI transfer so need to
127
+    WRITE(L6470_CHAIN_SS_PIN, HIGH);  //  guarantee min high of 650ns
104 128
     DELAY_US(1);
105 129
   }
106 130
 
@@ -110,19 +134,6 @@ void L6470_transfer(uint8_t L6470_buf[], const uint8_t length) {
110 134
   WRITE(L6470_CHAIN_SS_PIN, HIGH);
111 135
 }
112 136
 
113
-void L6470_spi_init() {
114
-  OUT_WRITE(L6470_CHAIN_SS_PIN, HIGH);
115
-  OUT_WRITE(L6470_CHAIN_SCK_PIN, HIGH);
116
-  OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
117
-  SET_INPUT(L6470_CHAIN_MISO_PIN);
118
-
119
-  #if PIN_EXISTS(L6470_BUSY)
120
-    SET_INPUT(L6470_BUSY_PIN);
121
-  #endif
122
-
123
-  OUT_WRITE(L6470_CHAIN_MOSI_PIN, HIGH);
124
-}
125
-
126 137
 #pragma GCC reset_options
127 138
 
128
-#endif // HAS_DRIVER(L6470)
139
+#endif // HAS_L64XX

+ 5
- 5
Marlin/src/MarlinCore.cpp View File

@@ -177,8 +177,8 @@
177 177
   #include "feature/prusa_MMU2/mmu2.h"
178 178
 #endif
179 179
 
180
-#if HAS_DRIVER(L6470)
181
-  #include "libs/L6470/L6470_Marlin.h"
180
+#if HAS_L64XX
181
+  #include "libs/L64XX/L64XX_Marlin.h"
182 182
 #endif
183 183
 
184 184
 const char NUL_STR[] PROGMEM = "",
@@ -605,7 +605,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
605 605
   #endif
606 606
 
607 607
   #if ENABLED(MONITOR_L6470_DRIVER_STATUS)
608
-    L6470.monitor_driver();
608
+    L64xxManager.monitor_driver();
609 609
   #endif
610 610
 
611 611
   // Limit check_axes_activity frequency to 10Hz
@@ -822,8 +822,8 @@ void setup() {
822 822
 
823 823
   HAL_init();
824 824
 
825
-  #if HAS_DRIVER(L6470)
826
-    L6470.init();         // setup SPI and then init chips
825
+  #if HAS_L64XX
826
+    L64xxManager.init();  // Set up SPI, init drivers
827 827
   #endif
828 828
 
829 829
   #if ENABLED(MAX7219_DEBUG)

+ 21
- 34
Marlin/src/MarlinCore.h View File

@@ -31,8 +31,8 @@
31 31
 #include <stdio.h>
32 32
 #include <stdlib.h>
33 33
 
34
-#if HAS_DRIVER(L6470)
35
-  #include "libs/L6470/L6470_Marlin.h"
34
+#if HAS_L64XX
35
+  #include "libs/L64XX/L64XX_Marlin.h"
36 36
   extern uint8_t axis_known_position;
37 37
 #endif
38 38
 
@@ -49,8 +49,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
49 49
 //
50 50
 // X, Y, Z Stepper enable / disable
51 51
 //
52
-#if AXIS_DRIVER_TYPE_X(L6470)
53
-  extern L6470 stepperX;
52
+#if AXIS_IS_L64XX(X)
54 53
   #define X_enable()  NOOP
55 54
   #define X_disable() stepperX.free()
56 55
 #elif HAS_X_ENABLE
@@ -61,8 +60,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
61 60
   #define X_disable() NOOP
62 61
 #endif
63 62
 
64
-#if AXIS_DRIVER_TYPE_X2(L6470)
65
-  extern L6470 stepperX2;
63
+#if AXIS_IS_L64XX(X2)
66 64
   #define X2_enable()  NOOP
67 65
   #define X2_disable() stepperX2.free()
68 66
 #elif HAS_X2_ENABLE
@@ -76,8 +74,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
76 74
 #define  enable_X() do{ X_enable(); X2_enable(); }while(0)
77 75
 #define disable_X() do{ X_disable(); X2_disable(); CBI(axis_known_position, X_AXIS); }while(0)
78 76
 
79
-#if AXIS_DRIVER_TYPE_Y(L6470)
80
-  extern L6470 stepperY;
77
+#if AXIS_IS_L64XX(Y)
81 78
   #define Y_enable()  NOOP
82 79
   #define Y_disable() stepperY.free()
83 80
 #elif HAS_Y_ENABLE
@@ -88,8 +85,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
88 85
   #define Y_disable() NOOP
89 86
 #endif
90 87
 
91
-#if AXIS_DRIVER_TYPE_Y2(L6470)
92
-  extern L6470 stepperY2;
88
+#if AXIS_IS_L64XX(Y2)
93 89
   #define Y2_enable()  NOOP
94 90
   #define Y2_disable() stepperY2.free()
95 91
 #elif HAS_Y2_ENABLE
@@ -103,8 +99,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
103 99
 #define  enable_Y() do{ Y_enable(); Y2_enable(); }while(0)
104 100
 #define disable_Y() do{ Y_disable(); Y2_disable(); CBI(axis_known_position, Y_AXIS); }while(0)
105 101
 
106
-#if AXIS_DRIVER_TYPE_Z(L6470)
107
-  extern L6470 stepperZ;
102
+#if AXIS_IS_L64XX(Z)
108 103
   #define Z_enable()  NOOP
109 104
   #define Z_disable() stepperZ.free()
110 105
 #elif HAS_Z_ENABLE
@@ -115,8 +110,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
115 110
   #define Z_disable() NOOP
116 111
 #endif
117 112
 
118
-#if AXIS_DRIVER_TYPE_Z2(L6470)
119
-  extern L6470 stepperZ2;
113
+#if AXIS_IS_L64XX(Z2)
120 114
   #define Z2_enable()  NOOP
121 115
   #define Z2_disable() stepperZ2.free()
122 116
 #elif HAS_Z2_ENABLE
@@ -127,8 +121,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
127 121
   #define Z2_disable() NOOP
128 122
 #endif
129 123
 
130
-#if AXIS_DRIVER_TYPE_Z3(L6470)
131
-  extern L6470 stepperZ3;
124
+#if AXIS_IS_L64XX(Z3)
132 125
   #define Z3_enable()  NOOP
133 126
   #define Z3_disable() stepperZ3.free()
134 127
 #elif HAS_Z3_ENABLE
@@ -147,8 +140,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
147 140
 //
148 141
 
149 142
 // define the individual enables/disables
150
-#if AXIS_DRIVER_TYPE_E0(L6470)
151
-  extern L6470 stepperE0;
143
+#if AXIS_IS_L64XX(E0)
152 144
   #define  E0_enable() NOOP
153 145
   #define E0_disable() do{ stepperE0.free(); CBI(axis_known_position, E_AXIS); }while(0)
154 146
 #elif HAS_E0_ENABLE
@@ -159,8 +151,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
159 151
   #define E0_disable() NOOP
160 152
 #endif
161 153
 
162
-#if AXIS_DRIVER_TYPE_E1(L6470)
163
-  extern L6470 stepperE1;
154
+#if AXIS_IS_L64XX(E1)
164 155
   #define  E1_enable() NOOP
165 156
   #define E1_disable() do{ stepperE1.free(); CBI(axis_known_position, E_AXIS); }while(0)
166 157
 #elif E_STEPPERS > 1 && HAS_E1_ENABLE
@@ -171,8 +162,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
171 162
   #define E1_disable() NOOP
172 163
 #endif
173 164
 
174
-#if AXIS_DRIVER_TYPE_E2(L6470)
175
-  extern L6470 stepperE2;
165
+#if AXIS_IS_L64XX(E2)
176 166
   #define  E2_enable() NOOP
177 167
   #define E2_disable() do{ stepperE2.free(); CBI(axis_known_position, E_AXIS); }while(0)
178 168
 #elif E_STEPPERS > 2 && HAS_E2_ENABLE
@@ -183,8 +173,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
183 173
   #define E2_disable() NOOP
184 174
 #endif
185 175
 
186
-#if AXIS_DRIVER_TYPE_E3(L6470)
187
-  extern L6470 stepperE3;
176
+#if AXIS_IS_L64XX(E3)
188 177
   #define  E3_enable() NOOP
189 178
   #define E3_disable() do{ stepperE3.free(); CBI(axis_known_position, E_AXIS); }while(0)
190 179
 #elif E_STEPPERS > 3 && HAS_E3_ENABLE
@@ -195,8 +184,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
195 184
   #define E3_disable() NOOP
196 185
 #endif
197 186
 
198
-#if AXIS_DRIVER_TYPE_E4(L6470)
199
-  extern L6470 stepperE4;
187
+#if AXIS_IS_L64XX(E4)
200 188
   #define  E4_enable() NOOP
201 189
   #define E4_disable() do{ stepperE4.free(); CBI(axis_known_position, E_AXIS); }while(0)
202 190
 #elif E_STEPPERS > 4 && HAS_E4_ENABLE
@@ -207,8 +195,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
207 195
   #define E4_disable() NOOP
208 196
 #endif
209 197
 
210
-#if AXIS_DRIVER_TYPE_E5(L6470)
211
-  extern L6470 stepperE5;
198
+#if AXIS_IS_L64XX(E5)
212 199
   #define  E5_enable() NOOP
213 200
   #define E5_disable() do{ stepperE5.free(); CBI(axis_known_position, E_AXIS); }while(0)
214 201
 #elif E_STEPPERS > 5 && HAS_E5_ENABLE
@@ -253,7 +240,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
253 240
 
254 241
 #else // !MIXING_EXTRUDER
255 242
 
256
-  #if HAS_E0_ENABLE
243
+  #if (HAS_E0_ENABLE || AXIS_IS_L64XX(E0))
257 244
     #define  enable_E0() E0_enable()
258 245
     #define disable_E0() E0_disable()
259 246
   #else
@@ -261,7 +248,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
261 248
     #define disable_E0() NOOP
262 249
   #endif
263 250
 
264
-  #if E_STEPPERS > 1 && HAS_E1_ENABLE
251
+  #if E_STEPPERS > 1 && (HAS_E1_ENABLE || AXIS_IS_L64XX(E1))
265 252
     #define  enable_E1() E1_enable()
266 253
     #define disable_E1() E1_disable()
267 254
   #else
@@ -269,7 +256,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
269 256
     #define disable_E1() NOOP
270 257
   #endif
271 258
 
272
-  #if E_STEPPERS > 2 && HAS_E2_ENABLE
259
+  #if E_STEPPERS > 2 && (HAS_E2_ENABLE || AXIS_IS_L64XX(E2))
273 260
     #define  enable_E2() E2_enable()
274 261
     #define disable_E2() E2_disable()
275 262
   #else
@@ -277,7 +264,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
277 264
     #define disable_E2() NOOP
278 265
   #endif
279 266
 
280
-  #if E_STEPPERS > 3 && HAS_E3_ENABLE
267
+  #if E_STEPPERS > 3 && (HAS_E3_ENABLE || AXIS_IS_L64XX(E3))
281 268
     #define  enable_E3() E3_enable()
282 269
     #define disable_E3() E3_disable()
283 270
   #else
@@ -285,7 +272,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
285 272
     #define disable_E3() NOOP
286 273
   #endif
287 274
 
288
-  #if E_STEPPERS > 4 && HAS_E4_ENABLE
275
+  #if E_STEPPERS > 4 && (HAS_E4_ENABLE || AXIS_IS_L64XX(E4))
289 276
     #define  enable_E4() E4_enable()
290 277
     #define disable_E4() E4_disable()
291 278
   #else
@@ -293,7 +280,7 @@ void manage_inactivity(const bool ignore_stepper_queue=false);
293 280
     #define disable_E4() NOOP
294 281
   #endif
295 282
 
296
-  #if E_STEPPERS > 5 && HAS_E5_ENABLE
283
+  #if E_STEPPERS > 5 && (HAS_E5_ENABLE || AXIS_IS_L64XX(E5))
297 284
     #define  enable_E5() E5_enable()
298 285
     #define disable_E5() E5_disable()
299 286
   #else

+ 8
- 0
Marlin/src/core/drivers.h View File

@@ -28,6 +28,9 @@
28 28
 #define _DRV8825            0x8825
29 29
 #define _LV8729             0x8729
30 30
 #define _L6470              0x6470
31
+#define _L6474              0x6474
32
+#define _L6480              0x6480
33
+#define _POWERSTEP01        0xF00D
31 34
 #define _TB6560             0x6560
32 35
 #define _TB6600             0x6600
33 36
 #define _TMC2100            0x2100
@@ -156,3 +159,8 @@
156 159
 #define _SDCARD_CUSTOM_CABLE 3
157 160
 #define _SDCARD_ID(V) _CAT(_SDCARD_, V)
158 161
 #define SD_CONNECTION_IS(V) (_SDCARD_ID(SDCARD_CONNECTION) == _SDCARD_ID(V))
162
+
163
+#define HAS_L64XX (HAS_DRIVER(L6470) || HAS_DRIVER(L6474) || HAS_DRIVER(L6480) || HAS_DRIVER(POWERSTEP01))
164
+#define HAS_L64XX_NOT_L6474 (HAS_L64XX && !HAS_DRIVER(L6474))
165
+
166
+#define AXIS_IS_L64XX(A) (AXIS_DRIVER_TYPE_##A(L6470) || AXIS_DRIVER_TYPE_##A(L6474) ||  AXIS_DRIVER_TYPE_##A(L6480) || AXIS_DRIVER_TYPE_##A(POWERSTEP01))

+ 3
- 5
Marlin/src/core/serial.cpp View File

@@ -58,12 +58,10 @@ void serialprint_onoff(const bool onoff) { serialprintPGM(onoff ? PSTR(MSG_ON) :
58 58
 void serialprintln_onoff(const bool onoff) { serialprint_onoff(onoff); SERIAL_EOL(); }
59 59
 void serialprint_truefalse(const bool tf) { serialprintPGM(tf ? PSTR("true") : PSTR("false")); }
60 60
 
61
-void print_bin(const uint16_t val) {
62
-  uint16_t mask = 0x8000;
61
+void print_bin(uint16_t val) {
63 62
   for (uint8_t i = 16; i--;) {
64
-    if (i && !(i % 4)) SERIAL_CHAR(' ');
65
-    SERIAL_CHAR((val & mask) ? '1' : '0');
66
-    mask >>= 1;
63
+    SERIAL_CHAR('0' + TEST(val, i));
64
+    if (!(i & 0x3) && i) SERIAL_CHAR(' ');
67 65
   }
68 66
 }
69 67
 

+ 13
- 6
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -47,8 +47,8 @@
47 47
 
48 48
 #include "../../lcd/ultralcd.h"
49 49
 
50
-#if HAS_DRIVER(L6470)                         // set L6470 absolute position registers to counts
51
-  #include "../../libs/L6470/L6470_Marlin.h"
50
+#if HAS_L64XX                         // set L6470 absolute position registers to counts
51
+  #include "../../libs/L64XX/L64XX_Marlin.h"
52 52
 #endif
53 53
 
54 54
 #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@@ -526,11 +526,18 @@ void GcodeSuite::G28(const bool always_home_all) {
526 526
 
527 527
   if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("<<< G28");
528 528
 
529
-  #if HAS_DRIVER(L6470)
529
+  #if HAS_L64XX
530 530
     // Set L6470 absolute position registers to counts
531
-    for (uint8_t j = 1; j <= L6470::chain[0]; j++) {
532
-      const uint8_t cv = L6470::chain[j];
533
-      L6470.set_param(cv, L6470_ABS_POS, stepper.position((AxisEnum)L6470.axis_xref[cv]));
531
+    // constexpr *might* move this to PROGMEM.
532
+    // If not, this will need a PROGMEM directive and an accessor.
533
+    static constexpr AxisEnum L6470_axis_xref[MAX_L6470] = {
534
+      X_AXIS, Y_AXIS, Z_AXIS,
535
+      X_AXIS, Y_AXIS, Z_AXIS, Z_AXIS,
536
+      E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS, E_AXIS
537
+    };
538
+    for (uint8_t j = 1; j <= L64XX::chain[0]; j++) {
539
+      const uint8_t cv = L64XX::chain[j];
540
+      L64xxManager.set_param((L64XX_axis_t)cv, L6470_ABS_POS, stepper.position(L6470_axis_xref[cv]));
534 541
     }
535 542
   #endif
536 543
 }

+ 80
- 53
Marlin/src/gcode/feature/L6470/M122.cpp View File

@@ -22,36 +22,64 @@
22 22
 
23 23
 #include "../../../inc/MarlinConfig.h"
24 24
 
25
-#if HAS_DRIVER(L6470)
25
+#if HAS_L64XX
26 26
 
27 27
 #include "../../gcode.h"
28
-#include "../../../libs/L6470/L6470_Marlin.h"
28
+#include "../../../libs/L64XX/L64XX_Marlin.h"
29 29
 #include "../../../module/stepper/indirection.h"
30 30
 
31
-inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
31
+void echo_yes_no(const bool yes);
32 32
 
33
-void L6470_status_decode(const uint16_t status, const uint8_t axis) {
34
-  if (L6470.spi_abort) return;  // don't do anything if set_directions() has occurred
35
-  L6470.say_axis(axis);
33
+inline void L6470_say_status(const L64XX_axis_t axis) {
34
+  if (L64xxManager.spi_abort) return;
35
+  const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow;
36
+  L64xxManager.get_status(axis);
37
+  L64xxManager.say_axis(axis);
36 38
   #if ENABLED(L6470_CHITCHAT)
37 39
     char temp_buf[20];
38
-    sprintf_P(temp_buf, PSTR("   status: %4x   "), status);
40
+    sprintf_P(temp_buf, PSTR("   status: %4x   "), sh.STATUS_AXIS_RAW);
39 41
     SERIAL_ECHO(temp_buf);
40
-    print_bin(status);
42
+    print_bin(sh.STATUS_AXIS_RAW);
43
+    switch (sh.STATUS_AXIS_LAYOUT) {
44
+      case L6470_STATUS_LAYOUT: serialprintPGM(PSTR("   L6470")); break;
45
+      case L6474_STATUS_LAYOUT: serialprintPGM(PSTR("   L6474")); break;
46
+      case L6480_STATUS_LAYOUT: serialprintPGM(PSTR("   L6480/powerSTEP01")); break;
47
+    }
41 48
   #endif
42 49
   SERIAL_ECHOPGM("\n...OUTPUT: ");
43
-  serialprintPGM(status & STATUS_HIZ ? PSTR("OFF") : PSTR("ON "));
44
-  SERIAL_ECHOPGM("   BUSY: "); echo_yes_no(!(status & STATUS_BUSY));
50
+  serialprintPGM(sh.STATUS_AXIS & STATUS_HIZ ? PSTR("OFF") : PSTR("ON "));
51
+  SERIAL_ECHOPGM("   BUSY: "); echo_yes_no((sh.STATUS_AXIS & STATUS_BUSY) == 0);
45 52
   SERIAL_ECHOPGM("   DIR: ");
46
-  serialprintPGM((((status & STATUS_DIR) >> 4) ^ L6470.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE"));
47
-  SERIAL_ECHOPGM("   Last Command: ");
48
-  if (status & STATUS_WRONG_CMD) SERIAL_ECHOPGM("IN");
49
-  SERIAL_ECHOPGM("VALID    ");
50
-  serialprintPGM(status & STATUS_NOTPERF_CMD ? PSTR("Not PERFORMED") : PSTR("COMPLETED    "));
51
-  SERIAL_ECHOPAIR("\n...THERMAL: ", !(status & STATUS_TH_SD) ? "SHUTDOWN" : !(status & STATUS_TH_WRN) ? "WARNING " : "OK      ");
52
-  SERIAL_ECHOPGM("   OVERCURRENT:"); echo_yes_no(!(status & STATUS_OCD));
53
-  SERIAL_ECHOPGM("   STALL:"); echo_yes_no(!(status & STATUS_STEP_LOSS_A) || !(status & STATUS_STEP_LOSS_B));
54
-  SERIAL_ECHOPGM("   STEP-CLOCK MODE:"); echo_yes_no(status & STATUS_SCK_MOD);
53
+  serialprintPGM((((sh.STATUS_AXIS & STATUS_DIR) >> 4) ^ L64xxManager.index_to_dir[axis]) ? PSTR("FORWARD") : PSTR("REVERSE"));
54
+  if (sh.STATUS_AXIS_LAYOUT == L6480_STATUS_LAYOUT) {
55
+    SERIAL_ECHOPGM("   Last Command: ");
56
+    if (sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD) SERIAL_ECHOPGM("VALID");
57
+    else                                           SERIAL_ECHOPGM("ERROR");
58
+    SERIAL_ECHOPGM("\n...THERMAL: ");
59
+    switch ((sh.STATUS_AXIS & (sh.STATUS_AXIS_TH_SD | sh.STATUS_AXIS_TH_WRN)) >> 11) {
60
+      case 0: SERIAL_ECHOPGM("DEVICE SHUTDOWN"); break;
61
+      case 1: SERIAL_ECHOPGM("BRIDGE SHUTDOWN"); break;
62
+      case 2: SERIAL_ECHOPGM("WARNING        "); break;
63
+      case 3: SERIAL_ECHOPGM("OK             "); break;
64
+    }
65
+  }
66
+  else {
67
+    SERIAL_ECHOPGM("   Last Command: ");
68
+    if (!(sh.STATUS_AXIS & sh.STATUS_AXIS_WRONG_CMD)) SERIAL_ECHOPGM("IN");
69
+    SERIAL_ECHOPGM("VALID    ");
70
+    serialprintPGM(sh.STATUS_AXIS & sh.STATUS_AXIS_NOTPERF_CMD ?  PSTR("COMPLETED    ") : PSTR("Not PERFORMED"));
71
+    SERIAL_ECHOPAIR("\n...THERMAL: ", !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_SD) ? "SHUTDOWN       " : !(sh.STATUS_AXIS & sh.STATUS_AXIS_TH_WRN) ? "WARNING        " : "OK             ");
72
+  }
73
+  SERIAL_ECHOPGM("   OVERCURRENT:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_OCD) == 0);
74
+  if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) {
75
+    SERIAL_ECHOPGM("   STALL:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_A) == 0 || (sh.STATUS_AXIS & sh.STATUS_AXIS_STEP_LOSS_B) == 0);
76
+    SERIAL_ECHOPGM("   STEP-CLOCK MODE:"); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_SCK_MOD) != 0);
77
+  }
78
+  else {
79
+    SERIAL_ECHOPGM("   STALL: NA "
80
+                   "   STEP-CLOCK MODE: NA"
81
+                   "   UNDER VOLTAGE LOCKOUT: "); echo_yes_no((sh.STATUS_AXIS & sh.STATUS_AXIS_UVLO) == 0);
82
+  }
55 83
   SERIAL_EOL();
56 84
 }
57 85
 
@@ -59,57 +87,56 @@ void L6470_status_decode(const uint16_t status, const uint8_t axis) {
59 87
  * M122: Debug L6470 drivers
60 88
  */
61 89
 void GcodeSuite::M122() {
62
-
63
-  L6470.spi_active = true;    // let set_directions() know we're in the middle of a series of SPI transfers
64
-
65
-  #define L6470_SAY_STATUS(Q) L6470_status_decode(stepper##Q.getStatus(), Q)
90
+  L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status
91
+  L64xxManager.spi_active = true;   // Tell set_directions() a series of SPI transfers is underway
66 92
 
67 93
   //if (parser.seen('S'))
68
-  // tmc_set_report_interval(parser.value_bool());
94
+  //  tmc_set_report_interval(parser.value_bool());
69 95
   //else
70 96
 
71
-  #if AXIS_DRIVER_TYPE_X(L6470)
72
-    L6470_SAY_STATUS(X);
97
+  #if AXIS_IS_L64XX(X)
98
+    L6470_say_status(X);
73 99
   #endif
74
-  #if AXIS_DRIVER_TYPE_X2(L6470)
75
-    L6470_SAY_STATUS(X2);
100
+  #if AXIS_IS_L64XX(X2)
101
+    L6470_say_status(X2);
76 102
   #endif
77
-  #if AXIS_DRIVER_TYPE_Y(L6470)
78
-    L6470_SAY_STATUS(Y);
103
+  #if AXIS_IS_L64XX(Y)
104
+    L6470_say_status(Y);
79 105
   #endif
80
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
81
-    L6470_SAY_STATUS(Y2);
106
+  #if AXIS_IS_L64XX(Y2)
107
+    L6470_say_status(Y2);
82 108
   #endif
83
-  #if AXIS_DRIVER_TYPE_Z(L6470)
84
-    L6470_SAY_STATUS(Z);
109
+  #if AXIS_IS_L64XX(Z)
110
+    L6470_say_status(Z);
85 111
   #endif
86
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
87
-    L6470_SAY_STATUS(Z2);
112
+  #if AXIS_IS_L64XX(Z2)
113
+    L6470_say_status(Z2);
88 114
   #endif
89
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
90
-    L6470_SAY_STATUS(Z3);
115
+  #if AXIS_IS_L64XX(Z3)
116
+    L6470_say_status(Z3);
91 117
   #endif
92
-  #if AXIS_DRIVER_TYPE_E0(L6470)
93
-    L6470_SAY_STATUS(E0);
118
+  #if AXIS_IS_L64XX(E0)
119
+    L6470_say_status(E0);
94 120
   #endif
95
-  #if AXIS_DRIVER_TYPE_E1(L6470)
96
-    L6470_SAY_STATUS(E1);
121
+  #if AXIS_IS_L64XX(E1)
122
+    L6470_say_status(E1);
97 123
   #endif
98
-  #if AXIS_DRIVER_TYPE_E2(L6470)
99
-    L6470_SAY_STATUS(E2);
124
+  #if AXIS_IS_L64XX(E2)
125
+    L6470_say_status(E2);
100 126
   #endif
101
-  #if AXIS_DRIVER_TYPE_E3(L6470)
102
-    L6470_SAY_STATUS(E3);
127
+  #if AXIS_IS_L64XX(E3)
128
+    L6470_say_status(E3);
103 129
   #endif
104
-  #if AXIS_DRIVER_TYPE_E4(L6470)
105
-    L6470_SAY_STATUS(E4);
130
+  #if AXIS_IS_L64XX(E4)
131
+    L6470_say_status(E4);
106 132
   #endif
107
-  #if AXIS_DRIVER_TYPE_E5(L6470)
108
-    L6470_SAY_STATUS(E5);
133
+  #if AXIS_IS_L64XX(E5)
134
+    L6470_say_status(E5);
109 135
   #endif
110 136
 
111
-  L6470.spi_active = false;   // done with all SPI transfers - clear handshake flags
112
-  L6470.spi_abort = false;
137
+  L64xxManager.spi_active = false;   // done with all SPI transfers - clear handshake flags
138
+  L64xxManager.spi_abort = false;
139
+  L64xxManager.pause_monitor(false);
113 140
 }
114 141
 
115
-#endif // HAS_DRIVER(L6470)
142
+#endif // HAS_L64XX

+ 180
- 104
Marlin/src/gcode/feature/L6470/M906.cpp View File

@@ -22,10 +22,10 @@
22 22
 
23 23
 #include "../../../inc/MarlinConfig.h"
24 24
 
25
-#if HAS_DRIVER(L6470)
25
+#if HAS_L64XX
26 26
 
27 27
 #include "../../gcode.h"
28
-#include "../../../libs/L6470/L6470_Marlin.h"
28
+#include "../../../libs/L64XX/L64XX_Marlin.h"
29 29
 #include "../../../module/stepper/indirection.h"
30 30
 #include "../../../module/planner.h"
31 31
 
@@ -37,6 +37,8 @@
37 37
  * M906: report or set KVAL_HOLD which sets the maximum effective voltage provided by the
38 38
  *       PWMs to the steppers
39 39
  *
40
+ * On L6474 this sets the TVAL register (same address).
41
+ *
40 42
  * J - select which driver(s) to monitor on multi-driver axis
41 43
  *     0 - (default) monitor all drivers on the axis or E0
42 44
  *     1 - monitor only X, Y, Z or E1
@@ -81,89 +83,162 @@
81 83
  *    KVAL_DEC
82 84
  *    Vs compensation (if enabled)
83 85
  */
86
+void L6470_report_current(L64XX &motor, const L64XX_axis_t axis) {
84 87
 
85
-void L6470_report_current(L6470 &motor, const uint8_t axis) {
86
-  if (L6470.spi_abort) return;  // don't do anything if set_directions() has occurred
87
-  const uint16_t status = motor.getStatus() ;
88
-  const uint8_t overcurrent_threshold = (uint8_t)motor.GetParam(L6470_OCD_TH),
89
-                stall_threshold = (uint8_t)motor.GetParam(L6470_STALL_TH),
90
-                motor_status = (status  & (STATUS_MOT_STATUS)) >> 13,
91
-                adc_out = motor.GetParam(L6470_ADC_OUT),
92
-                adc_out_limited = constrain(adc_out, 8, 24);
93
-  const float comp_coef = 1600.0f / adc_out_limited;
94
-  const int microsteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07);
95
-  char temp_buf[80];
96
-  L6470.say_axis(axis);
97
-  #if ENABLED(L6470_CHITCHAT)
98
-    sprintf_P(temp_buf, PSTR("   status: %4x   "), status);
99
-    DEBUG_ECHO(temp_buf);
100
-    print_bin(status);
101
-  #endif
102
-  sprintf_P(temp_buf, PSTR("\n...OverCurrent Threshold: %2d (%4d mA)"), overcurrent_threshold, (overcurrent_threshold + 1) * 375);
103
-  SERIAL_ECHO(temp_buf);
104
-
105
-  char numstr[11];
106
-  dtostrf((stall_threshold + 1) * 31.25, 1, 2, numstr);
107
-  sprintf_P(temp_buf, PSTR("   Stall Threshold: %2d (%s mA)"), stall_threshold, numstr);
108
-  SERIAL_ECHO(temp_buf);
109
-
110
-  SERIAL_ECHOPGM("   Motor Status: ");
111
-  const char *stat_str;
112
-  switch (motor_status) {
113
-    default:
114
-    case 0: stat_str = PSTR("stopped"); break;
115
-    case 1: stat_str = PSTR("accelerating"); break;
116
-    case 2: stat_str = PSTR("decelerating"); break;
117
-    case 3: stat_str = PSTR("at constant speed"); break;
118
-  }
119
-  serialprintPGM(stat_str);
120
-  SERIAL_EOL();
121
-
122
-  SERIAL_ECHOPAIR("...microsteps: ", microsteps);
123
-  SERIAL_ECHOPAIR("   ADC_OUT: ", adc_out);
124
-  SERIAL_ECHOPGM("   Vs_compensation: ");
125
-  serialprintPGM((motor.GetParam(L6470_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED"));
126
-
127
-  SERIAL_ECHOLNPAIR("   Compensation coefficient: ", dtostrf(comp_coef * 0.01f, 7, 2, numstr));
128
-  SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD));
129
-  SERIAL_ECHOPAIR("   KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN));
130
-  SERIAL_ECHOPAIR("   KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC));
131
-  SERIAL_ECHOPAIR("   KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC));
132
-  SERIAL_ECHOPGM("   V motor max =  ");
133
-  float val;
134
-  PGM_P suf;
135
-  switch (motor_status) {
136
-    case 0:
137
-      val = motor.GetParam(L6470_KVAL_HOLD);
138
-      suf = PSTR("(KVAL_HOLD)");
139
-      break;
140
-    case 1:
141
-      val = motor.GetParam(L6470_KVAL_RUN);
142
-      suf = PSTR("(KVAL_RUN)");
143
-      break;
144
-    case 2:
145
-      val = motor.GetParam(L6470_KVAL_ACC);
146
-      suf = PSTR("(KVAL_ACC)");
88
+  if (L64xxManager.spi_abort) return;  // don't do anything if set_directions() has occurred
89
+
90
+  const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow;
91
+  const uint16_t status = L64xxManager.get_status(axis);    //also populates shadow structure
92
+  const uint8_t OverCurrent_Threshold = uint8_t(motor.GetParam(L6470_OCD_TH));
93
+
94
+  auto say_axis_status = [](const L64XX_axis_t axis, const uint16_t status) {
95
+    L64xxManager.say_axis(axis);
96
+    #if ENABLED(L6470_CHITCHAT)
97
+      char tmp[10];
98
+      sprintf_P(tmp, PSTR("%4x   "), status);
99
+      DEBUG_ECHOPAIR("   status: ", tmp);
100
+      print_bin(status);
101
+    #else
102
+      UNUSED(status);
103
+    #endif
104
+    SERIAL_EOL();
105
+  };
106
+
107
+  char temp_buf[10];
108
+
109
+  switch (sh.STATUS_AXIS_LAYOUT) {
110
+    case L6470_STATUS_LAYOUT:       // L6470
111
+    case L6480_STATUS_LAYOUT: {     // L6480 & powerstep01
112
+      const uint16_t Stall_Threshold = (uint8_t)motor.GetParam(L6470_STALL_TH),
113
+                     motor_status = (status & (STATUS_MOT_STATUS)) >> 5,
114
+                     L6470_ADC_out = motor.GetParam(L6470_ADC_OUT),
115
+                     L6470_ADC_out_limited = constrain(L6470_ADC_out, 8, 24);
116
+      const float comp_coef = 1600.0f / L6470_ADC_out_limited;
117
+      const uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07);
118
+
119
+      say_axis_status(axis, status);
120
+
121
+      SERIAL_ECHOPGM("...OverCurrent Threshold: ");
122
+      sprintf_P(temp_buf, PSTR("%2d ("), OverCurrent_Threshold);
123
+      SERIAL_ECHO(temp_buf);
124
+      SERIAL_ECHO((OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV);
125
+      SERIAL_ECHOPGM(" mA)");
126
+      SERIAL_ECHOPGM("   Stall Threshold: ");
127
+      sprintf_P(temp_buf, PSTR("%2d ("), Stall_Threshold);
128
+      SERIAL_ECHO(temp_buf);
129
+      SERIAL_ECHO((Stall_Threshold + 1) * motor.STALL_CURRENT_CONSTANT_INV);
130
+      SERIAL_ECHOPGM(" mA)");
131
+      SERIAL_ECHOPGM("   Motor Status: ");
132
+      switch (motor_status) {
133
+        case 0: SERIAL_ECHOPGM("stopped"); break;
134
+        case 1: SERIAL_ECHOPGM("accelerating"); break;
135
+        case 2: SERIAL_ECHOPGM("decelerating"); break;
136
+        case 3: SERIAL_ECHOPGM("at constant speed"); break;
137
+      }
138
+      SERIAL_EOL();
139
+
140
+      SERIAL_ECHOPAIR("...MicroSteps: ", MicroSteps,
141
+                      "   ADC_OUT: ", L6470_ADC_out);
142
+      SERIAL_ECHOPGM("   Vs_compensation: ");
143
+      serialprintPGM((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED"));
144
+      SERIAL_ECHOLNPAIR("   Compensation coefficient: ~", comp_coef * 0.01f);
145
+
146
+      SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD),
147
+                      "   KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN),
148
+                      "   KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC),
149
+                      "   KVAL_DEC: ", motor.GetParam(L6470_KVAL_DEC),
150
+                      "   V motor max = ");
151
+      switch (motor_status) {
152
+        case 0: SERIAL_ECHO(motor.GetParam(L6470_KVAL_HOLD) * 100 / 256); SERIAL_ECHOPGM("% (KVAL_HOLD)"); break;
153
+        case 1: SERIAL_ECHO(motor.GetParam(L6470_KVAL_RUN)  * 100 / 256); SERIAL_ECHOPGM("% (KVAL_RUN)"); break;
154
+        case 2: SERIAL_ECHO(motor.GetParam(L6470_KVAL_ACC)  * 100 / 256); SERIAL_ECHOPGM("% (KVAL_ACC)"); break;
155
+        case 3: SERIAL_ECHO(motor.GetParam(L6470_KVAL_DEC)  * 100 / 256); SERIAL_ECHOPGM("% (KVAL_HOLD)"); break;
156
+      }
157
+      SERIAL_EOL();
158
+
159
+      #if ENABLED(L6470_CHITCHAT)
160
+        DEBUG_ECHOPGM("...SLEW RATE: ");
161
+        switch (sh.STATUS_AXIS_LAYOUT) {
162
+          case L6470_STATUS_LAYOUT: {
163
+            switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) {
164
+              case 0: { DEBUG_ECHOLNPGM("320V/uS") ; break; }
165
+              case 1: { DEBUG_ECHOLNPGM("75V/uS")  ; break; }
166
+              case 2: { DEBUG_ECHOLNPGM("110V/uS") ; break; }
167
+              case 3: { DEBUG_ECHOLNPGM("260V/uS") ; break; }
168
+            }
169
+            break;
170
+          }
171
+        case L6480_STATUS_LAYOUT: {
172
+            switch (motor.GetParam(L6470_GATECFG1) & CONFIG1_SR ) {
173
+              case CONFIG1_SR_220V_us: { DEBUG_ECHOLNPGM("220V/uS") ; break; }
174
+              case CONFIG1_SR_400V_us: { DEBUG_ECHOLNPGM("400V/uS") ; break; }
175
+              case CONFIG1_SR_520V_us: { DEBUG_ECHOLNPGM("520V/uS") ; break; }
176
+              case CONFIG1_SR_980V_us: { DEBUG_ECHOLNPGM("980V/uS") ; break; }
177
+              default: { DEBUG_ECHOLNPGM("unknown") ; break; }
178
+            }
179
+          }
180
+        }
181
+      #endif
182
+      SERIAL_EOL();
147 183
       break;
148
-    case 3:
149
-      val = motor.GetParam(L6470_KVAL_DEC);
150
-      suf = PSTR("(KVAL_DEC)");
184
+    }
185
+
186
+    case L6474_STATUS_LAYOUT: {  // L6474
187
+      const uint16_t L6470_ADC_out = motor.GetParam(L6470_ADC_OUT) & 0x1F,
188
+                     L6474_TVAL_val = motor.GetParam(L6474_TVAL) & 0x7F;
189
+
190
+      say_axis_status(axis, status);
191
+
192
+      SERIAL_ECHOPGM("...OverCurrent Threshold: ");
193
+      sprintf_P(temp_buf, PSTR("%2d ("), OverCurrent_Threshold);
194
+      SERIAL_ECHO(temp_buf);
195
+      SERIAL_ECHO((OverCurrent_Threshold + 1) * motor.OCD_CURRENT_CONSTANT_INV);
196
+      SERIAL_ECHOPGM(" mA)");
197
+      SERIAL_ECHOPGM("   TVAL: ");
198
+      sprintf_P(temp_buf, PSTR("%2d ("), L6474_TVAL_val);
199
+      SERIAL_ECHO(temp_buf);
200
+      SERIAL_ECHO((L6474_TVAL_val + 1) * motor.STALL_CURRENT_CONSTANT_INV);
201
+      SERIAL_ECHOLNPGM(" mA   Motor Status: NA)");
202
+
203
+      const uint16_t MicroSteps = _BV(motor.GetParam(L6470_STEP_MODE) & 0x07); //NOMORE(MicroSteps, 16);
204
+      SERIAL_ECHOLNPAIR("...MicroSteps: ", MicroSteps,
205
+                        "   ADC_OUT: ", L6470_ADC_out);
206
+
207
+      SERIAL_ECHOLNPGM("   Vs_compensation: NA\n"
208
+                       "...KVAL_HOLD: NA"
209
+                       "   KVAL_RUN : NA"
210
+                       "   KVAL_ACC: NA"
211
+                       "   KVAL_DEC: NA"
212
+                       "   V motor max =  NA");
213
+
214
+      #if ENABLED(L6470_CHITCHAT)
215
+        DEBUG_ECHOPGM("...SLEW RATE: ");
216
+        switch ((motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT) {
217
+          case 0:  DEBUG_ECHOLNPGM("320V/uS") ; break;
218
+          case 1:  DEBUG_ECHOLNPGM("75V/uS")  ; break;
219
+          case 2:  DEBUG_ECHOLNPGM("110V/uS") ; break;
220
+          case 3:  DEBUG_ECHOLNPGM("260V/uS") ; break;
221
+          default: DEBUG_ECHOLNPAIR("slew rate: ", (motor.GetParam(sh.L6470_AXIS_CONFIG) & CONFIG_POW_SR) >> CONFIG_POW_SR_BIT); break;
222
+        }
223
+      #endif
224
+      SERIAL_EOL();
225
+      SERIAL_EOL();
151 226
       break;
227
+    }
152 228
   }
153
-  SERIAL_ECHO(dtostrf(val * 100 / 256, 10, 2, numstr));
154
-  SERIAL_ECHOPGM("%% ");
155
-  serialprintPGM(suf);
156
-  SERIAL_EOL();
157 229
 }
158 230
 
159 231
 void GcodeSuite::M906() {
232
+
233
+  L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status
234
+
160 235
   #define L6470_SET_KVAL_HOLD(Q) stepper##Q.SetParam(L6470_KVAL_HOLD, value)
161 236
 
162 237
   DEBUG_ECHOLNPGM("M906");
163 238
 
164
-  bool report_current = true;
239
+  uint8_t report_current = true;
165 240
 
166
-  #if HAS_DRIVER(L6470)
241
+  #if HAS_L64XX
167 242
     const uint8_t index = parser.byteval('I');
168 243
   #endif
169 244
 
@@ -172,35 +247,35 @@ void GcodeSuite::M906() {
172 247
     report_current = false;
173 248
 
174 249
     if (planner.has_blocks_queued() || planner.cleaning_buffer_counter) {
175
-      SERIAL_ECHOLNPGM("!Can't set KVAL_HOLD with steppers moving");
250
+      SERIAL_ECHOLNPGM("Test aborted. Can't set KVAL_HOLD while steppers are moving.");
176 251
       return;
177 252
     }
178 253
 
179 254
     switch (i) {
180 255
       case X_AXIS:
181
-        #if AXIS_DRIVER_TYPE_X(L6470)
256
+        #if AXIS_IS_L64XX(X)
182 257
           if (index == 0) L6470_SET_KVAL_HOLD(X);
183 258
         #endif
184
-        #if AXIS_DRIVER_TYPE_X2(L6470)
259
+        #if AXIS_IS_L64XX(X2)
185 260
           if (index == 1) L6470_SET_KVAL_HOLD(X2);
186 261
         #endif
187 262
         break;
188 263
       case Y_AXIS:
189
-        #if AXIS_DRIVER_TYPE_Y(L6470)
264
+        #if AXIS_IS_L64XX(Y)
190 265
           if (index == 0) L6470_SET_KVAL_HOLD(Y);
191 266
         #endif
192
-        #if AXIS_DRIVER_TYPE_Y2(L6470)
267
+        #if AXIS_IS_L64XX(Y2)
193 268
           if (index == 1) L6470_SET_KVAL_HOLD(Y2);
194 269
         #endif
195 270
         break;
196 271
       case Z_AXIS:
197
-        #if AXIS_DRIVER_TYPE_Z(L6470)
272
+        #if AXIS_IS_L64XX(Z)
198 273
           if (index == 0) L6470_SET_KVAL_HOLD(Z);
199 274
         #endif
200
-        #if AXIS_DRIVER_TYPE_Z2(L6470)
275
+        #if AXIS_IS_L64XX(Z2)
201 276
           if (index == 1) L6470_SET_KVAL_HOLD(Z2);
202 277
         #endif
203
-        #if AXIS_DRIVER_TYPE_Z3(L6470)
278
+        #if AXIS_IS_L64XX(Z3)
204 279
           if (index == 2) L6470_SET_KVAL_HOLD(Z3);
205 280
         #endif
206 281
         break;
@@ -208,22 +283,22 @@ void GcodeSuite::M906() {
208 283
         const int8_t target_extruder = get_target_extruder_from_command();
209 284
         if (target_extruder < 0) return;
210 285
         switch (target_extruder) {
211
-          #if AXIS_DRIVER_TYPE_E0(L6470)
286
+          #if AXIS_IS_L64XX(E0)
212 287
             case 0: L6470_SET_KVAL_HOLD(E0); break;
213 288
           #endif
214
-          #if AXIS_DRIVER_TYPE_E1(L6470)
289
+          #if AXIS_IS_L64XX(E1)
215 290
             case 1: L6470_SET_KVAL_HOLD(E1); break;
216 291
           #endif
217
-          #if AXIS_DRIVER_TYPE_E2(L6470)
292
+          #if AXIS_IS_L64XX(E2)
218 293
             case 2: L6470_SET_KVAL_HOLD(E2); break;
219 294
           #endif
220
-          #if AXIS_DRIVER_TYPE_E3(L6470)
295
+          #if AXIS_IS_L64XX(E3)
221 296
             case 3: L6470_SET_KVAL_HOLD(E3); break;
222 297
           #endif
223
-          #if AXIS_DRIVER_TYPE_E4(L6470)
298
+          #if AXIS_IS_L64XX(E4)
224 299
             case 4: L6470_SET_KVAL_HOLD(E4); break;
225 300
           #endif
226
-          #if AXIS_DRIVER_TYPE_E5(L6470)
301
+          #if AXIS_IS_L64XX(E5)
227 302
             case 5: L6470_SET_KVAL_HOLD(E5); break;
228 303
           #endif
229 304
         }
@@ -234,51 +309,52 @@ void GcodeSuite::M906() {
234 309
   if (report_current) {
235 310
     #define L6470_REPORT_CURRENT(Q) L6470_report_current(stepper##Q, Q)
236 311
 
237
-    L6470.spi_active = true;    // let set_directions() know we're in the middle of a series of SPI transfers
312
+    L64xxManager.spi_active = true; // Tell set_directions() a series of SPI transfers is underway
238 313
 
239
-    #if AXIS_DRIVER_TYPE_X(L6470)
314
+    #if AXIS_IS_L64XX(X)
240 315
       L6470_REPORT_CURRENT(X);
241 316
     #endif
242
-    #if AXIS_DRIVER_TYPE_X2(L6470)
317
+    #if AXIS_IS_L64XX(X2)
243 318
       L6470_REPORT_CURRENT(X2);
244 319
     #endif
245
-    #if AXIS_DRIVER_TYPE_Y(L6470)
320
+    #if AXIS_IS_L64XX(Y)
246 321
       L6470_REPORT_CURRENT(Y);
247 322
     #endif
248
-    #if AXIS_DRIVER_TYPE_Y2(L6470)
323
+    #if AXIS_IS_L64XX(Y2)
249 324
       L6470_REPORT_CURRENT(Y2);
250 325
     #endif
251
-    #if AXIS_DRIVER_TYPE_Z(L6470)
326
+    #if AXIS_IS_L64XX(Z)
252 327
       L6470_REPORT_CURRENT(Z);
253 328
     #endif
254
-    #if AXIS_DRIVER_TYPE_Z2(L6470)
329
+    #if AXIS_IS_L64XX(Z2)
255 330
       L6470_REPORT_CURRENT(Z2);
256 331
     #endif
257
-    #if AXIS_DRIVER_TYPE_Z3(L6470)
332
+    #if AXIS_IS_L64XX(Z3)
258 333
       L6470_REPORT_CURRENT(Z3);
259 334
     #endif
260
-    #if AXIS_DRIVER_TYPE_E0(L6470)
335
+    #if AXIS_IS_L64XX(E0)
261 336
       L6470_REPORT_CURRENT(E0);
262 337
     #endif
263
-    #if AXIS_DRIVER_TYPE_E1(L6470)
338
+    #if AXIS_IS_L64XX(E1)
264 339
       L6470_REPORT_CURRENT(E1);
265 340
     #endif
266
-    #if AXIS_DRIVER_TYPE_E2(L6470)
341
+    #if AXIS_IS_L64XX(E2)
267 342
       L6470_REPORT_CURRENT(E2);
268 343
     #endif
269
-    #if AXIS_DRIVER_TYPE_E3(L6470)
344
+    #if AXIS_IS_L64XX(E3)
270 345
       L6470_REPORT_CURRENT(E3);
271 346
     #endif
272
-    #if AXIS_DRIVER_TYPE_E4(L6470)
347
+    #if AXIS_IS_L64XX(E4)
273 348
       L6470_REPORT_CURRENT(E4);
274 349
     #endif
275
-    #if AXIS_DRIVER_TYPE_E5(L6470)
350
+    #if AXIS_IS_L64XX(E5)
276 351
       L6470_REPORT_CURRENT(E5);
277 352
     #endif
278 353
 
279
-    L6470.spi_active = false;   // done with all SPI transfers - clear handshake flags
280
-    L6470.spi_abort = false;
354
+    L64xxManager.spi_active = false;   // done with all SPI transfers - clear handshake flags
355
+    L64xxManager.spi_abort = false;
356
+    L64xxManager.pause_monitor(false);
281 357
   }
282 358
 }
283 359
 
284
-#endif // HAS_DRIVER(L6470)
360
+#endif // HAS_L64XX

+ 328
- 201
Marlin/src/gcode/feature/L6470/M916-918.cpp View File

@@ -20,35 +20,26 @@
20 20
  *
21 21
  */
22 22
 
23
+//
24
+// NOTE: All tests assume each axis uses matching driver chips.
25
+//
26
+
23 27
 #include "../../../inc/MarlinConfig.h"
24 28
 
25
-#if HAS_DRIVER(L6470)
29
+#if HAS_L64XX
26 30
 
27 31
 #include "../../gcode.h"
28 32
 #include "../../../module/stepper/indirection.h"
29 33
 #include "../../../module/planner.h"
30
-#include "../../../libs/L6470/L6470_Marlin.h"
34
+#include "../../../libs/L64XX/L64XX_Marlin.h"
31 35
 
32 36
 #define DEBUG_OUT ENABLED(L6470_CHITCHAT)
33 37
 #include "../../../core/debug_out.h"
34 38
 
35
-static void jiggle_axis(const char axis_char, const float &min, const float &max, const feedRate_t &fr_mm_m) {
36
-  char gcode_string[30], str1[11], str2[11];
37
-
38
-  // Turn the motor(s) both directions
39
-  sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(min, 1, 3, str1), dtostrf(fr_mm_m, 1, 3, str2));
40
-  gcode.process_subcommands_now(gcode_string);
41
-
42
-  sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(max, 1, 3, str1), str2);
43
-  gcode.process_subcommands_now(gcode_string);
44
-
45
-  planner.synchronize();
46
-}
47
-
48 39
 /**
49 40
  *
50
- * M916: Increase KVAL_HOLD until thermal warning
51
- *
41
+ * M916: increase KVAL_HOLD until get thermal warning
42
+ *       NOTE - on L6474 it is TVAL that is used
52 43
  *
53 44
  * J - select which driver(s) to monitor on multi-driver axis
54 45
  *     0 - (default) monitor all drivers on the axis or E0
@@ -62,8 +53,14 @@ static void jiggle_axis(const char axis_char, const float &min, const float &max
62 53
  * F - feedrate
63 54
  *     optional - will use default max feedrate from configuration.h if not specified
64 55
  *
65
- * K - starting value for KVAL_HOLD (0 - 255)
66
- *     optional - will use & report current value from driver if not specified
56
+ * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only
57
+ *     optional - will report current value from driver if not specified
58
+ *
59
+ * K - value for KVAL_HOLD (0 - 255) (ignored for L6474)
60
+ *     optional - will report current value from driver if not specified
61
+ *
62
+ * D - time (in seconds) to run each setting of KVAL_HOLD/TVAL
63
+ *     optional - defaults to zero (runs each setting once)
67 64
  *
68 65
  */
69 66
 
@@ -77,80 +74,115 @@ void GcodeSuite::M916() {
77 74
 
78 75
   DEBUG_ECHOLNPGM("M916");
79 76
 
80
-  // Variables used by L6470_get_user_input function - some may not be used
81
-  char axis_mon[3][3] = { "  ", "  ", "  " };  // list of Axes to be monitored
82
-  uint8_t axis_index[3];
77
+  L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status
78
+
79
+  // Variables used by L64xxManager.get_user_input function - some may not be used
80
+  char axis_mon[3][3] = { {"  "}, {"  "}, {"  "} };   // list of Axes to be monitored
81
+  L64XX_axis_t axis_index[3];
83 82
   uint16_t axis_status[3];
84 83
   uint8_t driver_count = 1;
85 84
   float position_max;
86 85
   float position_min;
87
-  feedRate_t final_fr_mm_m;
86
+  float final_feedrate;
88 87
   uint8_t kval_hold;
89
-  uint8_t ocd_th_val = 0;
90
-  uint8_t stall_th_val = 0;
88
+  uint8_t OCD_TH_val = 0;
89
+  uint8_t STALL_TH_val = 0;
91 90
   uint16_t over_current_threshold;
92
-  constexpr bool over_current_flag = false;  // M916 doesn't play with the overcurrent thresholds
91
+  constexpr uint8_t over_current_flag = false;  // M916 doesn't play with the overcurrent thresholds
92
+
93
+  #define DRIVER_TYPE_L6474(Q) AXIS_DRIVER_TYPE_##Q(L6474)
93 94
 
94 95
   uint8_t j;   // general purpose counter
95 96
 
96
-  if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold))
97
+  if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold))
97 98
     return;  // quit if invalid user input
98 99
 
99
-  DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m);
100
+  DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate);
100 101
 
101
-  planner.synchronize();                  // Wait for moves to finish
102
+  planner.synchronize();                             // wait for all current movement commands to complete
102 103
 
104
+  const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow;
103 105
   for (j = 0; j < driver_count; j++)
104
-    L6470.get_status(axis_index[j]);      // Clear out error flags
106
+    L64xxManager.get_status(axis_index[j]);  // clear out any pre-existing error flags
105 107
 
108
+  char temp_axis_string[] = " ";
109
+  temp_axis_string[0] = axis_mon[0][0];  // need to have a string for use within sprintf format section
110
+  char gcode_string[80];
106 111
   uint16_t status_composite = 0;
107 112
 
113
+  uint16_t M91x_counter = kval_hold;
114
+  uint16_t M91x_counter_max;
115
+  if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {
116
+    M91x_counter_max = 128;  // TVAL is 7 bits
117
+    LIMIT(M91x_counter, 0U, 127U);
118
+  }
119
+  else
120
+    M91x_counter_max = 256;  // KVAL_HOLD is 8 bits
121
+
122
+  uint8_t M91x_delay_s = parser.byteval('D');   // get delay in seconds
123
+  millis_t M91x_delay_ms = M91x_delay_s * 60 * 1000;
124
+  millis_t M91x_delay_end;
125
+
108 126
   DEBUG_ECHOLNPGM(".\n.");
109 127
 
110 128
   do {
111 129
 
112
-    DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold);   // set & report KVAL_HOLD for this run
130
+    if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)
131
+      DEBUG_ECHOLNPAIR("TVAL current (mA) = ", (M91x_counter + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV);        // report TVAL current for this run
132
+    else
133
+      DEBUG_ECHOLNPAIR("kval_hold = ", M91x_counter);                                   // report KVAL_HOLD for this run
113 134
 
114 135
     for (j = 0; j < driver_count; j++)
115
-      L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
136
+      L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, M91x_counter);  //set KVAL_HOLD or TVAL (same register address)
116 137
 
117
-    // Turn the motor(s) both directions
118
-    jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m);
138
+    M91x_delay_end = millis() + M91x_delay_ms;
139
+    do {
140
+      // turn the motor(s) both directions
141
+      sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate));
142
+      gcode.process_subcommands_now_P(gcode_string);
119 143
 
120
-    status_composite = 0;    // clear out the old bits
144
+      sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(final_feedrate));
145
+      gcode.process_subcommands_now_P(gcode_string);
121 146
 
122
-    for (j = 0; j < driver_count; j++) {
123
-      axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK;    // bits of interest are all active low
124
-      status_composite |= axis_status[j] ;
125
-    }
147
+      // get the status after the motors have stopped
148
+      planner.synchronize();
149
+
150
+      status_composite = 0;    // clear out the old bits
126 151
 
127
-    if (status_composite && (status_composite & STATUS_UVLO)) {
128
-      DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)");
129 152
       for (j = 0; j < driver_count; j++) {
130
-        DEBUG_ECHOPGM("...");
131
-        L6470.error_status_decode(axis_status[j], axis_index[j]);
153
+        axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK;    // bits of interest are all active low
154
+        status_composite |= axis_status[j] ;
132 155
       }
133
-      return;
134
-    }
135 156
 
136
-    // increment KVAL_HOLD if not yet at thermal warning/shutdown
137
-    if (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD)))
138
-      kval_hold++;
157
+      if (status_composite) break;
158
+    } while (millis() < M91x_delay_end);
139 159
 
140
-  } while (!(status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) && kval_hold);  // exit when kval_hold == 0 (rolls over)
160
+    if (status_composite) break;
141 161
 
142
-  DEBUG_ECHOPGM(".\n.\nThermal warning/shutdown ");
143
-  if ((status_composite & (STATUS_TH_WRN | STATUS_TH_SD))) {
144
-    DEBUG_ECHOLNPGM("has occurred");
145
-    for (j = 0; j < driver_count; j++) {
146
-      DEBUG_ECHOPGM("...");
147
-      L6470.error_status_decode(axis_status[j], axis_index[j]);
162
+    M91x_counter++;
163
+
164
+  } while (!(status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) && (M91x_counter < M91x_counter_max));
165
+
166
+  DEBUG_ECHOLNPGM(".");
167
+
168
+  #if ENABLED(L6470_CHITCHAT)
169
+    if (status_composite) {
170
+      L64xxManager.error_status_decode(status_composite, axis_index[0],
171
+        sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN,
172
+        sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B,
173
+        sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT);
174
+      DEBUG_ECHOLNPGM(".");
148 175
     }
149
-  }
176
+  #endif
177
+
178
+  if ((status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)))
179
+    DEBUG_ECHOLNPGM(".\n.\nTest completed normally - Thermal warning/shutdown has occurred");
180
+  else if (status_composite)
181
+    DEBUG_ECHOLNPGM(".\n.\nTest completed abnormally - non-thermal error has occured");
150 182
   else
151
-    DEBUG_ECHOLNPGM("(Unable to get)");
183
+    DEBUG_ECHOLNPGM(".\n.\nTest completed normally - Unable to get to thermal warning/shutdown");
152 184
 
153
-  DEBUG_ECHOLNPGM(".");
185
+  L64xxManager.pause_monitor(false);
154 186
 }
155 187
 
156 188
 /**
@@ -159,8 +191,8 @@ void GcodeSuite::M916() {
159 191
  *
160 192
  *   Decrease OCD current until overcurrent error
161 193
  *   Increase OCD until overcurrent error goes away
162
- *   Decrease stall threshold until stall
163
- *   Increase stall until stall error goes away
194
+ *   Decrease stall threshold until stall (not done on L6474)
195
+ *   Increase stall until stall error goes away (not done on L6474)
164 196
  *
165 197
  * J - select which driver(s) to monitor on multi-driver axis
166 198
  *     0 - (default) monitor all drivers on the axis or E0
@@ -176,7 +208,10 @@ void GcodeSuite::M916() {
176 208
  *     optional - will report current value from driver if not specified
177 209
  *     if there are multiple drivers on the axis then all will be set the same
178 210
  *
179
- * K - value for KVAL_HOLD (0 - 255)
211
+ * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only
212
+ *     optional - will report current value from driver if not specified
213
+ *
214
+ * K - value for KVAL_HOLD (0 - 255) (ignored for L6474)
180 215
  *     optional - will report current value from driver if not specified
181 216
  *
182 217
  */
@@ -184,66 +219,85 @@ void GcodeSuite::M917() {
184 219
 
185 220
   DEBUG_ECHOLNPGM("M917");
186 221
 
187
-  char axis_mon[3][3] = { "  ", "  ", "  " };  // list of axes to be monitored
188
-  uint8_t axis_index[3];
222
+  L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status
223
+
224
+  char axis_mon[3][3] = { {"  "}, {"  "}, {"  "} };   // list of Axes to be monitored
225
+  L64XX_axis_t axis_index[3];
189 226
   uint16_t axis_status[3];
190 227
   uint8_t driver_count = 1;
191 228
   float position_max;
192 229
   float position_min;
193
-  feedRate_t final_fr_mm_m;
230
+  float final_feedrate;
194 231
   uint8_t kval_hold;
195
-  uint8_t ocd_th_val = 0;
196
-  uint8_t stall_th_val = 0;
232
+  uint8_t OCD_TH_val = 0;
233
+  uint8_t STALL_TH_val = 0;
197 234
   uint16_t over_current_threshold;
198
-  constexpr bool over_current_flag = true;
235
+  constexpr uint8_t over_current_flag = true;
199 236
 
200 237
   uint8_t j;   // general purpose counter
201 238
 
202
-  if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold))
239
+  if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold))
203 240
     return;  // quit if invalid user input
204 241
 
205
-  DEBUG_ECHOLNPAIR("feedrate = ", final_fr_mm_m);
242
+  DEBUG_ECHOLNPAIR("feedrate = ", final_feedrate);
206 243
 
207
-  planner.synchronize();                // Wait for moves to finish
244
+  planner.synchronize();                             // wait for all current movement commands to complete
245
+
246
+  const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow;
208 247
   for (j = 0; j < driver_count; j++)
209
-    L6470.get_status(axis_index[j]);    // Clear out error flags
248
+    L64xxManager.get_status(axis_index[j]);  // clear error flags
249
+  char temp_axis_string[] = " ";
250
+  temp_axis_string[0] = axis_mon[0][0];   // need a sprintf format string
251
+  char gcode_string[80];
210 252
   uint16_t status_composite = 0;
211
-  uint8_t test_phase = 0;
212
-        // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL)
213
-        // 1 - increasing OCD - exit when OCD warning stops (ignore STALL) -
214
-        // 2 - OCD finalized - decreasing STALL - exit when STALL warning happens
215
-        // 3 - OCD finalized - increasing STALL - exit when STALL warning stop
216
-        // 4 - all testing completed
217
-  DEBUG_ECHOPAIR(".\n.\n.\nover_current threshold : ", (ocd_th_val + 1) * 375);   // first status display
218
-  DEBUG_ECHOPAIR("  (OCD_TH:  : ", ocd_th_val);
219
-  DEBUG_ECHOPAIR(")   Stall threshold: ", (stall_th_val + 1) * 31.25);
220
-  DEBUG_ECHOPAIR("  (STALL_TH: ", stall_th_val);
253
+  uint8_t test_phase = 0;                 // 0 - decreasing OCD - exit when OCD warning occurs (ignore STALL)
254
+                                          // 1 - increasing OCD - exit when OCD warning stops (ignore STALL)
255
+                                          // 2 - OCD finalized - decreasing STALL - exit when STALL warning happens
256
+                                          // 3 - OCD finalized - increasing STALL - exit when STALL warning stop
257
+                                          // 4 - all testing completed
258
+  DEBUG_ECHOPAIR(".\n.\n.\nover_current threshold : ", (OCD_TH_val + 1) * 375);   // first status display
259
+  DEBUG_ECHOPAIR("  (OCD_TH:  : ", OCD_TH_val);
260
+  if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) {
261
+    DEBUG_ECHOPAIR(")   Stall threshold: ", (STALL_TH_val + 1) * 31.25);
262
+    DEBUG_ECHOPAIR("  (STALL_TH: ", STALL_TH_val);
263
+  }
221 264
   DEBUG_ECHOLNPGM(")");
222 265
 
223 266
   do {
224 267
 
225
-    DEBUG_ECHOPAIR("STALL threshold : ", (stall_th_val + 1) * 31.25);
226
-    DEBUG_ECHOLNPAIR("   OCD threshold : ", (ocd_th_val + 1) * 375);
268
+    if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) DEBUG_ECHOPAIR("STALL threshold : ", (STALL_TH_val + 1) * 31.25);
269
+    DEBUG_ECHOLNPAIR("   OCD threshold : ", (OCD_TH_val + 1) * 375);
227 270
 
228
-    jiggle_axis(axis_mon[0][0], position_min, position_max, final_fr_mm_m);
271
+    sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(final_feedrate));
272
+    gcode.process_subcommands_now_P(gcode_string);
273
+
274
+    sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(final_feedrate));
275
+    gcode.process_subcommands_now_P(gcode_string);
276
+
277
+    planner.synchronize();
229 278
 
230 279
     status_composite = 0;    // clear out the old bits
231 280
 
232 281
     for (j = 0; j < driver_count; j++) {
233
-      axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK;    // bits of interest are all active low
282
+      axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK;    // bits of interest are all active low
234 283
       status_composite |= axis_status[j];
235 284
     }
236 285
 
237
-    if (status_composite && (status_composite & STATUS_UVLO)) {
286
+    if (status_composite && (status_composite & sh.STATUS_AXIS_UVLO)) {
238 287
       DEBUG_ECHOLNPGM("Test aborted (Undervoltage lockout active)");
239
-      for (j = 0; j < driver_count; j++) {
240
-        DEBUG_ECHOPGM("...");
241
-        L6470.error_status_decode(axis_status[j], axis_index[j]);
242
-      }
288
+      #if ENABLED(L6470_CHITCHAT)
289
+        for (j = 0; j < driver_count; j++) {
290
+          if (j) DEBUG_ECHOPGM("...");
291
+          L64xxManager.error_status_decode(axis_status[j], axis_index[j],
292
+            sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN,
293
+            sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B,
294
+            sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT);
295
+        }
296
+      #endif
243 297
       return;
244 298
     }
245 299
 
246
-    if (status_composite & (STATUS_TH_WRN | STATUS_TH_SD)) {
300
+    if (status_composite & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD)) {
247 301
       DEBUG_ECHOLNPGM("thermal problem - waiting for chip(s) to cool down ");
248 302
       uint16_t status_composite_temp = 0;
249 303
       uint8_t k = 0;
@@ -251,118 +305,136 @@ void GcodeSuite::M917() {
251 305
         k++;
252 306
         if (!(k % 4)) {
253 307
           kval_hold *= 0.95;
254
-          L6470_EOL();
308
+          DEBUG_EOL();
255 309
           DEBUG_ECHOLNPAIR("Lowering KVAL_HOLD by about 5% to ", kval_hold);
256 310
           for (j = 0; j < driver_count; j++)
257
-            L6470.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
311
+            L64xxManager.set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
258 312
         }
259 313
         DEBUG_ECHOLNPGM(".");
260
-        reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered
261
-        watchdog_refresh();
314
+        gcode.reset_stepper_timeout(); // reset_stepper_timeout to keep steppers powered
315
+        watchdog_refresh();;   // beat the dog
262 316
         safe_delay(5000);
263 317
         status_composite_temp = 0;
264 318
         for (j = 0; j < driver_count; j++) {
265
-          axis_status[j] = (~L6470.get_status(axis_index[j])) & L6470_ERROR_MASK;    // bits of interest are all active low
319
+          axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & sh.L6470_ERROR_MASK;    // bits of interest are all active low
266 320
           status_composite_temp |= axis_status[j];
267 321
         }
268 322
       }
269
-      while (status_composite_temp & (STATUS_TH_WRN | STATUS_TH_SD));
270
-      L6470_EOL();
323
+      while (status_composite_temp & (sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD));
324
+      DEBUG_EOL();
271 325
     }
272
-    if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B | STATUS_OCD)) {
326
+    if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B | sh.STATUS_AXIS_OCD)) {
273 327
       switch (test_phase) {
274 328
 
275 329
         case 0: {
276
-          if (status_composite & STATUS_OCD) {
330
+          if (status_composite & sh.STATUS_AXIS_OCD) {
277 331
             // phase 0 with OCD warning - time to go to next phase
278
-            if (ocd_th_val >=15) {
279
-              ocd_th_val = 15;           // limit to max
332
+            if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) {
333
+              OCD_TH_val = sh.AXIS_OCD_TH_MAX;           // limit to max
280 334
               test_phase = 2;            // at highest value so skip phase 1
281
-              DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2");
335
+              //DEBUG_ECHOLNPGM("LOGIC E0A OCD at highest - skip to 2");
336
+              DEBUG_ECHOLNPGM("OCD at highest - OCD finalized");
282 337
             }
283 338
             else {
284
-              ocd_th_val++;              // normal exit to next phase
339
+              OCD_TH_val++;              // normal exit to next phase
285 340
               test_phase = 1;            // setup for first pass of phase 1
286
-              DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD  & go to 1");
341
+              //DEBUG_ECHOLNPGM("LOGIC E0B - inc OCD  & go to 1");
342
+              DEBUG_ECHOLNPGM("inc OCD");
287 343
             }
288 344
           }
289 345
           else {  // phase 0 without OCD warning - keep on decrementing if can
290
-            if (ocd_th_val) {
291
-              ocd_th_val--;              // try lower value
292
-              DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD");
346
+            if (OCD_TH_val) {
347
+              OCD_TH_val--;              // try lower value
348
+              //DEBUG_ECHOLNPGM("LOGIC E0C - dec OCD");
349
+              DEBUG_ECHOLNPGM("dec OCD");
293 350
             }
294 351
             else {
295 352
               test_phase = 2;            // at lowest value without warning so skip phase 1
296
-              DEBUG_ECHOLNPGM("LOGIC E0D - OCD at latest - go to 2");
353
+              //DEBUG_ECHOLNPGM("LOGIC E0D - OCD at latest - go to 2");
354
+              DEBUG_ECHOLNPGM("OCD finalized");
297 355
             }
298 356
           }
299 357
         } break;
300 358
 
301 359
         case 1: {
302
-          if (status_composite & STATUS_OCD) {
360
+          if (status_composite & sh.STATUS_AXIS_OCD) {
303 361
             // phase 1 with OCD warning - increment if can
304
-            if (ocd_th_val >= 15) {
305
-              ocd_th_val = 15;           // limit to max
362
+            if (OCD_TH_val >= sh.AXIS_OCD_TH_MAX) {
363
+              OCD_TH_val = sh.AXIS_OCD_TH_MAX;           // limit to max
306 364
               test_phase = 2;            // at highest value so go to next phase
307
-              DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2");
365
+              //DEBUG_ECHOLNPGM("LOGIC E1A - OCD at max - go to 2");
366
+              DEBUG_ECHOLNPGM("OCD finalized");
308 367
             }
309 368
             else {
310
-              ocd_th_val++;              // try a higher value
311
-              DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD");
369
+              OCD_TH_val++;              // try a higher value
370
+              //DEBUG_ECHOLNPGM("LOGIC E1B - inc OCD");
371
+              DEBUG_ECHOLNPGM("inc OCD");
312 372
             }
313 373
           }
314 374
           else { // phase 1 without OCD warning - normal exit to phase 2
315 375
             test_phase = 2;
316
-            DEBUG_ECHOLNPGM("LOGIC E1C - no OCD warning - go to 1");
376
+            //DEBUG_ECHOLNPGM("LOGIC E1C - no OCD warning - go to 1");
377
+            DEBUG_ECHOLNPGM("OCD finalized");
317 378
           }
318 379
         } break;
319 380
 
320 381
         case 2: {
321
-          if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) {
382
+          if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // skip all STALL_TH steps if L6474
383
+            test_phase = 4;
384
+            break;
385
+          }
386
+          if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) {
322 387
             // phase 2 with stall warning - time to go to next phase
323
-            if (stall_th_val >= 127) {
324
-              stall_th_val = 127;  // limit to max
325
-              DEBUG_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit");
388
+            if (STALL_TH_val >= 127) {
389
+              STALL_TH_val = 127;  // limit to max
390
+              //DEBUG_ECHOLNPGM("LOGIC E2A - STALL warning, STALL at max, quit");
326 391
               DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning");
327 392
               test_phase = 4;
328 393
             }
329 394
             else {
330 395
               test_phase = 3;              // normal exit to next phase (found failing value of STALL)
331
-              stall_th_val++;              // setup for first pass of phase 3
332
-              DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3");
396
+              STALL_TH_val++;              // setup for first pass of phase 3
397
+              //DEBUG_ECHOLNPGM("LOGIC E2B - INC - STALL warning, inc Stall, go to 3");
398
+              DEBUG_ECHOLNPGM("inc Stall");
333 399
             }
334 400
           }
335 401
           else {  // phase 2 without stall warning - decrement if can
336
-            if (stall_th_val) {
337
-              stall_th_val--;              // try a lower value
338
-              DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL");
402
+            if (STALL_TH_val) {
403
+              STALL_TH_val--;              // try a lower value
404
+              //DEBUG_ECHOLNPGM("LOGIC E2C - no STALL, dec STALL");
405
+              DEBUG_ECHOLNPGM("dec STALL");
339 406
             }
340 407
             else {
341 408
               DEBUG_ECHOLNPGM("finished - STALL at lowest value but still do NOT have stall warning");
342 409
               test_phase = 4;
343
-              DEBUG_ECHOLNPGM("LOGIC E2D - no STALL, at lowest so quit");
410
+              //DEBUG_ECHOLNPGM("LOGIC E2D - no STALL, at lowest so quit");
344 411
             }
345 412
           }
346 413
         } break;
347 414
 
348 415
         case 3: {
349
-          if (status_composite & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)) {
416
+          if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // skip all STALL_TH steps if L6474
417
+            test_phase = 4;
418
+            break;
419
+          }
420
+          if (status_composite & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B)) {
350 421
             // phase 3 with stall warning - increment if can
351
-            if (stall_th_val >= 127) {
352
-              stall_th_val = 127; // limit to max
422
+            if (STALL_TH_val >= 127) {
423
+              STALL_TH_val = 127; // limit to max
353 424
               DEBUG_ECHOLNPGM("finished - STALL at maximum value but still have stall warning");
354 425
               test_phase = 4;
355
-              DEBUG_ECHOLNPGM("LOGIC E3A - STALL, at max so quit");
426
+              //DEBUG_ECHOLNPGM("LOGIC E3A - STALL, at max so quit");
356 427
             }
357 428
             else {
358
-              stall_th_val++;              // still looking for passing value
359
-              DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall");
429
+              STALL_TH_val++;              // still looking for passing value
430
+              //DEBUG_ECHOLNPGM("LOGIC E3B - STALL, inc stall");
431
+              DEBUG_ECHOLNPGM("inc stall");
360 432
             }
361 433
           }
362 434
           else {  //phase 3 without stall warning  but have OCD warning
363 435
             DEBUG_ECHOLNPGM("Hardware problem - OCD warning without STALL warning");
364 436
             test_phase = 4;
365
-            DEBUG_ECHOLNPGM("LOGIC E3C - not STALLED, hardware problem (quit)");
437
+            //DEBUG_ECHOLNPGM("LOGIC E3C - not STALLED, hardware problem (quit)");
366 438
           }
367 439
         } break;
368 440
 
@@ -372,58 +444,81 @@ void GcodeSuite::M917() {
372 444
     else {
373 445
       switch (test_phase) {
374 446
         case 0: { // phase 0 without OCD warning - keep on decrementing if can
375
-          if (ocd_th_val) {
376
-            ocd_th_val--;             // try lower value
377
-            DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD");
447
+          if (OCD_TH_val) {
448
+            OCD_TH_val--;             // try lower value
449
+            //DEBUG_ECHOLNPGM("LOGIC N0A - DEC OCD");
450
+            DEBUG_ECHOLNPGM("DEC OCD");
378 451
           }
379 452
           else {
380 453
             test_phase = 2;           // at lowest value without warning so skip phase 1
381
-            DEBUG_ECHOLNPGM("LOGIC N0B - OCD at lowest (go to phase 2)");
454
+            //DEBUG_ECHOLNPGM("LOGIC N0B - OCD at lowest (go to phase 2)");
455
+            DEBUG_ECHOLNPGM("OCD finalized");
382 456
           }
383 457
         } break;
384 458
 
385
-        case 1: DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2
459
+        case 1: //DEBUG_ECHOLNPGM("LOGIC N1 (go directly to 2)"); // phase 1 without OCD warning - drop directly to phase 2
460
+                DEBUG_ECHOLNPGM("OCD finalized");
386 461
 
387 462
         case 2: { // phase 2 without stall warning - keep on decrementing if can
388
-          if (stall_th_val) {
389
-            stall_th_val--;              // try a lower value (stay in phase 2)
390
-            DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL");
463
+          if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // skip all STALL_TH steps if L6474
464
+            test_phase = 4;
465
+            break;
466
+          }
467
+          if (STALL_TH_val) {
468
+            STALL_TH_val--;              // try a lower value (stay in phase 2)
469
+            //DEBUG_ECHOLNPGM("LOGIC N2B - dec STALL");
470
+            DEBUG_ECHOLNPGM("dec STALL");
391 471
           }
392 472
           else {
393 473
             DEBUG_ECHOLNPGM("finished - STALL at lowest value but still no stall warning");
394 474
             test_phase = 4;
395
-            DEBUG_ECHOLNPGM("LOGIC N2C - STALL at lowest (quit)");
475
+            //DEBUG_ECHOLNPGM("LOGIC N2C - STALL at lowest (quit)");
396 476
           }
397 477
         } break;
398 478
 
399
-        case 3: { test_phase = 4;
400
-           DEBUG_ECHOLNPGM("LOGIC N3 - finished!");
479
+        case 3: {
480
+          if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // skip all STALL_TH steps if L6474
481
+            test_phase = 4;
482
+            break;
483
+          }
484
+          test_phase = 4;
485
+           //DEBUG_ECHOLNPGM("LOGIC N3 - finished!");
486
+           DEBUG_ECHOLNPGM("finished!");
401 487
         } break;  // phase 3 without any warnings - desired exit
402 488
       }  //
403 489
     }  // end of status checks
404 490
 
405 491
     if (test_phase != 4) {
406 492
       for (j = 0; j < driver_count; j++) {                       // update threshold(s)
407
-        L6470.set_param(axis_index[j], L6470_OCD_TH, ocd_th_val);
408
-        L6470.set_param(axis_index[j], L6470_STALL_TH, stall_th_val);
409
-        if (L6470.get_param(axis_index[j], L6470_OCD_TH) != ocd_th_val) DEBUG_ECHOLNPGM("OCD mismatch");
410
-        if (L6470.get_param(axis_index[j], L6470_STALL_TH) != stall_th_val) DEBUG_ECHOLNPGM("STALL mismatch");
493
+        L64xxManager.set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val);
494
+        if (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT) L64xxManager.set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val);
495
+        if (L64xxManager.get_param(axis_index[j], L6470_OCD_TH) != OCD_TH_val) DEBUG_ECHOLNPGM("OCD mismatch");
496
+        if ((L64xxManager.get_param(axis_index[j], L6470_STALL_TH) != STALL_TH_val) && (sh.STATUS_AXIS_LAYOUT != L6474_STATUS_LAYOUT)) DEBUG_ECHOLNPGM("STALL mismatch");
411 497
       }
412 498
     }
413 499
 
414 500
   } while (test_phase != 4);
415 501
 
502
+  DEBUG_ECHOLNPGM(".");
416 503
   if (status_composite) {
504
+    #if ENABLED(L6470_CHITCHAT)
505
+      for (j = 0; j < driver_count; j++) {
506
+        if (j) DEBUG_ECHOPGM("...");
507
+        L64xxManager.error_status_decode(axis_status[j], axis_index[j],
508
+          sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN,
509
+          sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B,
510
+          sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT);
511
+      }
512
+      DEBUG_ECHOLNPGM(".");
513
+    #endif
417 514
     DEBUG_ECHOLNPGM("Completed with errors");
418
-    for (j = 0; j < driver_count; j++) {
419
-      DEBUG_ECHOPGM("...");
420
-      L6470.error_status_decode(axis_status[j], axis_index[j]);
421
-    }
422 515
   }
423 516
   else
424 517
     DEBUG_ECHOLNPGM("Completed with no errors");
518
+  DEBUG_ECHOLNPGM(".");
425 519
 
426
-} // M917
520
+  L64xxManager.pause_monitor(false);
521
+}
427 522
 
428 523
 /**
429 524
  *
@@ -439,7 +534,13 @@ void GcodeSuite::M917() {
439 534
  * I - over current threshold
440 535
  *     optional - will report current value from driver if not specified
441 536
  *
442
- * K - value for KVAL_HOLD (0 - 255) (optional)
537
+ * T - current (mA) setting for TVAL (0 - 4A in 31.25mA increments, rounds down) - L6474 only
538
+ *     optional - will report current value from driver if not specified
539
+ *
540
+ * K - value for KVAL_HOLD (0 - 255) (ignored for L6474)
541
+ *     optional - will report current value from driver if not specified
542
+ *
543
+ * M - value for microsteps (1 - 128) (optional)
443 544
  *     optional - will report current value from driver if not specified
444 545
  *
445 546
  */
@@ -447,83 +548,109 @@ void GcodeSuite::M918() {
447 548
 
448 549
   DEBUG_ECHOLNPGM("M918");
449 550
 
450
-  char axis_mon[3][3] = { "  ", "  ", "  " };  // List of axes to monitor
451
-  uint8_t axis_index[3];
551
+  L64xxManager.pause_monitor(true); // Keep monitor_driver() from stealing status
552
+
553
+  char axis_mon[3][3] = { {"  "}, {"  "}, {"  "} };   // list of Axes to be monitored
554
+  L64XX_axis_t axis_index[3];
452 555
   uint16_t axis_status[3];
453 556
   uint8_t driver_count = 1;
454 557
   float position_max, position_min;
455
-  feedRate_t final_fr_mm_m;
558
+  float final_feedrate;
456 559
   uint8_t kval_hold;
457
-  uint8_t ocd_th_val = 0;
458
-  uint8_t stall_th_val = 0;
560
+  uint8_t OCD_TH_val = 0;
561
+  uint8_t STALL_TH_val = 0;
459 562
   uint16_t over_current_threshold;
460
-  constexpr bool over_current_flag = true;
563
+  constexpr uint8_t over_current_flag = true;
564
+
565
+  const L64XX_Marlin::L64XX_shadow_t &sh = L64xxManager.shadow;
461 566
 
462 567
   uint8_t j;   // general purpose counter
463 568
 
464
-  if (L6470.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_fr_mm_m, kval_hold, over_current_flag, ocd_th_val, stall_th_val, over_current_threshold))
569
+  if (L64xxManager.get_user_input(driver_count, axis_index, axis_mon, position_max, position_min, final_feedrate, kval_hold, over_current_flag, OCD_TH_val, STALL_TH_val, over_current_threshold))
465 570
     return;  // quit if invalid user input
466 571
 
572
+  L64xxManager.get_status(axis_index[0]); // populate shadow array
573
+
467 574
   uint8_t m_steps = parser.byteval('M');
468
-  LIMIT(m_steps, 0, 128);
469
-  DEBUG_ECHOLNPAIR("M = ", m_steps);
470
-
471
-  int8_t m_bits = -1;
472
-       if (m_steps > 85) m_bits = 7;  // 128 (no synch output)
473
-  else if (m_steps > 42) m_bits = 6;  //  64 (no synch output)
474
-  else if (m_steps > 22) m_bits = 5;  //  32 (no synch output)
475
-  else if (m_steps > 12) m_bits = 4;  //  16 (no synch output)
476
-  else if (m_steps >  5) m_bits = 3;  //   8 (no synch output)
477
-  else if (m_steps >  2) m_bits = 2;  //   4 (no synch output)
478
-  else if (m_steps == 2) m_bits = 1;  //   2 (no synch output)
479
-  else if (m_steps == 1) m_bits = 0;  //   1 (no synch output)
480
-  else if (m_steps == 0) m_bits = 7;  // 128 (no synch output)
481
-
482
-  if (m_bits >= 0) {
483
-    const int micros = _BV(m_bits);
484
-    if (micros < 100) { DEBUG_CHAR(' '); if (micros < 10) DEBUG_CHAR(' '); }
485
-    DEBUG_ECHO(micros);
486
-    DEBUG_ECHOPGM(" uSTEPS");
575
+
576
+  if (m_steps != 0) {
577
+    LIMIT(m_steps, 1, sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT ? 16 : 128);  // L6474
578
+
579
+    uint8_t stepVal;
580
+    for (stepVal = 0; stepVal < 8; stepVal++) {  // convert to L64xx register value
581
+      if (m_steps == 1) break;
582
+      m_steps >>= 1;
583
+    }
584
+
585
+    if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)
586
+      stepVal |= 0x98;  // NO SYNC
587
+    else
588
+      stepVal |= (!SYNC_EN) | SYNC_SEL_1 | stepVal;
589
+
590
+    for (j = 0; j < driver_count; j++) {
591
+      L64xxManager.set_param(axis_index[j], dSPIN_HARD_HIZ, 0);          // can't write STEP register if stepper being powered
592
+                                                                         //   results in an extra NOOP being sent (data 00)
593
+      L64xxManager.set_param(axis_index[j], L6470_STEP_MODE, stepVal);   // set microsteps
594
+    }
487 595
   }
596
+  m_steps = L64xxManager.get_param(axis_index[0], L6470_STEP_MODE) & 0x07;   // get microsteps
488 597
 
489
-  for (j = 0; j < driver_count; j++)
490
-    L6470.set_param(axis_index[j], L6470_STEP_MODE, m_bits);   // set microsteps
598
+  DEBUG_ECHOLNPAIR("Microsteps = ", _BV(m_steps));
599
+  DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_feedrate);
491 600
 
492
-  DEBUG_ECHOLNPAIR("target (maximum) feedrate = ", final_fr_mm_m);
601
+  const float feedrate_inc = final_feedrate / 10,   // Start at 1/10 of max & go up by 1/10 per step
602
+              fr_limit = final_feedrate * 0.99f;    // Rounding-safe comparison value
603
+  float current_feedrate = 0;
493 604
 
494
-  planner.synchronize();                  // Wait for moves to finish
605
+  planner.synchronize();                            // Wait for moves to complete
495 606
 
496 607
   for (j = 0; j < driver_count; j++)
497
-    L6470.get_status(axis_index[j]);      // Clear all error flags
608
+    L64xxManager.get_status(axis_index[j]);         // Clear error flags
498 609
 
610
+  char temp_axis_string[2] = " ";
611
+  temp_axis_string[0] = axis_mon[0][0];             // Need a sprintf format string
612
+  //temp_axis_string[1] = '\n';
613
+
614
+  char gcode_string[80];
499 615
   uint16_t status_composite = 0;
500
-  DEBUG_ECHOLNPGM(".\n.\n.");             // Make the feedrate prints easier to see
616
+  DEBUG_ECHOLNPGM(".\n.\n.");                       // Make feedrate outputs easier to read
617
+
618
+  do {
619
+    current_feedrate += feedrate_inc;
620
+    DEBUG_ECHOLNPAIR("...feedrate = ", current_feedrate);
501 621
 
502
-  constexpr uint8_t iterations = 10;
503
-  for (uint8_t i = 1; i <= iterations; i++) {
504
-    const feedRate_t fr_mm_m = i * final_fr_mm_m / iterations;
505
-    DEBUG_ECHOLNPAIR("...feedrate = ", fr_mm_m);
622
+    sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_min), uint16_t(current_feedrate));
623
+    gcode.process_subcommands_now_P(gcode_string);
506 624
 
507
-    jiggle_axis(axis_mon[0][0], position_min, position_max, fr_mm_m);
625
+    sprintf_P(gcode_string, PSTR("G0 %s%03d F%03d"), temp_axis_string, uint16_t(position_max), uint16_t(current_feedrate));
626
+    gcode.process_subcommands_now_P(gcode_string);
627
+
628
+    planner.synchronize();
508 629
 
509 630
     for (j = 0; j < driver_count; j++) {
510
-      axis_status[j] = (~L6470.get_status(axis_index[j])) & 0x0800;    // bits of interest are all active low
631
+      axis_status[j] = (~L64xxManager.get_status(axis_index[j])) & 0x0800;  // Bits of interest are all active LOW
511 632
       status_composite |= axis_status[j];
512 633
     }
513
-    if (status_composite) break;       // quit if any errors flags are raised
514
-  }
634
+    if (status_composite) break;              // Break on any error
635
+  } while (current_feedrate < fr_limit);
515 636
 
516
-  DEBUG_ECHOPGM("Completed with errors");
637
+  DEBUG_ECHOPGM("Completed with ");
517 638
   if (status_composite) {
518 639
     DEBUG_ECHOLNPGM("errors");
519
-    for (j = 0; j < driver_count; j++) {
520
-      DEBUG_ECHOPGM("...");
521
-      L6470.error_status_decode(axis_status[j], axis_index[j]);
522
-    }
640
+    #if ENABLED(L6470_CHITCHAT)
641
+      for (j = 0; j < driver_count; j++) {
642
+        if (j) DEBUG_ECHOPGM("...");
643
+        L64xxManager.error_status_decode(axis_status[j], axis_index[j],
644
+          sh.STATUS_AXIS_TH_SD, sh.STATUS_AXIS_TH_WRN,
645
+          sh.STATUS_AXIS_STEP_LOSS_A, sh.STATUS_AXIS_STEP_LOSS_B,
646
+          sh.STATUS_AXIS_OCD, sh.STATUS_AXIS_LAYOUT);
647
+      }
648
+    #endif
523 649
   }
524 650
   else
525 651
     DEBUG_ECHOLNPGM("no errors");
526 652
 
527
-} // M918
653
+  L64xxManager.pause_monitor(false);
654
+}
528 655
 
529
-#endif // HAS_DRIVER(L6470)
656
+#endif // HAS_L64XX

+ 1
- 1
Marlin/src/gcode/gcode.cpp View File

@@ -786,7 +786,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
786 786
         #endif
787 787
       #endif
788 788
 
789
-      #if HAS_DRIVER(L6470)
789
+      #if HAS_L64XX
790 790
         case 122: M122(); break;                                   // M122: Report status
791 791
         case 906: M906(); break;                                   // M906: Set or get motor drive level
792 792
         case 916: M916(); break;                                   // M916: L6470 tuning: Increase drive level until thermal warning

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -896,7 +896,7 @@ private:
896 896
     #endif
897 897
   #endif
898 898
 
899
-  #if HAS_DRIVER(L6470)
899
+  #if HAS_L64XX
900 900
     static void M122();
901 901
     static void M906();
902 902
     static void M916();

+ 18
- 20
Marlin/src/gcode/host/M114.cpp View File

@@ -28,10 +28,8 @@
28 28
 
29 29
 #if ENABLED(M114_DETAIL)
30 30
 
31
-  #if HAS_DRIVER(L6470)
32
-    //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\gcode\host\M114.cpp
33
-    //C:\Users\bobku\Documents\GitHub\Marlin-Bob-2\Marlin\src\module\bob_L6470.cpp
34
-    #include "../../libs/L6470/L6470_Marlin.h"
31
+  #if HAS_L64XX
32
+    #include "../../libs/L64XX/L64XX_Marlin.h"
35 33
     #define DEBUG_OUT ENABLED(L6470_CHITCHAT)
36 34
     #include "../../core/debug_out.h"
37 35
   #endif
@@ -88,13 +86,13 @@
88 86
 
89 87
     planner.synchronize();
90 88
 
91
-    #if HAS_DRIVER(L6470)
89
+    #if HAS_L64XX
92 90
       char temp_buf[80];
93 91
       int32_t temp;
94 92
       //#define ABS_POS_SIGN_MASK 0b1111 1111 1110 0000 0000 0000 0000 0000
95 93
       #define ABS_POS_SIGN_MASK 0b11111111111000000000000000000000
96 94
       #define REPORT_ABSOLUTE_POS(Q) do{                            \
97
-          L6470.say_axis(Q, false);                                 \
95
+          L64xxManager.say_axis(Q, false);                          \
98 96
           temp = L6470_GETPARAM(L6470_ABS_POS,Q);                   \
99 97
           if (temp & ABS_POS_SIGN_MASK) temp |= ABS_POS_SIGN_MASK;  \
100 98
           sprintf_P(temp_buf, PSTR(":%8ld   "), temp);              \
@@ -102,47 +100,47 @@
102 100
         }while(0)
103 101
 
104 102
       DEBUG_ECHOPGM("\nL6470:");
105
-      #if AXIS_DRIVER_TYPE_X(L6470)
103
+      #if AXIS_IS_L64XX(X)
106 104
         REPORT_ABSOLUTE_POS(X);
107 105
       #endif
108
-      #if AXIS_DRIVER_TYPE_X2(L6470)
106
+      #if AXIS_IS_L64XX(X2)
109 107
         REPORT_ABSOLUTE_POS(X2);
110 108
       #endif
111
-      #if AXIS_DRIVER_TYPE_Y(L6470)
109
+      #if AXIS_IS_L64XX(Y)
112 110
         REPORT_ABSOLUTE_POS(Y);
113 111
       #endif
114
-      #if AXIS_DRIVER_TYPE_Y2(L6470)
112
+      #if AXIS_IS_L64XX(Y2)
115 113
         REPORT_ABSOLUTE_POS(Y2);
116 114
       #endif
117
-      #if AXIS_DRIVER_TYPE_Z(L6470)
115
+      #if AXIS_IS_L64XX(Z)
118 116
         REPORT_ABSOLUTE_POS(Z);
119 117
       #endif
120
-      #if AXIS_DRIVER_TYPE_Z2(L6470)
118
+      #if AXIS_IS_L64XX(Z2)
121 119
         REPORT_ABSOLUTE_POS(Z2);
122 120
       #endif
123
-      #if AXIS_DRIVER_TYPE_Z3(L6470)
121
+      #if AXIS_IS_L64XX(Z3)
124 122
         REPORT_ABSOLUTE_POS(Z3);
125 123
       #endif
126
-      #if AXIS_DRIVER_TYPE_E0(L6470)
124
+      #if AXIS_IS_L64XX(E0)
127 125
         REPORT_ABSOLUTE_POS(E0);
128 126
       #endif
129
-      #if AXIS_DRIVER_TYPE_E1(L6470)
127
+      #if AXIS_IS_L64XX(E1)
130 128
         REPORT_ABSOLUTE_POS(E1);
131 129
       #endif
132
-      #if AXIS_DRIVER_TYPE_E2(L6470)
130
+      #if AXIS_IS_L64XX(E2)
133 131
         REPORT_ABSOLUTE_POS(E2);
134 132
       #endif
135
-      #if AXIS_DRIVER_TYPE_E3(L6470)
133
+      #if AXIS_IS_L64XX(E3)
136 134
         REPORT_ABSOLUTE_POS(E3);
137 135
       #endif
138
-      #if AXIS_DRIVER_TYPE_E4(L6470)
136
+      #if AXIS_IS_L64XX(E4)
139 137
         REPORT_ABSOLUTE_POS(E4);
140 138
       #endif
141
-      #if AXIS_DRIVER_TYPE_E5(L6470)
139
+      #if AXIS_IS_L64XX(E5)
142 140
         REPORT_ABSOLUTE_POS(E5);
143 141
       #endif
144 142
       SERIAL_EOL();
145
-    #endif // HAS_DRIVER(L6470)
143
+    #endif // HAS_L64XX
146 144
 
147 145
     SERIAL_ECHOPGM("Stepper:");
148 146
     LOOP_XYZE(i) {

+ 1
- 1
Marlin/src/inc/SanityCheck.h View File

@@ -2145,7 +2145,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
2145 2145
   #error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
2146 2146
 #endif
2147 2147
 
2148
-#define IN_CHAIN(A) (A##_CHAIN_POS > 0)
2148
+#define IN_CHAIN(A) ((A##_CHAIN_POS > 0) && !HAS_L64XX)
2149 2149
 // TMC SPI Chaining
2150 2150
 #if IN_CHAIN(X) || IN_CHAIN(Y) || IN_CHAIN(Z) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5)
2151 2151
   #if  (IN_CHAIN(X)  && !PIN_EXISTS(X_CS) ) || (IN_CHAIN(Y)  && !PIN_EXISTS(Y_CS) ) \

+ 0
- 105
Marlin/src/libs/L6470/000_l6470_read_me.md View File

@@ -1,105 +0,0 @@
1
-Arduino-6470 library revision 0.7.0 or above is required.
2
-
3
-This software can be used with any L647x chip and the powerSTEP01. L647x and powerSTEP01 devices can not be mixed within a system. A flag in the library must be set to enable use of a powerSTEP01.
4
-
5
-These devices use voltage PWMs to drive the stepper phases. Phase current is not directly controlled. Each microstep corresponds to a particular PWM duty cycle. The KVAL\_HOLD register scales the PWM duty cycle.
6
-
7
-This software assumes that all L6470 drivers are in one SPI daisy chain.
8
-
9
-```
10
-    The hardware setup is:
11
-
12
-      MOSI from controller tied to SDI on the first device
13
-
14
-      SDO of the first device is tied to SDI of the next device
15
-
16
-      SDO of the last device is tied to MISO of the controller
17
-
18
-      all devices share the same SCK, SS\_PIN and RESET\_PIN
19
-
20
-      Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay).
21
-
22
-      Each L6470 acts on the **last** SPI data it saw when the SS\_PIN **goes high**.
23
-```
24
-
25
-The L6470 drivers operate in STEP\_CLOCK mode. In this mode the direction and enable are done via SPI commands and the phase currents are changed in response to step pulses (generated in the usual way).
26
-
27
-There are two different SPI routines used.
28
-
29
--   **uint8\_t** L6470\_Transfer(uint8\_t data, int \_SSPin, const uint8\_t chain\_position) is used to setup the chips and by the maintenance/status code. This code uses the Arduino-6470 library.
30
-
31
--   **void** L6470\_Transfer(uint8\_t L6470\_buf[], const uint8\_t length) is used by the set\_directions() routine to send the direction/enable commands. The library is NOT used by this code.
32
-
33
-**HARDWARE/SOFTWARE interaction**
34
-
35
-Powering up a stepper and setting the direction are done by the same command. Can't do one without the other.
36
-
37
-**All** directions are set **every time** a new block is popped off the queue by the stepper ISR.
38
-
39
-SPI transfers, when setting the directions, are minimized by using arrays and a SPI routine dedicated to this function. L6470 library calls are not used. For N L6470 drivers, this results in a N byte transfer. If library calls were used then N\*N bytes would be sent.
40
-
41
-**Power up (reset) sequence:**
42
-
43
-1.  Stepper objects are created before the **setup()** entry point is reached.
44
-
45
-2.  After the **setup()** entry point is reached and before the steppers are initialized, L6470\_init() is called to do the following
46
-
47
-3.  If present, the hardware reset is pulsed.
48
-
49
-4.  The L6470\_chain array is populated during **setup()**. This array is used to tell where in the SPI stream the commands/data for an stepper is positioned.
50
-
51
-5.  The L6470 soft SPI pins are initialized.
52
-
53
-6.  The L6470 chips are initialized during **setup()**. They can be re-initialized using the **L6470\_init\_to\_defaults()** function
54
-
55
-The steppers are **NOT** powered up during this sequence.
56
-
57
-**L6470\_chain** array
58
-
59
-This array is used by all routines that transmit SPI data.
60
-
61
-```
62
-  Location 0 - number of drivers in chain
63
-
64
-  Location 1 - axis index for first device in the chain (closest to MOSI)
65
-
66
-  ...
67
-
68
-  Location N - axis index for last device in the N device long chain (closest to MISO)
69
-```
70
-
71
-**Direction set and enable**
72
-
73
-The DIR\_WRITE macros for the L6470 drivers are written so that the standard X, Y, Z and extruder logic used by the set\_directions() routine is not altered. These macros write the correct forward/reverse command to the corresponding location in the array *L6470\_dir\_commands*.
74
-
75
-At the end of the set\_directions() routine, the array *L6470\_chain* is used to grab the corresponding direction/enable commands out of the array *L6470\_dir\_commands* and put them in the correct sequence in the array *L6470\_buf*. Array *L6470\_buf* is then passed to the **void** L6470\_Transfer function which actually sends the data to the devices.
76
-
77
-**Utilities and misc**
78
-
79
-The **absolute position** registers should accurately reflect Marlin’s stepper position counts. They are set to zero during initialization. G28 sets them to the Marlin counts for the corresponding axis after homing. NOTE – these registers are often the negative of the Marlin counts. This is because the Marlin counts reflect the logical direction while the registers reflect the stepper direction. The register contents are displayed via the M114 D command.
80
-
81
-The **L6470\_monitor** feature reads the status of each device every half second. It will report if there are any error conditions present or if communications has been lost/restored. The KVAL\_HOLD value is reduced every 2 – 2.5 seconds if the thermal warning or thermal shutdown conditions are present.
82
-
83
-**M122** displays the settings of most of the bits in the status register plus a couple of other items.
84
-
85
-**M906** can be used to set the KVAL\_HOLD register one driver at a time. If a setting is not included with the command then the contents of the registers that affect the phase current/voltage are displayed.
86
-
87
-**M916, M917 & M918**
88
-
89
-These utilities are used to tune the system. They can get you in the ballpark for acceptable jerk, acceleration, top speed and KVAL\_HOLD settings. In general they seem to provide an overly optimistic KVAL\_HOLD setting because of the lag between setting KVAL\_HOLD and the driver reaching final temperature. Enabling the **L6470\_monitor** feature during prints will provide the **final useful KVAL\_HOLD setting**.
90
-
91
-The amount of power needed to move the stepper without skipping steps increases as jerk, acceleration and top speed increase. The power dissipated by the driver increases as the power to the stepper increases. The net result is a balancing act between jerk, acceleration, top speed and power dissipated by the driver.
92
-
93
-**M916 -** Increases KVAL\_HOLD while moving one axis until get thermal warning. This routine is also useful for determining the approximate KVAL\_HOLD where the stepper stops losing steps. The sound will get noticeably quieter as it stops losing steps.
94
-
95
-**M917 -** Find minimum current thresholds. This is done by doing the following steps while moving an axis:
96
-
97
-1.  Decrease OCD current until overcurrent error
98
-
99
-2.  Increase OCD until overcurrent error goes away
100
-
101
-3.  Decrease stall threshold until stall error
102
-
103
-4.  Increase stall until stall error goes away
104
-
105
-**M918 -** Increase speed until error or max feedrate achieved.

+ 0
- 793
Marlin/src/libs/L6470/L6470_Marlin.cpp View File

@@ -1,793 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * The monitor_driver routines are a close copy of the TMC code
25
- */
26
-
27
-#include "../../inc/MarlinConfig.h"
28
-
29
-#if HAS_DRIVER(L6470)
30
-
31
-#include "L6470_Marlin.h"
32
-
33
-L6470_Marlin L6470;
34
-
35
-#include "../../module/stepper/indirection.h"
36
-#include "../../module/planner.h"
37
-#include "../../gcode/gcode.h"
38
-
39
-#define DEBUG_OUT ENABLED(L6470_CHITCHAT)
40
-#include "../../core/debug_out.h"
41
-
42
-uint8_t L6470_Marlin::dir_commands[MAX_L6470];  // array to hold direction command for each driver
43
-
44
-char L6470_Marlin::index_to_axis[MAX_L6470][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" };
45
-
46
-bool L6470_Marlin::index_to_dir[MAX_L6470] =  {
47
-  INVERT_X_DIR                        ,  // 0 X
48
-  INVERT_Y_DIR                        ,  // 1 Y
49
-  INVERT_Z_DIR                        ,  // 2 Z
50
-  #if ENABLED(X_DUAL_STEPPER_DRIVERS)
51
-    INVERT_X_DIR ^ INVERT_X2_VS_X_DIR ,  // 3 X2
52
-  #else
53
-    INVERT_X_DIR                      ,  // 3 X2
54
-  #endif
55
-  #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
56
-    INVERT_Y_DIR ^ INVERT_Y2_VS_Y_DIR ,  // 4 Y2
57
-  #else
58
-    INVERT_Y_DIR                      ,  // 4 Y2
59
-  #endif
60
-  INVERT_Z_DIR                        ,  // 5 Z2
61
-  INVERT_Z_DIR                        ,  // 6 Z3
62
-  INVERT_E0_DIR                       ,  // 7 E0
63
-  INVERT_E1_DIR                       ,  // 8 E1
64
-  INVERT_E2_DIR                       ,  // 9 E2
65
-  INVERT_E3_DIR                       ,  //10 E3
66
-  INVERT_E4_DIR                       ,  //11 E4
67
-  INVERT_E5_DIR                       ,  //12 E5
68
-};
69
-
70
-uint8_t L6470_Marlin::axis_xref[MAX_L6470] = {
71
-  AxisEnum(X_AXIS), // X
72
-  AxisEnum(Y_AXIS), // Y
73
-  AxisEnum(Z_AXIS), // Z
74
-  AxisEnum(X_AXIS), // X2
75
-  AxisEnum(Y_AXIS), // Y2
76
-  AxisEnum(Z_AXIS), // Z2
77
-  AxisEnum(Z_AXIS), // Z3
78
-  AxisEnum(E_AXIS), // E0
79
-  AxisEnum(E_AXIS), // E1
80
-  AxisEnum(E_AXIS), // E2
81
-  AxisEnum(E_AXIS), // E3
82
-  AxisEnum(E_AXIS), // E4
83
-  AxisEnum(E_AXIS)  // E5
84
-};
85
-
86
-volatile bool L6470_Marlin::spi_abort = false;
87
-bool L6470_Marlin::spi_active = false;
88
-
89
-void L6470_Marlin::populate_chain_array() {
90
-
91
-  #define _L6470_INIT_SPI(Q)  do{ stepper##Q.set_chain_info(Q, Q##_CHAIN_POS); }while(0)
92
-
93
-  #if AXIS_DRIVER_TYPE_X(L6470)
94
-    _L6470_INIT_SPI(X);
95
-  #endif
96
-  #if AXIS_DRIVER_TYPE_X2(L6470)
97
-    _L6470_INIT_SPI(X2);
98
-  #endif
99
-  #if AXIS_DRIVER_TYPE_Y(L6470)
100
-    _L6470_INIT_SPI(Y);
101
-  #endif
102
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
103
-    _L6470_INIT_SPI(Y2);
104
-  #endif
105
-  #if AXIS_DRIVER_TYPE_Z(L6470)
106
-    _L6470_INIT_SPI(Z);
107
-  #endif
108
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
109
-    _L6470_INIT_SPI(Z2);
110
-  #endif
111
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
112
-    _L6470_INIT_SPI(Z3);
113
-  #endif
114
-  #if AXIS_DRIVER_TYPE_E0(L6470)
115
-    _L6470_INIT_SPI(E0);
116
-  #endif
117
-  #if AXIS_DRIVER_TYPE_E1(L6470)
118
-    _L6470_INIT_SPI(E1);
119
-  #endif
120
-  #if AXIS_DRIVER_TYPE_E2(L6470)
121
-    _L6470_INIT_SPI(E2);
122
-  #endif
123
-  #if AXIS_DRIVER_TYPE_E3(L6470)
124
-    _L6470_INIT_SPI(E3);
125
-  #endif
126
-  #if AXIS_DRIVER_TYPE_E4(L6470)
127
-    _L6470_INIT_SPI(E4);
128
-  #endif
129
-  #if AXIS_DRIVER_TYPE_E5(L6470)
130
-    _L6470_INIT_SPI(E5);
131
-  #endif
132
-}
133
-
134
-void L6470_Marlin::init() {               // Set up SPI and then init chips
135
-  #if PIN_EXISTS(L6470_RESET_CHAIN)
136
-    OUT_WRITE(L6470_RESET_CHAIN_PIN, LOW);  // hardware reset of drivers
137
-    delay(1);
138
-    OUT_WRITE(L6470_RESET_CHAIN_PIN, HIGH);
139
-    delay(1);                     // need about 650uS for the chip to fully start up
140
-  #endif
141
-  populate_chain_array();   // Set up array to control where in the SPI transfer sequence a particular stepper's data goes
142
-  L6470_spi_init();               // Set up L6470 soft SPI pins
143
-  init_to_defaults();             // init the chips
144
-}
145
-
146
-uint16_t L6470_Marlin::get_status(const uint8_t axis) {
147
-
148
-  #define GET_L6470_STATUS(Q) stepper##Q.getStatus()
149
-
150
-  switch (axis) {
151
-    #if AXIS_DRIVER_TYPE_X(L6470)
152
-      case  0: return GET_L6470_STATUS(X);
153
-    #endif
154
-    #if AXIS_DRIVER_TYPE_Y(L6470)
155
-      case  1: return GET_L6470_STATUS(Y);
156
-    #endif
157
-    #if AXIS_DRIVER_TYPE_Z(L6470)
158
-      case  2: return GET_L6470_STATUS(Z);
159
-    #endif
160
-    #if AXIS_DRIVER_TYPE_X2(L6470)
161
-      case  3: return GET_L6470_STATUS(X2);
162
-    #endif
163
-    #if AXIS_DRIVER_TYPE_Y2(L6470)
164
-      case  4: return GET_L6470_STATUS(Y2);
165
-    #endif
166
-    #if AXIS_DRIVER_TYPE_Z2(L6470)
167
-      case  5: return GET_L6470_STATUS(Z2);
168
-    #endif
169
-    #if AXIS_DRIVER_TYPE_Z3(L6470)
170
-      case  6: return GET_L6470_STATUS(Z3);
171
-    #endif
172
-    #if AXIS_DRIVER_TYPE_E0(L6470)
173
-      case  7: return GET_L6470_STATUS(E0);
174
-    #endif
175
-    #if AXIS_DRIVER_TYPE_E1(L6470)
176
-      case  8: return GET_L6470_STATUS(E1);
177
-    #endif
178
-    #if AXIS_DRIVER_TYPE_E2(L6470)
179
-      case  9: return GET_L6470_STATUS(E2);
180
-    #endif
181
-    #if AXIS_DRIVER_TYPE_E3(L6470)
182
-      case 10: return GET_L6470_STATUS(E3);
183
-    #endif
184
-    #if AXIS_DRIVER_TYPE_E4(L6470)
185
-      case 11: return GET_L6470_STATUS(E4);
186
-    #endif
187
-    #if AXIS_DRIVER_TYPE_E5(L6470)
188
-      case 12: return GET_L6470_STATUS(E5);
189
-    #endif
190
-  }
191
-
192
-  return 0; // Not needed but kills a compiler warning
193
-}
194
-
195
-uint32_t L6470_Marlin::get_param(uint8_t axis, uint8_t param) {
196
-
197
-  #define GET_L6470_PARAM(Q) L6470_GETPARAM(param,Q)
198
-
199
-  switch (axis) {
200
-    #if AXIS_DRIVER_TYPE_X(L6470)
201
-      case  0: return GET_L6470_PARAM(X);
202
-    #endif
203
-    #if AXIS_DRIVER_TYPE_Y(L6470)
204
-      case  1: return GET_L6470_PARAM(Y);
205
-    #endif
206
-    #if AXIS_DRIVER_TYPE_Z(L6470)
207
-      case  2: return GET_L6470_PARAM(Z);
208
-    #endif
209
-    #if AXIS_DRIVER_TYPE_X2(L6470)
210
-      case  3: return GET_L6470_PARAM(X2);
211
-    #endif
212
-    #if AXIS_DRIVER_TYPE_Y2(L6470)
213
-      case  4: return GET_L6470_PARAM(Y2);
214
-    #endif
215
-    #if AXIS_DRIVER_TYPE_Z2(L6470)
216
-      case  5: return GET_L6470_PARAM(Z2);
217
-    #endif
218
-    #if AXIS_DRIVER_TYPE_Z3(L6470)
219
-      case  6: return GET_L6470_PARAM(Z3);
220
-    #endif
221
-    #if AXIS_DRIVER_TYPE_E0(L6470)
222
-      case  7: return GET_L6470_PARAM(E0);
223
-    #endif
224
-    #if AXIS_DRIVER_TYPE_E1(L6470)
225
-      case  8: return GET_L6470_PARAM(E1);
226
-    #endif
227
-    #if AXIS_DRIVER_TYPE_E2(L6470)
228
-      case  9: return GET_L6470_PARAM(E2);
229
-    #endif
230
-    #if AXIS_DRIVER_TYPE_E3(L6470)
231
-      case 10: return GET_L6470_PARAM(E3);
232
-    #endif
233
-    #if AXIS_DRIVER_TYPE_E4(L6470)
234
-      case 11: return GET_L6470_PARAM(E4);
235
-    #endif
236
-    #if AXIS_DRIVER_TYPE_E5(L6470)
237
-      case 12: return GET_L6470_PARAM(E5);
238
-    #endif
239
-  }
240
-
241
-  return 0 ; // not needed but kills a compiler warning
242
-}
243
-
244
-void L6470_Marlin::set_param(uint8_t axis, uint8_t param, uint32_t value) {
245
-
246
-  #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value)
247
-
248
-  switch (axis) {
249
-    #if AXIS_DRIVER_TYPE_X(L6470)
250
-      case  0: SET_L6470_PARAM(X);
251
-    #endif
252
-    #if AXIS_DRIVER_TYPE_Y(L6470)
253
-      case  1: SET_L6470_PARAM(Y);
254
-    #endif
255
-    #if AXIS_DRIVER_TYPE_Z(L6470)
256
-      case  2: SET_L6470_PARAM(Z);
257
-    #endif
258
-    #if AXIS_DRIVER_TYPE_X2(L6470)
259
-      case  3: SET_L6470_PARAM(X2);
260
-    #endif
261
-    #if AXIS_DRIVER_TYPE_Y2(L6470)
262
-      case  4: SET_L6470_PARAM(Y2);
263
-    #endif
264
-    #if AXIS_DRIVER_TYPE_Z2(L6470)
265
-      case  5: SET_L6470_PARAM(Z2);
266
-    #endif
267
-    #if AXIS_DRIVER_TYPE_Z3(L6470)
268
-      case  6: SET_L6470_PARAM(Z3);
269
-    #endif
270
-    #if AXIS_DRIVER_TYPE_E0(L6470)
271
-      case  7: SET_L6470_PARAM(E0);
272
-    #endif
273
-    #if AXIS_DRIVER_TYPE_E1(L6470)
274
-      case  8: SET_L6470_PARAM(E1);
275
-    #endif
276
-    #if AXIS_DRIVER_TYPE_E2(L6470)
277
-      case  9: SET_L6470_PARAM(E2);
278
-    #endif
279
-    #if AXIS_DRIVER_TYPE_E3(L6470)
280
-      case 10: SET_L6470_PARAM(E3);
281
-    #endif
282
-    #if AXIS_DRIVER_TYPE_E4(L6470)
283
-      case 11: SET_L6470_PARAM(E4);
284
-    #endif
285
-    #if AXIS_DRIVER_TYPE_E5(L6470)
286
-      case 12: SET_L6470_PARAM(E5);
287
-    #endif
288
-  }
289
-}
290
-
291
-inline void echo_min_max(const char a, const float &min, const float &max) {
292
-  DEBUG_CHAR(' '); DEBUG_CHAR(a);
293
-  DEBUG_ECHOPAIR(" min = ", min);
294
-  DEBUG_ECHOLNPAIR("  max = ", max);
295
-}
296
-inline void echo_oct_used(const float &oct, const bool stall) {
297
-  DEBUG_ECHOPAIR("over_current_threshold used     : ", oct);
298
-  serialprintPGM(stall ? PSTR("  (Stall") : PSTR("  (OCD"));
299
-  DEBUG_ECHOLNPGM(" threshold)");
300
-}
301
-inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("ERROR - motion out of bounds"); }
302
-
303
-bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3],
304
-                          float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold,
305
-                          bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold
306
-) {
307
-  // Return TRUE if the calling routine needs to abort/kill
308
-
309
-  uint16_t displacement = 0;  // " = 0" to eliminate compiler warning
310
-  uint8_t j;   // general purpose counter
311
-
312
-  if (!all_axes_homed()) {
313
-    DEBUG_ECHOLNPGM("ERROR - home all before running this command");
314
-    //return true;
315
-  }
316
-
317
-  LOOP_XYZE(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) {
318
-    displacement = _displacement;
319
-    uint8_t axis_offset = parser.byteval('J');
320
-    axis_mon[0][0] = axis_codes[i];   // axis ASCII value (target character)
321
-    if (axis_offset >= 2 || axis_mon[0][0] == 'E')  // Single axis, E0, or E1
322
-      axis_mon[0][1] = axis_offset + '0';
323
-    else if (axis_offset == 0) {              // one or more axes
324
-      uint8_t driver_count_local = 0;         // can't use "driver_count" directly as a subscript because it's passed by reference
325
-      for (j = 0; j < MAX_L6470; j++)         // see how many drivers on this axis
326
-        if (axis_mon[0][0] == index_to_axis[j][0]) {
327
-          axis_mon[driver_count_local][0] = axis_mon[0][0];
328
-          axis_mon[driver_count_local][1] = index_to_axis[j][1];
329
-          axis_mon[driver_count_local][2] = index_to_axis[j][2];   // append end of string
330
-          axis_index[driver_count_local] = j;                      // set axis index
331
-          driver_count_local++;
332
-        }
333
-      driver_count = driver_count_local;
334
-    }
335
-    break; // only take first axis found
336
-  }
337
-
338
-  //
339
-  // Position calcs & checks
340
-  //
341
-
342
-  const xyze_pos_t center = {
343
-    LOGICAL_X_POSITION(current_position.x),
344
-    LOGICAL_Y_POSITION(current_position.y),
345
-    LOGICAL_Z_POSITION(current_position.z),
346
-    current_position.e
347
-  };
348
-
349
-  switch (axis_mon[0][0]) {
350
-    default: position_max = position_min = 0; break;
351
-
352
-    case 'X': {
353
-      position_min = center.x - displacement;
354
-      position_max = center.x + displacement;
355
-      echo_min_max('X', position_min, position_max);
356
-      if (false
357
-        #ifdef X_MIN_POS
358
-          || position_min < (X_MIN_POS)
359
-        #endif
360
-        #ifdef X_MAX_POS
361
-          || position_max > (X_MAX_POS)
362
-        #endif
363
-      ) {
364
-        err_out_of_bounds();
365
-        return true;
366
-      }
367
-    } break;
368
-
369
-    case 'Y': {
370
-      position_min = center.y - displacement;
371
-      position_max = center.y + displacement;
372
-      echo_min_max('Y', position_min, position_max);
373
-      if (false
374
-        #ifdef Y_MIN_POS
375
-          || position_min < (Y_MIN_POS)
376
-        #endif
377
-        #ifdef Y_MAX_POS
378
-          || position_max > (Y_MAX_POS)
379
-        #endif
380
-      ) {
381
-        err_out_of_bounds();
382
-        return true;
383
-      }
384
-    } break;
385
-
386
-    case 'Z': {
387
-      position_min = center.z - displacement;
388
-      position_max = center.z + displacement;
389
-      echo_min_max('Z', position_min, position_max);
390
-      if (false
391
-        #ifdef Z_MIN_POS
392
-          || position_min < (Z_MIN_POS)
393
-        #endif
394
-        #ifdef Z_MAX_POS
395
-          || position_max > (Z_MAX_POS)
396
-        #endif
397
-      ) {
398
-        err_out_of_bounds();
399
-        return true;
400
-      }
401
-    } break;
402
-
403
-    case 'E': {
404
-      position_min = center.e - displacement;
405
-      position_max = center.e + displacement;
406
-      echo_min_max('E', position_min, position_max);
407
-    } break;
408
-  }
409
-
410
-  //
411
-  // Work on the drivers
412
-  //
413
-  for (uint8_t k = 0; k < driver_count; k++) {
414
-    bool not_found = true;
415
-    for (j = 1; j <= L6470::chain[0]; j++) {
416
-      const char * const ind_axis = index_to_axis[L6470::chain[j]];
417
-      if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver
418
-        not_found = false;
419
-        break;
420
-      }
421
-    }
422
-    if (not_found) {
423
-      driver_count = k;
424
-      axis_mon[k][0] = ' ';  // mark this entry invalid
425
-      break;
426
-    }
427
-  }
428
-
429
-  if (driver_count == 0) {
430
-    DEBUG_ECHOLNPGM("ERROR - not a L6470 axis");
431
-    return true;
432
-  }
433
-
434
-  DEBUG_ECHOPGM("Monitoring:");
435
-  for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR("  ", axis_mon[j]);
436
-  L6470_EOL();
437
-
438
-  // now have a list of driver(s) to monitor
439
-
440
-  //
441
-  // kVAL_HOLD checks & settings
442
-  //
443
-
444
-  kval_hold = parser.byteval('K');
445
-  if (kval_hold) {
446
-    DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold);
447
-    for (j = 0; j < driver_count; j++)
448
-      set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
449
-  }
450
-  else {
451
-    // only print the KVAL_HOLD from one of the drivers
452
-    kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD);
453
-    DEBUG_ECHOLNPAIR("KVAL_HOLD = ", kval_hold);
454
-  }
455
-
456
-  //
457
-  // Overcurrent checks & settings
458
-  //
459
-
460
-  if (over_current_flag) {
461
-
462
-    uint8_t OCD_TH_val_local = 0,       // compiler thinks OCD_TH_val is unused if use it directly
463
-            STALL_TH_val_local = 0;     // just in case ...
464
-
465
-    over_current_threshold = parser.intval('I');
466
-
467
-    if (over_current_threshold) {
468
-
469
-      OCD_TH_val_local = over_current_threshold/375;
470
-      LIMIT(OCD_TH_val_local, 0, 15);
471
-      STALL_TH_val_local = over_current_threshold/31.25;
472
-      LIMIT(STALL_TH_val_local, 0, 127);
473
-      uint16_t OCD_TH_actual = (OCD_TH_val_local + 1) * 375,
474
-               STALL_TH_actual = (STALL_TH_val_local + 1) * 31.25;
475
-      if (OCD_TH_actual < STALL_TH_actual) {
476
-        OCD_TH_val_local++;
477
-        OCD_TH_actual = (OCD_TH_val_local + 1) * 375;
478
-      }
479
-
480
-      DEBUG_ECHOLNPAIR("over_current_threshold specified: ", over_current_threshold);
481
-      echo_oct_used(STALL_TH_actual, true);
482
-      echo_oct_used(OCD_TH_actual, false);
483
-
484
-      #define SET_OVER_CURRENT(Q) do { stepper##Q.SetParam(L6470_STALL_TH, STALL_TH_val_local); stepper##Q.SetParam(L6470_OCD_TH, OCD_TH_val_local);} while (0)
485
-
486
-      for (j = 0; j < driver_count; j++) {
487
-        set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local);
488
-        set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local);
489
-      }
490
-    }
491
-    else {
492
-      // only get & print the OVER_CURRENT values from one of the drivers
493
-      STALL_TH_val_local = get_param(axis_index[0], L6470_STALL_TH);
494
-      OCD_TH_val_local = get_param(axis_index[0], L6470_OCD_TH);
495
-
496
-      echo_oct_used((STALL_TH_val_local + 1) * 31.25, true);
497
-      echo_oct_used((OCD_TH_val_local + 1) * 375, false);
498
-    } // over_current_threshold
499
-
500
-    for (j = 0; j < driver_count; j++) {                 // set all drivers on axis the same
501
-      set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local);
502
-      set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local);
503
-    }
504
-
505
-    OCD_TH_val = OCD_TH_val_local;        // force compiler to update the main routine's copy
506
-    STALL_TH_val = STALL_TH_val_local;    // force compiler to update the main routine's copy
507
-  } // end of overcurrent
508
-
509
-  //
510
-  // Feedrate
511
-  //
512
-
513
-  final_feedrate = parser.floatval('F');
514
-  if (final_feedrate == 0) {
515
-    static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
516
-    const uint8_t num_feedrates = COUNT(default_max_feedrate);
517
-    for (j = 0; j < num_feedrates; j++) {
518
-      if (axis_codes[j] == axis_mon[0][0]) {
519
-        final_feedrate = default_max_feedrate[j];
520
-        break;
521
-      }
522
-    }
523
-    if (j == 3 && num_feedrates > 4) {   // have more than one extruder feedrate
524
-      uint8_t extruder_num = axis_mon[0][1] - '0';
525
-      if (j <= num_feedrates - extruder_num)     // have a feedrate specifically for this extruder
526
-        final_feedrate = default_max_feedrate[j + extruder_num];
527
-      else
528
-        final_feedrate = default_max_feedrate[3];  // use E0 feedrate for this extruder
529
-    }
530
-    final_feedrate *= 60;  // convert to mm/minute
531
-  } // end of feedrate
532
-
533
-  return false;   // FALSE indicates no user input problems
534
-}
535
-
536
-#if ENABLED(L6470_CHITCHAT)
537
-  inline void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR("YES") : PSTR("NO ")); }
538
-#endif
539
-
540
-void L6470_Marlin::say_axis(const uint8_t axis, const bool label/*=true*/) {
541
-  if (label) SERIAL_ECHOPGM("AXIS:");
542
-  SERIAL_CHAR(' ', index_to_axis[axis][0], index_to_axis[axis][1], ' ');
543
-}
544
-
545
-void L6470_Marlin::error_status_decode(const uint16_t status, const uint8_t axis) {  // assumes status bits have been inverted
546
-  #if ENABLED(L6470_CHITCHAT)
547
-    char temp_buf[10];
548
-    say_axis(axis);
549
-    sprintf_P(temp_buf, PSTR("  %4x   "), status);
550
-    DEBUG_ECHO(temp_buf);
551
-    print_bin(status);
552
-    DEBUG_ECHOPGM("  THERMAL: ");
553
-    serialprintPGM((status & STATUS_TH_SD) ? PSTR("SHUTDOWN") : (status & STATUS_TH_WRN) ? PSTR("WARNING ") : PSTR("OK      "));
554
-    DEBUG_ECHOPGM("   OVERCURRENT: ");
555
-    echo_yes_no(status & STATUS_OCD);
556
-    DEBUG_ECHOPGM("   STALL: ");
557
-    echo_yes_no(status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B));
558
-    L6470_EOL();
559
-  #else
560
-    UNUSED(status); UNUSED(axis);
561
-  #endif
562
-}
563
-
564
-//////////////////////////////////////////////////////////////////////////////////////////////////
565
-////
566
-////  MONITOR_L6470_DRIVER_STATUS routines
567
-////
568
-//////////////////////////////////////////////////////////////////////////////////////////////////
569
-
570
-#if ENABLED(MONITOR_L6470_DRIVER_STATUS)
571
-
572
-  struct L6470_driver_data {
573
-    uint8_t driver_index;
574
-    uint32_t driver_status;
575
-    bool is_otw;
576
-    uint8_t otw_counter;
577
-    bool is_ot;
578
-    bool is_hi_Z;
579
-    uint8_t com_counter;
580
-  };
581
-
582
-  L6470_driver_data driver_L6470_data[] = {
583
-    #if AXIS_DRIVER_TYPE_X(L6470)
584
-      {  0, 0, 0, 0, 0, 0, 0 },
585
-    #endif
586
-    #if AXIS_DRIVER_TYPE_Y(L6470)
587
-      {  1, 0, 0, 0, 0, 0, 0 },
588
-    #endif
589
-    #if AXIS_DRIVER_TYPE_Z(L6470)
590
-      {  2, 0, 0, 0, 0, 0, 0 },
591
-    #endif
592
-    #if AXIS_DRIVER_TYPE_X2(L6470)
593
-      {  3, 0, 0, 0, 0, 0, 0 },
594
-    #endif
595
-    #if AXIS_DRIVER_TYPE_Y2(L6470)
596
-      {  4, 0, 0, 0, 0, 0, 0 },
597
-    #endif
598
-    #if AXIS_DRIVER_TYPE_Z2(L6470)
599
-      {  5, 0, 0, 0, 0, 0, 0 },
600
-    #endif
601
-    #if AXIS_DRIVER_TYPE_Z3(L6470)
602
-      {  6, 0, 0, 0, 0, 0, 0 },
603
-    #endif
604
-    #if AXIS_DRIVER_TYPE_E0(L6470)
605
-      {  7, 0, 0, 0, 0, 0, 0 },
606
-    #endif
607
-    #if AXIS_DRIVER_TYPE_E1(L6470)
608
-      {  8, 0, 0, 0, 0, 0, 0 },
609
-    #endif
610
-    #if AXIS_DRIVER_TYPE_E2(L6470)
611
-      {  9, 0, 0, 0, 0, 0, 0 },
612
-    #endif
613
-    #if AXIS_DRIVER_TYPE_E3(L6470)
614
-      { 10, 0, 0, 0, 0, 0, 0 },
615
-    #endif
616
-    #if AXIS_DRIVER_TYPE_E4(L6470)
617
-      { 11, 0, 0, 0, 0, 0, 0 },
618
-    #endif
619
-    #if AXIS_DRIVER_TYPE_E5(L6470)
620
-      { 12, 0, 0, 0, 0, 0, 0 }
621
-    #endif
622
-  };
623
-
624
-  inline void append_stepper_err(char * &p, const uint8_t stepper_index, const char * const err=nullptr) {
625
-    p += sprintf_P(p, PSTR("Stepper %c%c "), char(index_to_axis[stepper_index][0]), char(index_to_axis[stepper_index][1]));
626
-    if (err) p += sprintf_P(p, err);
627
-  }
628
-
629
-  void L6470_monitor_update(uint8_t stepper_index, uint16_t status) {
630
-    if (spi_abort) return;  // don't do anything if set_directions() has occurred
631
-    uint8_t kval_hold;
632
-    char temp_buf[120];
633
-    char* p = &temp_buf[0];
634
-    uint8_t j;
635
-    for (j = 0; j < L6470::chain[0]; j++) // find the table for this stepper
636
-      if (driver_L6470_data[j].driver_index == stepper_index) break;
637
-
638
-    driver_L6470_data[j].driver_status = status;
639
-    uint16_t _status = ~status;     // all error bits are active low
640
-
641
-    if (status == 0 || status == 0xFFFF) {              // com problem
642
-      if (driver_L6470_data[j].com_counter == 0) {      // warn user when it first happens
643
-        driver_L6470_data[j].com_counter++;
644
-        append_stepper_err(p, stepper_index, PSTR(" - communications lost\n"));
645
-        DEBUG_ECHO(temp_buf);
646
-      }
647
-      else {
648
-        driver_L6470_data[j].com_counter++;
649
-        if (driver_L6470_data[j].com_counter > 240) {  // remind of com problem about every 2 minutes
650
-          driver_L6470_data[j].com_counter = 1;
651
-          append_stepper_err(p, stepper_index, PSTR(" - still no communications\n"));
652
-          DEBUG_ECHO(temp_buf);
653
-        }
654
-      }
655
-    }
656
-    else {
657
-      if (driver_L6470_data[j].com_counter) {   // comms re-established
658
-        driver_L6470_data[j].com_counter = 0;
659
-        append_stepper_err(p, stepper_index, PSTR(" - communications re-established\n.. setting all drivers to default values\n"));
660
-        DEBUG_ECHO(temp_buf);
661
-        init_to_defaults();
662
-      }
663
-      else {
664
-        // no com problems - do the usual checks
665
-        if (_status & L6470_ERROR_MASK) {
666
-          append_stepper_err(p, stepper_index);
667
-
668
-          if (status & STATUS_HIZ) {                         // the driver has shut down  HiZ is active high
669
-            driver_L6470_data[j].is_hi_Z = true;
670
-            p += sprintf_P(p, PSTR("%cIS SHUT DOWN"), ' ');
671
-            //         if (_status & STATUS_TH_SD) {                     // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN
672
-            if (_status & STATUS_TH_WRN) {                    // over current shutdown
673
-              p += sprintf_P(p, PSTR("%cdue to over temperature"), ' ');
674
-              driver_L6470_data[j].is_ot = true;
675
-              kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - 2 * KVAL_HOLD_STEP_DOWN;
676
-              set_param(stepper_index, L6470_KVAL_HOLD, kval_hold);     // reduce KVAL_HOLD
677
-              p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), 2 * KVAL_HOLD_STEP_DOWN, kval_hold);   // let user know
678
-            }
679
-            else
680
-              driver_L6470_data[j].is_ot = false;
681
-          }
682
-          else {
683
-            driver_L6470_data[j].is_hi_Z = false;
684
-
685
-            if (_status & STATUS_TH_WRN) {     // have an over temperature warning
686
-              driver_L6470_data[j].is_otw = true;
687
-              driver_L6470_data[j].otw_counter++;
688
-              kval_hold = get_param(stepper_index, L6470_KVAL_HOLD);
689
-              if (driver_L6470_data[j].otw_counter > 4) {  // otw present for 2 - 2.5 seconds, reduce KVAL_HOLD
690
-                kval_hold -= KVAL_HOLD_STEP_DOWN;
691
-                set_param(stepper_index, L6470_KVAL_HOLD, kval_hold);     // reduce KVAL_HOLD
692
-                p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), KVAL_HOLD_STEP_DOWN, kval_hold);   // let user know
693
-                driver_L6470_data[j].otw_counter = 0;
694
-                driver_L6470_data[j].is_otw = true;
695
-              }
696
-              else if (driver_L6470_data[j].otw_counter)
697
-                p += sprintf_P(p, PSTR("%c- thermal warning"), ' ');   // warn user
698
-            }
699
-          }
700
-
701
-          #ifdef L6470_STOP_ON_ERROR
702
-            if (_status & (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD))
703
-            kill(temp_buf);
704
-          #endif
705
-
706
-
707
-          #if ENABLED(L6470_CHITCHAT)
708
-
709
-            if (_status & STATUS_OCD)
710
-            p += sprintf_P(p, PSTR("%c  over current"), ' ');
711
-
712
-            if (_status & (STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B))
713
-            p += sprintf_P(p, PSTR("%c  stall"), ' ');
714
-
715
-            if (_status & STATUS_UVLO)
716
-            p += sprintf_P(p, PSTR("%c  under voltage lock out"), ' ');
717
-
718
-            p += sprintf_P(p, PSTR("%c\n"), ' ');
719
-          #endif
720
-
721
-          DEBUG_ECHOLN(temp_buf);  // print the error message
722
-        }
723
-        else {
724
-          driver_L6470_data[j].is_ot = false;
725
-          driver_L6470_data[j].otw_counter = 0;   //clear out warning indicators
726
-          driver_L6470_data[j].is_otw = false;
727
-
728
-        } // end usual checks
729
-      } // comms established but have errors
730
-    } // comms re-established
731
-  } // end L6470_monitor_update()
732
-
733
-  #define MONITOR_L6470_DRIVE(Q) L6470_monitor_update(Q, stepper##Q.getStatus())
734
-
735
-  void L6470_Marlin::monitor_driver() {
736
-    static millis_t next_cOT = 0;
737
-    if (ELAPSED(millis(), next_cOT)) {
738
-      next_cOT = millis() + 500;
739
-
740
-      spi_active = true;    // let set_directions() know we're in the middle of a series of SPI transfers
741
-
742
-      #if AXIS_DRIVER_TYPE_X(L6470)
743
-        MONITOR_L6470_DRIVE(X);
744
-      #endif
745
-      #if AXIS_DRIVER_TYPE_Y(L6470)
746
-        MONITOR_L6470_DRIVE(Y);
747
-      #endif
748
-      #if AXIS_DRIVER_TYPE_Z(L6470)
749
-        MONITOR_L6470_DRIVE(Z);
750
-      #endif
751
-      #if AXIS_DRIVER_TYPE_X2(L6470)
752
-        MONITOR_L6470_DRIVE(X2);
753
-      #endif
754
-      #if AXIS_DRIVER_TYPE_Y2(L6470)
755
-        MONITOR_L6470_DRIVE(Y2);
756
-      #endif
757
-      #if AXIS_DRIVER_TYPE_Z2(L6470)
758
-        MONITOR_L6470_DRIVE(Z2);
759
-      #endif
760
-      #if AXIS_DRIVER_TYPE_Z3(L6470)
761
-        MONITOR_L6470_DRIVE(Z3);
762
-      #endif
763
-      #if AXIS_DRIVER_TYPE_E0(L6470)
764
-        MONITOR_L6470_DRIVE(E0);
765
-      #endif
766
-      #if AXIS_DRIVER_TYPE_E1(L6470)
767
-        MONITOR_L6470_DRIVE(E1);
768
-      #endif
769
-      #if AXIS_DRIVER_TYPE_E2(L6470)
770
-        MONITOR_L6470_DRIVE(E2);
771
-      #endif
772
-      #if AXIS_DRIVER_TYPE_E3(L6470)
773
-        MONITOR_L6470_DRIVE(E3);
774
-      #endif
775
-      #if AXIS_DRIVER_TYPE_E4(L6470)
776
-        MONITOR_L6470_DRIVE(E4);
777
-      #endif
778
-      #if AXIS_DRIVER_TYPE_E5(L6470)
779
-        MONITOR_L6470_DRIVE(E5);
780
-      #endif
781
-
782
-      #if ENABLED(L6470_DEBUG)
783
-        if (report_L6470_status) L6470_EOL();
784
-      #endif
785
-
786
-      spi_active = false;   // done with all SPI transfers - clear handshake flags
787
-      spi_abort = false;
788
-    }
789
-  }
790
-
791
-#endif // MONITOR_L6470_DRIVER_STATUS
792
-
793
-#endif // HAS_DRIVER(L6470)

+ 0
- 72
Marlin/src/libs/L6470/L6470_Marlin.h View File

@@ -1,72 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-#pragma once
23
-
24
-#include "../../inc/MarlinConfig.h"
25
-
26
-#include <L6470.h>
27
-
28
-#define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P)
29
-
30
-enum L6470_driver_enum : unsigned char { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5, MAX_L6470 };
31
-
32
-#define L6470_ERROR_MASK  (STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD  | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B)
33
-#define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK
34
-#define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1
35
-
36
-class L6470_Marlin {
37
-public:
38
-  static bool index_to_dir[MAX_L6470];
39
-  static uint8_t axis_xref[MAX_L6470];
40
-  static char index_to_axis[MAX_L6470][3];
41
-  static uint8_t dir_commands[MAX_L6470];
42
-
43
-  // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer
44
-  static volatile bool spi_abort;
45
-  static bool spi_active;
46
-
47
-  L6470_Marlin() {}
48
-
49
-  static uint16_t get_status(const uint8_t axis);
50
-
51
-  static uint32_t get_param(uint8_t axis, uint8_t param);
52
-
53
-  static void set_param(uint8_t axis, uint8_t param, uint32_t value);
54
-
55
-  static bool get_user_input(uint8_t &driver_count, uint8_t axis_index[3], char axis_mon[3][3],
56
-                             float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold,
57
-                             bool over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold);
58
-
59
-  static void error_status_decode(const uint16_t status, const uint8_t axis);
60
-
61
-  static void monitor_driver();
62
-
63
-  static void init();
64
-  static void init_to_defaults();
65
-
66
-  static void say_axis(const uint8_t axis, const bool label=true);
67
-
68
-private:
69
-  void populate_chain_array();
70
-};
71
-
72
-extern L6470_Marlin L6470;

+ 892
- 0
Marlin/src/libs/L64XX/L64XX_Marlin.cpp View File

@@ -0,0 +1,892 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * The monitor_driver routines are a close copy of the TMC code
25
+ */
26
+
27
+#include "../../inc/MarlinConfig.h"
28
+
29
+#if HAS_L64XX
30
+
31
+#include "L64XX_Marlin.h"
32
+
33
+L64XX_Marlin L64xxManager;
34
+
35
+#include "../../module/stepper/indirection.h"
36
+#include "../../gcode/gcode.h"
37
+#include "../../module/planner.h"
38
+#include "../../HAL/shared/Delay.h"
39
+
40
+void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
41
+
42
+char L64XX_Marlin::index_to_axis[MAX_L6470][3] = { "X ", "Y ", "Z ", "X2", "Y2", "Z2", "Z3", "E0", "E1", "E2", "E3", "E4", "E5" };
43
+
44
+#define DEBUG_OUT ENABLED(L6470_CHITCHAT)
45
+#include "../../core/debug_out.h"
46
+
47
+uint8_t L64XX_Marlin::dir_commands[MAX_L6470];  // array to hold direction command for each driver
48
+
49
+uint8_t L64XX_Marlin::index_to_dir[MAX_L6470] = { (INVERT_X_DIR)                        , //  0 X
50
+                                                  (INVERT_Y_DIR)                        , //  1 Y
51
+                                                  (INVERT_Z_DIR)                        , //  2 Z
52
+                                                  #if ENABLED(X_DUAL_STEPPER_DRIVERS)
53
+                                                    (INVERT_X_DIR) ^ (INVERT_X2_VS_X_DIR) , //  3 X2
54
+                                                  #else
55
+                                                    (INVERT_X_DIR)                      , //  3 X2
56
+                                                  #endif
57
+                                                  #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
58
+                                                    (INVERT_Y_DIR) ^ (INVERT_Y2_VS_Y_DIR) , //  4 Y2
59
+                                                  #else
60
+                                                    (INVERT_Y_DIR)                      , //  4 Y2
61
+                                                  #endif
62
+                                                  (INVERT_Z_DIR)                        , //  5 Z2
63
+                                                  (INVERT_Z_DIR)                        , //  6 Z3
64
+                                                  (INVERT_E0_DIR)                       , //  7 E0
65
+                                                  (INVERT_E1_DIR)                       , //  8 E1
66
+                                                  (INVERT_E2_DIR)                       , //  9 E2
67
+                                                  (INVERT_E3_DIR)                       , // 10 E3
68
+                                                  (INVERT_E4_DIR)                       , // 11 E4
69
+                                                  (INVERT_E5_DIR)                       , // 12 E5
70
+                                                };
71
+
72
+volatile uint8_t L64XX_Marlin::spi_abort = false;
73
+uint8_t L64XX_Marlin::spi_active = false;
74
+
75
+L64XX_Marlin::L64XX_shadow_t L64XX_Marlin::shadow;
76
+
77
+//uint32_t UVLO_ADC = 0x0400; // ADC undervoltage event
78
+
79
+void L6470_populate_chain_array() {
80
+
81
+  #define _L6470_INIT_SPI(Q)  do{ stepper##Q.set_chain_info(Q, Q##_CHAIN_POS); }while(0)
82
+
83
+  #if AXIS_IS_L64XX(X)
84
+    _L6470_INIT_SPI(X);
85
+  #endif
86
+  #if AXIS_IS_L64XX(X2)
87
+    _L6470_INIT_SPI(X2);
88
+  #endif
89
+  #if AXIS_IS_L64XX(Y)
90
+    _L6470_INIT_SPI(Y);
91
+  #endif
92
+  #if AXIS_IS_L64XX(Y2)
93
+    _L6470_INIT_SPI(Y2);
94
+  #endif
95
+  #if AXIS_IS_L64XX(Z)
96
+    _L6470_INIT_SPI(Z);
97
+  #endif
98
+  #if AXIS_IS_L64XX(Z2)
99
+    _L6470_INIT_SPI(Z2);
100
+  #endif
101
+  #if AXIS_IS_L64XX(Z3)
102
+    _L6470_INIT_SPI(Z3);
103
+  #endif
104
+  #if AXIS_IS_L64XX(E0)
105
+    _L6470_INIT_SPI(E0);
106
+  #endif
107
+  #if AXIS_IS_L64XX(E1)
108
+    _L6470_INIT_SPI(E1);
109
+  #endif
110
+  #if AXIS_IS_L64XX(E2)
111
+    _L6470_INIT_SPI(E2);
112
+  #endif
113
+  #if AXIS_IS_L64XX(E3)
114
+    _L6470_INIT_SPI(E3);
115
+  #endif
116
+  #if AXIS_IS_L64XX(E4)
117
+    _L6470_INIT_SPI(E4);
118
+  #endif
119
+  #if AXIS_IS_L64XX(E5)
120
+    _L6470_INIT_SPI(E5);
121
+  #endif
122
+}
123
+
124
+
125
+/**
126
+ * Some status bit positions & definitions differ per driver.
127
+ * Copy info to known locations to simplfy check/display logic.
128
+ *   1. Copy stepper status
129
+ *   2. Copy status bit definitions
130
+ *   3. Copy status layout
131
+ *   4. Make all error bits active low (as needed)
132
+ */
133
+uint16_t L64XX_Marlin::get_stepper_status(L64XX &st) {
134
+  shadow.STATUS_AXIS_RAW           = st.getStatus();
135
+  shadow.STATUS_AXIS               = shadow.STATUS_AXIS_RAW;
136
+  shadow.STATUS_AXIS_LAYOUT        = st.L6470_status_layout;
137
+  shadow.AXIS_OCD_TH_MAX           = st.OCD_TH_MAX;
138
+  shadow.AXIS_STALL_TH_MAX         = st.STALL_TH_MAX;
139
+  shadow.AXIS_OCD_CURRENT_CONSTANT_INV   = st.OCD_CURRENT_CONSTANT_INV;
140
+  shadow.AXIS_STALL_CURRENT_CONSTANT_INV = st.STALL_CURRENT_CONSTANT_INV;
141
+  shadow.L6470_AXIS_CONFIG         = st.L64XX_CONFIG;
142
+  shadow.L6470_AXIS_STATUS         = st.L64XX_STATUS;
143
+  shadow.STATUS_AXIS_OCD           = st.STATUS_OCD;
144
+  shadow.STATUS_AXIS_SCK_MOD       = st.STATUS_SCK_MOD;
145
+  shadow.STATUS_AXIS_STEP_LOSS_A   = st.STATUS_STEP_LOSS_A;
146
+  shadow.STATUS_AXIS_STEP_LOSS_B   = st.STATUS_STEP_LOSS_B;
147
+  shadow.STATUS_AXIS_TH_SD         = st.STATUS_TH_SD;
148
+  shadow.STATUS_AXIS_TH_WRN        = st.STATUS_TH_WRN;
149
+  shadow.STATUS_AXIS_UVLO          = st.STATUS_UVLO;
150
+  shadow.STATUS_AXIS_WRONG_CMD     = st.STATUS_WRONG_CMD;
151
+  shadow.STATUS_AXIS_CMD_ERR       = st.STATUS_CMD_ERR;
152
+  shadow.STATUS_AXIS_NOTPERF_CMD   = st.STATUS_NOTPERF_CMD;
153
+
154
+  switch (shadow.STATUS_AXIS_LAYOUT) {
155
+    case L6470_STATUS_LAYOUT: {   // L6470
156
+      shadow.L6470_ERROR_MASK      = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD | shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B;
157
+      shadow.STATUS_AXIS           ^= (shadow.STATUS_AXIS_WRONG_CMD | shadow.STATUS_AXIS_NOTPERF_CMD);  // invert just error bits that are active high
158
+      break;
159
+    }
160
+    case L6474_STATUS_LAYOUT: {   // L6474
161
+      shadow.L6470_ERROR_MASK      = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD ;
162
+      shadow.STATUS_AXIS           ^= (shadow.STATUS_AXIS_WRONG_CMD | shadow.STATUS_AXIS_NOTPERF_CMD);  // invert just error bits that are active high
163
+      break;
164
+    }
165
+    case L6480_STATUS_LAYOUT: {   // L6480 & powerSTEP01
166
+      shadow.L6470_ERROR_MASK      = shadow.STATUS_AXIS_UVLO | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD | shadow.STATUS_AXIS_OCD | shadow.STATUS_AXIS_STEP_LOSS_A | shadow.STATUS_AXIS_STEP_LOSS_B;
167
+      shadow.STATUS_AXIS           ^= (shadow.STATUS_AXIS_CMD_ERR | shadow.STATUS_AXIS_TH_WRN | shadow.STATUS_AXIS_TH_SD);  // invert just error bits that are active high
168
+      break;
169
+    }
170
+  }
171
+  return shadow.STATUS_AXIS;
172
+}
173
+
174
+
175
+void L64XX_Marlin::init() {               // Set up SPI and then init chips
176
+  ENABLE_RESET_L64XX_CHIPS(LOW);          // hardware reset of drivers
177
+  DELAY_US(100);
178
+  ENABLE_RESET_L64XX_CHIPS(HIGH);
179
+  DELAY_US(1000);                         // need about 650µs for the chip(s) to fully start up
180
+  L6470_populate_chain_array();           // Set up array to control where in the SPI transfer sequence a particular stepper's data goes
181
+
182
+  spi_init();                             // Since L64XX SPI pins are unset we must init SPI here
183
+
184
+  init_to_defaults();                     // init the chips
185
+}
186
+
187
+uint16_t L64XX_Marlin::get_status(const L64XX_axis_t axis) {
188
+
189
+  #define STATUS_L6470(Q) get_stepper_status(stepper##Q)
190
+
191
+  switch (axis) {
192
+    default: break;
193
+    #if AXIS_IS_L64XX(X)
194
+      case X : return STATUS_L6470(X);
195
+    #endif
196
+    #if AXIS_IS_L64XX(Y)
197
+      case Y : return STATUS_L6470(Y);
198
+    #endif
199
+    #if AXIS_IS_L64XX(Z)
200
+      case Z : return STATUS_L6470(Z);
201
+    #endif
202
+    #if AXIS_IS_L64XX(X2)
203
+      case X2: return STATUS_L6470(X2);
204
+    #endif
205
+    #if AXIS_IS_L64XX(Y2)
206
+      case Y2: return STATUS_L6470(Y2);
207
+    #endif
208
+    #if AXIS_IS_L64XX(Z2)
209
+      case Z2: return STATUS_L6470(Z2);
210
+    #endif
211
+    #if AXIS_IS_L64XX(Z3)
212
+      case Z3: return STATUS_L6470(Z3);
213
+    #endif
214
+    #if AXIS_IS_L64XX(E0)
215
+      case E0: return STATUS_L6470(E0);
216
+    #endif
217
+    #if AXIS_IS_L64XX(E1)
218
+      case E1: return STATUS_L6470(E1);
219
+    #endif
220
+    #if AXIS_IS_L64XX(E2)
221
+      case E2: return STATUS_L6470(E2);
222
+    #endif
223
+    #if AXIS_IS_L64XX(E3)
224
+      case E3: return STATUS_L6470(E3);
225
+    #endif
226
+    #if AXIS_IS_L64XX(E4)
227
+      case E4: return STATUS_L6470(E4);
228
+    #endif
229
+    #if AXIS_IS_L64XX(E5)
230
+      case E5: return STATUS_L6470(E5);
231
+    #endif
232
+  }
233
+
234
+  return 0; // Not needed but kills a compiler warning
235
+}
236
+
237
+uint32_t L64XX_Marlin::get_param(const L64XX_axis_t axis, const uint8_t param) {
238
+
239
+  #define GET_L6470_PARAM(Q) L6470_GETPARAM(param, Q)
240
+
241
+  switch (axis) {
242
+    default: break;
243
+    #if AXIS_IS_L64XX(X)
244
+      case X : return GET_L6470_PARAM(X);
245
+    #endif
246
+    #if AXIS_IS_L64XX(Y)
247
+      case Y : return GET_L6470_PARAM(Y);
248
+    #endif
249
+    #if AXIS_IS_L64XX(Z)
250
+      case Z : return GET_L6470_PARAM(Z);
251
+    #endif
252
+    #if AXIS_IS_L64XX(X2)
253
+      case X2: return GET_L6470_PARAM(X2);
254
+    #endif
255
+    #if AXIS_IS_L64XX(Y2)
256
+      case Y2: return GET_L6470_PARAM(Y2);
257
+    #endif
258
+    #if AXIS_IS_L64XX(Z2)
259
+      case Z2: return GET_L6470_PARAM(Z2);
260
+    #endif
261
+    #if AXIS_IS_L64XX(Z3)
262
+      case Z3: return GET_L6470_PARAM(Z3);
263
+    #endif
264
+    #if AXIS_IS_L64XX(E0)
265
+      case E0: return GET_L6470_PARAM(E0);
266
+    #endif
267
+    #if AXIS_IS_L64XX(E1)
268
+      case E1: return GET_L6470_PARAM(E1);
269
+    #endif
270
+    #if AXIS_IS_L64XX(E2)
271
+      case E2: return GET_L6470_PARAM(E2);
272
+    #endif
273
+    #if AXIS_IS_L64XX(E3)
274
+      case E3: return GET_L6470_PARAM(E3);
275
+    #endif
276
+    #if AXIS_IS_L64XX(E4)
277
+      case E4: return GET_L6470_PARAM(E4);
278
+    #endif
279
+    #if AXIS_IS_L64XX(E5)
280
+      case E5: return GET_L6470_PARAM(E5);
281
+    #endif
282
+  }
283
+
284
+  return 0; // not needed but kills a compiler warning
285
+}
286
+
287
+void L64XX_Marlin::set_param(const L64XX_axis_t axis, const uint8_t param, const uint32_t value) {
288
+
289
+  #define SET_L6470_PARAM(Q) stepper##Q.SetParam(param, value)
290
+
291
+  switch (axis) {
292
+    default: break;
293
+    #if AXIS_IS_L64XX(X)
294
+      case X : SET_L6470_PARAM(X); break;
295
+    #endif
296
+    #if AXIS_IS_L64XX(Y)
297
+      case Y : SET_L6470_PARAM(Y); break;
298
+    #endif
299
+    #if AXIS_IS_L64XX(Z)
300
+      case Z : SET_L6470_PARAM(Z); break;
301
+    #endif
302
+    #if AXIS_IS_L64XX(X2)
303
+      case X2: SET_L6470_PARAM(X2); break;
304
+    #endif
305
+    #if AXIS_IS_L64XX(Y2)
306
+      case Y2: SET_L6470_PARAM(Y2); break;
307
+    #endif
308
+    #if AXIS_IS_L64XX(Z2)
309
+      case Z2: SET_L6470_PARAM(Z2); break;
310
+    #endif
311
+    #if AXIS_IS_L64XX(Z3)
312
+      case Z3: SET_L6470_PARAM(Z3); break;
313
+    #endif
314
+    #if AXIS_IS_L64XX(E0)
315
+      case E0: SET_L6470_PARAM(E0); break;
316
+    #endif
317
+    #if AXIS_IS_L64XX(E1)
318
+      case E1: SET_L6470_PARAM(E1); break;
319
+    #endif
320
+    #if AXIS_IS_L64XX(E2)
321
+      case E2: SET_L6470_PARAM(E2); break;
322
+    #endif
323
+    #if AXIS_IS_L64XX(E3)
324
+      case E3: SET_L6470_PARAM(E3); break;
325
+    #endif
326
+    #if AXIS_IS_L64XX(E4)
327
+      case E4: SET_L6470_PARAM(E4); break;
328
+    #endif
329
+    #if AXIS_IS_L64XX(E5)
330
+      case E5: SET_L6470_PARAM(E5); break;
331
+    #endif
332
+  }
333
+}
334
+
335
+inline void echo_min_max(const char a, const float &min, const float &max) {
336
+  DEBUG_CHAR(' '); DEBUG_CHAR(a);
337
+  DEBUG_ECHOPAIR(" min = ", min);
338
+  DEBUG_ECHOLNPAIR("  max = ", max);
339
+}
340
+inline void echo_oct_used(const float &oct, const uint8_t stall) {
341
+  DEBUG_ECHOPAIR("over_current_threshold used     : ", oct);
342
+  serialprintPGM(stall ? PSTR("  (Stall") : PSTR("  (OCD"));
343
+  DEBUG_ECHOLNPGM(" threshold)");
344
+}
345
+inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("Test aborted - motion out of bounds"); }
346
+
347
+uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_index[3],  char axis_mon[3][3],
348
+                                 float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold,
349
+                                 uint8_t over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold
350
+) {
351
+  // Return TRUE if the calling routine needs to abort/kill
352
+
353
+  uint16_t displacement = 0;  // " = 0" to eliminate compiler warning
354
+  uint8_t j;   // general purpose counter
355
+
356
+  if (!all_axes_homed()) {
357
+    DEBUG_ECHOLNPGM("Test aborted - home all before running this command");
358
+    return true;
359
+  }
360
+
361
+  uint8_t found_displacement = false;
362
+  LOOP_XYZE(i) if (uint16_t _displacement = parser.intval(axis_codes[i])) {
363
+    found_displacement = true;
364
+    displacement = _displacement;
365
+    uint8_t axis_offset = parser.byteval('J');
366
+    axis_mon[0][0] = axis_codes[i];   // axis ASCII value (target character)
367
+    uint8_t driver_count_local = 0;         // Can't use "driver_count" directly as a subscript because it's passed by reference
368
+    if (axis_offset >= 2 || axis_mon[0][0] == 'E') {  // Single axis, E0, or E1
369
+      axis_mon[0][1] = axis_offset + '0';
370
+      for (j = 0; j < MAX_L6470; j++) {       // See how many drivers on this axis
371
+        const char * const str = index_to_axis[j];
372
+        if (axis_mon[0][0] == str[0]) {
373
+          char * const mon = axis_mon[driver_count_local];
374
+          mon[0] = str[0];
375
+          mon[1] = str[1];
376
+          mon[2] = str[2];   // append end of string
377
+          axis_index[driver_count_local] = (L64XX_axis_t)j;        // set axis index
378
+          driver_count_local++;
379
+        }
380
+      }
381
+    }
382
+    else if (axis_offset == 0) {              // One or more axes
383
+      for (j = 0; j < MAX_L6470; j++) {       // See how many drivers on this axis
384
+        const char * const str = index_to_axis[j];
385
+        if (axis_mon[0][0] == str[0]) {
386
+          char * const mon = axis_mon[driver_count_local];
387
+          mon[0] = str[0];
388
+          mon[1] = str[1];
389
+          mon[2] = str[2];   // append end of string
390
+          axis_index[driver_count_local] = (L64XX_axis_t)j;        // set axis index
391
+          driver_count_local++;
392
+        }
393
+      }
394
+      driver_count = driver_count_local;
395
+    }
396
+    break; // only take first axis found
397
+  }
398
+
399
+  if (!found_displacement) {
400
+    DEBUG_ECHOLNPGM("Test aborted - AXIS with displacement is required");
401
+    return true;
402
+  }
403
+
404
+  //
405
+  // Position calcs & checks
406
+  //
407
+
408
+  const float X_center = LOGICAL_X_POSITION(current_position.x),
409
+              Y_center = LOGICAL_Y_POSITION(current_position.y),
410
+              Z_center = LOGICAL_Z_POSITION(current_position.z),
411
+              E_center = current_position.e;
412
+
413
+  switch (axis_mon[0][0]) {
414
+    default: position_max = position_min = 0; break;
415
+
416
+    case 'X': {
417
+      position_min = X_center - displacement;
418
+      position_max = X_center + displacement;
419
+      echo_min_max('X', position_min, position_max);
420
+      if (false
421
+        #ifdef X_MIN_POS
422
+          || position_min < (X_MIN_POS)
423
+        #endif
424
+        #ifdef X_MAX_POS
425
+          || position_max > (X_MAX_POS)
426
+        #endif
427
+      ) {
428
+        err_out_of_bounds();
429
+        return true;
430
+      }
431
+    } break;
432
+
433
+    case 'Y': {
434
+      position_min = Y_center - displacement;
435
+      position_max = Y_center + displacement;
436
+      echo_min_max('Y', position_min, position_max);
437
+      if (false
438
+        #ifdef Y_MIN_POS
439
+          || position_min < (Y_MIN_POS)
440
+        #endif
441
+        #ifdef Y_MAX_POS
442
+          || position_max > (Y_MAX_POS)
443
+        #endif
444
+      ) {
445
+        err_out_of_bounds();
446
+        return true;
447
+      }
448
+    } break;
449
+
450
+    case 'Z': {
451
+      position_min = Z_center - displacement;
452
+      position_max = Z_center + displacement;
453
+      echo_min_max('Z', position_min, position_max);
454
+      if (false
455
+        #ifdef Z_MIN_POS
456
+          || position_min < (Z_MIN_POS)
457
+        #endif
458
+        #ifdef Z_MAX_POS
459
+          || position_max > (Z_MAX_POS)
460
+        #endif
461
+      ) {
462
+        err_out_of_bounds();
463
+        return true;
464
+      }
465
+    } break;
466
+
467
+    case 'E': {
468
+      position_min = E_center - displacement;
469
+      position_max = E_center + displacement;
470
+      echo_min_max('E', position_min, position_max);
471
+    } break;
472
+  }
473
+
474
+  //
475
+  // Work on the drivers
476
+  //
477
+
478
+  for (uint8_t k = 0; k < driver_count; k++) {
479
+    uint8_t not_found = true;
480
+    for (j = 1; j <= L64XX::chain[0]; j++) {
481
+      const char * const ind_axis = index_to_axis[L64XX::chain[j]];
482
+      if (ind_axis[0] == axis_mon[k][0] && ind_axis[1] == axis_mon[k][1]) { // See if a L6470 driver
483
+        not_found = false;
484
+        break;
485
+      }
486
+    }
487
+    if (not_found) {
488
+      driver_count = k;
489
+      axis_mon[k][0] = ' ';  // mark this entry invalid
490
+      break;
491
+    }
492
+  }
493
+
494
+  if (driver_count == 0) {
495
+    DEBUG_ECHOLNPGM("Test aborted - not a L6470 axis");
496
+    return true;
497
+  }
498
+
499
+  DEBUG_ECHOPGM("Monitoring:");
500
+  for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR("  ", axis_mon[j]);
501
+  DEBUG_EOL();
502
+
503
+  // now have a list of driver(s) to monitor
504
+
505
+  //
506
+  // TVAL & kVAL_HOLD checks & settings
507
+  //
508
+  const L64XX_shadow_t &sh = shadow;
509
+  get_status(axis_index[0]); // populate shadow array
510
+
511
+  if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // L6474 - use TVAL
512
+    uint16_t TVAL_current = parser.ushortval('T');
513
+    if (TVAL_current) {
514
+      uint8_t TVAL_count = (TVAL_current /  sh.AXIS_STALL_CURRENT_CONSTANT_INV) - 1;
515
+      LIMIT(TVAL_count, 0, sh.AXIS_STALL_TH_MAX);
516
+      for (j = 0; j < driver_count; j++)
517
+        set_param(axis_index[j], L6474_TVAL, TVAL_count);
518
+    }
519
+    // only print the tval from one of the drivers
520
+    kval_hold = get_param(axis_index[0], L6474_TVAL);
521
+    DEBUG_ECHOLNPAIR("TVAL current (mA) = ", (kval_hold + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV);
522
+  }
523
+  else {
524
+    kval_hold = parser.byteval('K');
525
+    if (kval_hold) {
526
+      DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold);
527
+      for (j = 0; j < driver_count; j++)
528
+        set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
529
+    }
530
+    else {
531
+      // only print the KVAL_HOLD from one of the drivers
532
+      kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD);
533
+      DEBUG_ECHOLNPAIR("KVAL_HOLD = ", kval_hold);
534
+    }
535
+  }
536
+
537
+  //
538
+  // Overcurrent checks & settings
539
+  //
540
+
541
+  if (over_current_flag) {
542
+
543
+    uint8_t OCD_TH_val_local = 0,       // compiler thinks OCD_TH_val is unused if use it directly
544
+            STALL_TH_val_local = 0;     // just in case ...
545
+
546
+    over_current_threshold = parser.intval('I');
547
+
548
+    if (over_current_threshold) {
549
+
550
+      OCD_TH_val_local = over_current_threshold/375;
551
+      LIMIT(OCD_TH_val_local, 0, 15);
552
+      STALL_TH_val_local = over_current_threshold/31.25;
553
+      LIMIT(STALL_TH_val_local, 0, 127);
554
+      uint16_t OCD_TH_actual = (OCD_TH_val_local + 1) * 375,
555
+               STALL_TH_actual = (STALL_TH_val_local + 1) * 31.25;
556
+      if (OCD_TH_actual < STALL_TH_actual) {
557
+        OCD_TH_val_local++;
558
+        OCD_TH_actual = (OCD_TH_val_local + 1) * 375;
559
+      }
560
+
561
+      DEBUG_ECHOLNPAIR("over_current_threshold specified: ", over_current_threshold);
562
+      if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true);
563
+      echo_oct_used((OCD_TH_val_local + 1) * 375, false);
564
+
565
+      #define SET_OVER_CURRENT(Q) do { stepper##Q.SetParam(L6470_STALL_TH, STALL_TH_val_local); stepper##Q.SetParam(L6470_OCD_TH, OCD_TH_val_local);} while (0)
566
+
567
+      for (j = 0; j < driver_count; j++) {
568
+        set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local);
569
+        set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local);
570
+      }
571
+    }
572
+    else {
573
+      // only get & print the OVER_CURRENT values from one of the drivers
574
+      STALL_TH_val_local = get_param(axis_index[0], L6470_STALL_TH);
575
+      OCD_TH_val_local = get_param(axis_index[0], L6470_OCD_TH);
576
+
577
+      if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true);
578
+      echo_oct_used((OCD_TH_val_local + 1) * 375, false);
579
+    } // over_current_threshold
580
+
581
+    for (j = 0; j < driver_count; j++) {                 // set all drivers on axis the same
582
+      set_param(axis_index[j], L6470_STALL_TH, STALL_TH_val_local);
583
+      set_param(axis_index[j], L6470_OCD_TH, OCD_TH_val_local);
584
+    }
585
+
586
+    OCD_TH_val = OCD_TH_val_local;        // force compiler to update the main routine's copy
587
+    STALL_TH_val = STALL_TH_val_local;    // force compiler to update the main routine's copy
588
+  } // end of overcurrent
589
+
590
+  //
591
+  // Feedrate
592
+  //
593
+
594
+  final_feedrate = parser.floatval('F');
595
+  if (final_feedrate == 0) {
596
+    static constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
597
+    const uint8_t num_feedrates = COUNT(default_max_feedrate);
598
+    for (j = 0; j < num_feedrates; j++) {
599
+      if (axis_codes[j] == axis_mon[0][0]) {
600
+        final_feedrate = default_max_feedrate[j];
601
+        break;
602
+      }
603
+    }
604
+    if (j == 3 && num_feedrates > 4) {   // have more than one extruder feedrate
605
+      uint8_t extruder_num = axis_mon[0][1] - '0';
606
+      if (j <= num_feedrates - extruder_num)     // have a feedrate specifically for this extruder
607
+        final_feedrate = default_max_feedrate[j + extruder_num];
608
+      else
609
+        final_feedrate = default_max_feedrate[3];  // use E0 feedrate for this extruder
610
+    }
611
+    final_feedrate *= 60;  // convert to mm/minute
612
+  } // end of feedrate
613
+
614
+  return false;   // FALSE indicates no user input problems
615
+}
616
+
617
+void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*/) {
618
+  if (label) SERIAL_ECHOPGM("AXIS:");
619
+  const char * const str = L64xxManager.index_to_axis[axis];
620
+  SERIAL_CHAR(' ', str[0], str[1], ' ');
621
+}
622
+
623
+#if ENABLED(L6470_CHITCHAT)
624
+
625
+  // Assumes status bits have been inverted
626
+  void L64XX_Marlin::error_status_decode(const uint16_t status, const L64XX_axis_t axis,
627
+        const uint16_t _status_axis_th_sd, const uint16_t _status_axis_th_wrn,
628
+        const uint16_t _status_axis_step_loss_a, const uint16_t _status_axis_step_loss_b,
629
+        const uint16_t _status_axis_ocd, const uint8_t _status_axis_layout
630
+  ) {
631
+    say_axis(axis);
632
+    DEBUG_ECHOPGM("  THERMAL: ");
633
+    serialprintPGM((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK      "));
634
+    DEBUG_ECHOPGM("   OVERCURRENT: ");
635
+    echo_yes_no((status & _status_axis_ocd) != 0);
636
+    if (!(_status_axis_layout == L6474_STATUS_LAYOUT)) {  // L6474 doesn't have these bits
637
+      DEBUG_ECHOPGM("   STALL: ");
638
+      echo_yes_no((status & (_status_axis_step_loss_a | _status_axis_step_loss_b)) != 0);
639
+    }
640
+    DEBUG_EOL();
641
+  }
642
+
643
+#endif
644
+
645
+//////////////////////////////////////////////////////////////////////////////////////////////////
646
+////
647
+////  MONITOR_L6470_DRIVER_STATUS routines
648
+////
649
+//////////////////////////////////////////////////////////////////////////////////////////////////
650
+
651
+#if ENABLED(MONITOR_L6470_DRIVER_STATUS)
652
+
653
+  bool L64XX_Marlin::monitor_paused = false; // Flag to skip monitor during M122, M906, M916, M917, M918, etc.
654
+
655
+  struct L6470_driver_data {
656
+    uint8_t driver_index;
657
+    uint32_t driver_status;
658
+    uint8_t is_otw;
659
+    uint8_t otw_counter;
660
+    uint8_t is_ot;
661
+    uint8_t is_hi_Z;
662
+    uint8_t com_counter;
663
+  };
664
+
665
+  L6470_driver_data driver_L6470_data[] = {
666
+    #if AXIS_IS_L64XX(X)
667
+      {  0, 0, 0, 0, 0, 0, 0 },
668
+    #endif
669
+    #if AXIS_IS_L64XX(Y)
670
+      {  1, 0, 0, 0, 0, 0, 0 },
671
+    #endif
672
+    #if AXIS_IS_L64XX(Z)
673
+      {  2, 0, 0, 0, 0, 0, 0 },
674
+    #endif
675
+    #if AXIS_IS_L64XX(X2)
676
+      {  3, 0, 0, 0, 0, 0, 0 },
677
+    #endif
678
+    #if AXIS_IS_L64XX(Y2)
679
+      {  4, 0, 0, 0, 0, 0, 0 },
680
+    #endif
681
+    #if AXIS_IS_L64XX(Z2)
682
+      {  5, 0, 0, 0, 0, 0, 0 },
683
+    #endif
684
+    #if AXIS_IS_L64XX(Z3)
685
+      {  6, 0, 0, 0, 0, 0, 0 },
686
+    #endif
687
+    #if AXIS_IS_L64XX(E0)
688
+      {  7, 0, 0, 0, 0, 0, 0 },
689
+    #endif
690
+    #if AXIS_IS_L64XX(E1)
691
+      {  8, 0, 0, 0, 0, 0, 0 },
692
+    #endif
693
+    #if AXIS_IS_L64XX(E2)
694
+      {  9, 0, 0, 0, 0, 0, 0 },
695
+    #endif
696
+    #if AXIS_IS_L64XX(E3)
697
+      { 10, 0, 0, 0, 0, 0, 0 },
698
+    #endif
699
+    #if AXIS_IS_L64XX(E4)
700
+      { 11, 0, 0, 0, 0, 0, 0 },
701
+    #endif
702
+    #if AXIS_IS_L64XX(E5)
703
+      { 12, 0, 0, 0, 0, 0, 0 }
704
+    #endif
705
+  };
706
+
707
+  void L64XX_Marlin::append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err/*=nullptr*/) {
708
+    p += sprintf_P(p, PSTR("Stepper %c%c "), index_to_axis[stepper_index][0], index_to_axis[stepper_index][1]);
709
+    if (err) p += sprintf_P(p, err);
710
+  }
711
+
712
+  void L64XX_Marlin::monitor_update(L64XX_axis_t stepper_index) {
713
+    if (spi_abort) return;  // don't do anything if set_directions() has occurred
714
+    const L64XX_shadow_t &sh = shadow;
715
+    get_status(stepper_index); // get stepper status and details
716
+    uint16_t status = sh.STATUS_AXIS;
717
+    uint8_t kval_hold, tval;
718
+    char temp_buf[120], *p = temp_buf;
719
+    uint8_t j;
720
+    for (j = 0; j < L64XX::chain[0]; j++) // find the table for this stepper
721
+      if (driver_L6470_data[j].driver_index == stepper_index) break;
722
+
723
+    driver_L6470_data[j].driver_status = status;
724
+    uint16_t _status = ~status;     // all error bits are active low
725
+
726
+    if (status == 0 || status == 0xFFFF) {              // com problem
727
+      if (driver_L6470_data[j].com_counter == 0) {      // warn user when it first happens
728
+        driver_L6470_data[j].com_counter++;
729
+        append_stepper_err(p, stepper_index, PSTR(" - communications lost\n"));
730
+        DEBUG_ECHO(temp_buf);
731
+      }
732
+      else {
733
+        driver_L6470_data[j].com_counter++;
734
+        if (driver_L6470_data[j].com_counter > 240) {  // remind of com problem about every 2 minutes
735
+          driver_L6470_data[j].com_counter = 1;
736
+          append_stepper_err(p, stepper_index, PSTR(" - still no communications\n"));
737
+          DEBUG_ECHO(temp_buf);
738
+        }
739
+      }
740
+    }
741
+    else {
742
+      if (driver_L6470_data[j].com_counter) {   // comms re-established
743
+        driver_L6470_data[j].com_counter = 0;
744
+        append_stepper_err(p, stepper_index, PSTR(" - communications re-established\n.. setting all drivers to default values\n"));
745
+        DEBUG_ECHO(temp_buf);
746
+        init_to_defaults();
747
+      }
748
+      else {
749
+        // no com problems - do the usual checks
750
+        if (_status & sh.L6470_ERROR_MASK) {
751
+          append_stepper_err(p, stepper_index);
752
+
753
+          if (status & STATUS_HIZ) {                         // The driver has shut down. HiZ is active high
754
+            driver_L6470_data[j].is_hi_Z = true;
755
+            p += sprintf_P(p, PSTR("%cIS SHUT DOWN"), ' ');
756
+            //if (_status & sh.STATUS_AXIS_TH_SD) { // strange - TH_SD never seems to go active, must be implied by the HiZ and TH_WRN
757
+            if (_status & sh.STATUS_AXIS_TH_WRN) {                    // over current shutdown
758
+              p += sprintf_P(p, PSTR("%cdue to over temperature"), ' ');
759
+              driver_L6470_data[j].is_ot = true;
760
+              if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // L6474
761
+                tval = get_param(stepper_index, L6474_TVAL) - 2 * KVAL_HOLD_STEP_DOWN;
762
+              set_param(stepper_index, L6474_TVAL, tval);     // reduce TVAL
763
+                p += sprintf_P(p, PSTR(" - TVAL reduced by %d to %d mA"), uint16_t (2 * KVAL_HOLD_STEP_DOWN * sh.AXIS_STALL_CURRENT_CONSTANT_INV), uint16_t ((tval + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV));   // let user know
764
+              }
765
+              else {
766
+                kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - 2 * KVAL_HOLD_STEP_DOWN;
767
+                set_param(stepper_index, L6470_KVAL_HOLD, kval_hold);     // reduce KVAL_HOLD
768
+                p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), 2 * KVAL_HOLD_STEP_DOWN, kval_hold);   // let user know
769
+              }
770
+            }
771
+            else
772
+              driver_L6470_data[j].is_ot = false;
773
+          }
774
+          else {
775
+            driver_L6470_data[j].is_hi_Z = false;
776
+
777
+            if (_status & sh.STATUS_AXIS_TH_WRN) {     // have an over temperature warning
778
+              driver_L6470_data[j].is_otw = true;
779
+              driver_L6470_data[j].otw_counter++;
780
+              kval_hold = get_param(stepper_index, L6470_KVAL_HOLD);
781
+              if (driver_L6470_data[j].otw_counter > 4) {  // otw present for 2 - 2.5 seconds, reduce KVAL_HOLD
782
+                driver_L6470_data[j].otw_counter = 0;
783
+                driver_L6470_data[j].is_otw = true;
784
+                if (sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT) {  // L6474
785
+                  tval = get_param(stepper_index, L6474_TVAL) - KVAL_HOLD_STEP_DOWN;
786
+                  set_param(stepper_index, L6474_TVAL, tval);     // reduce TVAL
787
+                  p += sprintf_P(p, PSTR(" - TVAL reduced by %d to %d mA"), uint16_t (KVAL_HOLD_STEP_DOWN * sh.AXIS_STALL_CURRENT_CONSTANT_INV), uint16_t ((tval + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV));   // let user know
788
+                }
789
+                else {
790
+                  kval_hold = get_param(stepper_index, L6470_KVAL_HOLD) - KVAL_HOLD_STEP_DOWN;
791
+                  set_param(stepper_index, L6470_KVAL_HOLD, kval_hold);     // reduce KVAL_HOLD
792
+                  p += sprintf_P(p, PSTR(" - KVAL_HOLD reduced by %d to %d"), KVAL_HOLD_STEP_DOWN, kval_hold);   // let user know
793
+                }
794
+              }
795
+              else if (driver_L6470_data[j].otw_counter)
796
+                p += sprintf_P(p, PSTR("%c- thermal warning"), ' ');   // warn user
797
+            }
798
+          }
799
+
800
+          #if ENABLED(L6470_STOP_ON_ERROR)
801
+            if (_status & (sh.STATUS_AXIS_UVLO | sh.STATUS_AXIS_TH_WRN | sh.STATUS_AXIS_TH_SD))
802
+              kill(temp_buf);
803
+          #endif
804
+
805
+          #if ENABLED(L6470_CHITCHAT)
806
+            if (_status & sh.STATUS_AXIS_OCD)
807
+              p += sprintf_P(p, PSTR("%c  over current"), ' ');
808
+
809
+            if (_status & (sh.STATUS_AXIS_STEP_LOSS_A | sh.STATUS_AXIS_STEP_LOSS_B))
810
+              p += sprintf_P(p, PSTR("%c  stall"), ' ');
811
+
812
+            if (_status & sh.STATUS_AXIS_UVLO)
813
+              p += sprintf_P(p, PSTR("%c  under voltage lock out"), ' ');
814
+
815
+            p += sprintf_P(p, PSTR("%c\n"), ' ');
816
+          #endif
817
+
818
+          DEBUG_ECHOLN(temp_buf);  // print the error message
819
+        }
820
+        else {
821
+          driver_L6470_data[j].is_ot = false;
822
+          driver_L6470_data[j].otw_counter = 0;   //clear out warning indicators
823
+          driver_L6470_data[j].is_otw = false;
824
+        } // end usual checks
825
+
826
+      } // comms established but have errors
827
+    } // comms re-established
828
+  } // end monitor_update()
829
+
830
+
831
+  void L64XX_Marlin::monitor_driver() {
832
+    static millis_t next_cOT = 0;
833
+    if (ELAPSED(millis(), next_cOT)) {
834
+      next_cOT = millis() + 500;
835
+
836
+      if (!monitor_paused) {  // Skip during M122, M906, M916, M917 or M918 (could steal status result from test)
837
+
838
+        spi_active = true;    // Tell set_directions() a series of SPI transfers is underway
839
+
840
+        #if AXIS_IS_L64XX(X)
841
+          monitor_update(X);
842
+        #endif
843
+        #if AXIS_IS_L64XX(Y)
844
+          monitor_update(Y);
845
+        #endif
846
+        #if AXIS_IS_L64XX(Z)
847
+          monitor_update(Z);
848
+        #endif
849
+        #if AXIS_IS_L64XX(X2)
850
+          monitor_update(X2);
851
+        #endif
852
+        #if AXIS_IS_L64XX(Y2)
853
+          monitor_update(Y2);
854
+        #endif
855
+        #if AXIS_IS_L64XX(Z2)
856
+          monitor_update(Z2);
857
+        #endif
858
+        #if AXIS_IS_L64XX(Z3)
859
+          monitor_update(Z3);
860
+        #endif
861
+        #if AXIS_IS_L64XX(E0)
862
+          monitor_update(E0);
863
+        #endif
864
+        #if AXIS_IS_L64XX(E1)
865
+          monitor_update(E1);
866
+        #endif
867
+        #if AXIS_IS_L64XX(E2)
868
+          monitor_update(E2);
869
+        #endif
870
+        #if AXIS_IS_L64XX(E3)
871
+          monitor_update(E3);
872
+        #endif
873
+        #if AXIS_IS_L64XX(E4)
874
+          monitor_update(E4);
875
+        #endif
876
+        #if AXIS_IS_L64XX(E5)
877
+          monitor_update(E5);
878
+        #endif
879
+
880
+        #if ENABLED(L6470_DEBUG)
881
+          if (report_L6470_status) DEBUG_EOL();
882
+        #endif
883
+
884
+        spi_active = false;   // done with all SPI transfers - clear handshake flags
885
+        spi_abort = false;
886
+      }
887
+    }
888
+  }
889
+
890
+#endif // MONITOR_L6470_DRIVER_STATUS
891
+
892
+#endif // HAS_L64XX

+ 141
- 0
Marlin/src/libs/L64XX/L64XX_Marlin.h View File

@@ -0,0 +1,141 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+#include "../../inc/MarlinConfig.h"
25
+
26
+#include <L6470.h>
27
+#if !(L6470_LIBRARY_VERSION >= 0x000800)
28
+  #error 'L6470_LIBRARY_VERSION 0x000800 or later required'
29
+#endif
30
+
31
+#define L6470_GETPARAM(P,Q) stepper##Q.GetParam(P)
32
+
33
+#define MAX_L6470  (7 + MAX_EXTRUDERS) // Maximum number of axes in Marlin
34
+
35
+#define dSPIN_STEP_CLOCK      0x58
36
+#define dSPIN_STEP_CLOCK_FWD dSPIN_STEP_CLOCK
37
+#define dSPIN_STEP_CLOCK_REV dSPIN_STEP_CLOCK+1
38
+#define HAS_L64XX_EXTRUDER (AXIS_IS_L64XX(E0) || AXIS_IS_L64XX(E1) || AXIS_IS_L64XX(E2) || AXIS_IS_L64XX(E3) || AXIS_IS_L64XX(E4) || AXIS_IS_L64XX(E5))
39
+
40
+typedef enum : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5 } L64XX_axis_t;
41
+
42
+class L64XX_Marlin : public L64XXHelper {
43
+public:
44
+  static char index_to_axis[MAX_L6470][3];
45
+
46
+  static uint8_t index_to_dir[MAX_L6470];
47
+  static uint8_t dir_commands[MAX_L6470];
48
+
49
+  // Flags to guarantee graceful switch if stepper interrupts L6470 SPI transfer
50
+  static volatile uint8_t spi_abort;
51
+  static uint8_t spi_active;
52
+
53
+  L64XX_Marlin() {}
54
+
55
+  static void init();
56
+  static void init_to_defaults();
57
+
58
+  static uint16_t get_stepper_status(L64XX &st);
59
+
60
+  static uint16_t get_status(const L64XX_axis_t axis);
61
+
62
+  static uint32_t get_param(const L64XX_axis_t axis, const uint8_t param);
63
+
64
+  static void set_param(const L64XX_axis_t axis, const uint8_t param, const uint32_t value);
65
+
66
+  //static void send_command(const L64XX_axis_t axis, uint8_t command);
67
+
68
+  static uint8_t get_user_input(uint8_t &driver_count, L64XX_axis_t axis_index[3], char axis_mon[3][3],
69
+                            float &position_max, float &position_min, float &final_feedrate, uint8_t &kval_hold,
70
+                            uint8_t over_current_flag, uint8_t &OCD_TH_val, uint8_t &STALL_TH_val, uint16_t &over_current_threshold);
71
+
72
+  static void transfer(uint8_t L6470_buf[], const uint8_t length);
73
+
74
+  //static char* index_to_axis(const uint8_t index);
75
+  static void say_axis(const L64XX_axis_t axis, const uint8_t label=true);
76
+  #if ENABLED(L6470_CHITCHAT)
77
+    static void error_status_decode(
78
+      const uint16_t status, const L64XX_axis_t axis,
79
+      const uint16_t _status_axis_th_sd, const uint16_t _status_axis_th_wrn,
80
+      const uint16_t _status_axis_step_loss_a, const uint16_t _status_axis_step_loss_b,
81
+      const uint16_t _status_axis_ocd, const uint8_t _status_axis_layout
82
+    );
83
+  #else
84
+    FORCE_INLINE static void error_status_decode(
85
+      const uint16_t, const L64XX_axis_t,
86
+      const uint16_t, const uint16_t,
87
+      const uint16_t, const uint16_t,
88
+      const uint16_t, const uint8_t
89
+    ){}
90
+  #endif
91
+
92
+  // ~40 bytes SRAM to simplify status decode routines
93
+  typedef struct {
94
+    uint8_t STATUS_AXIS_LAYOUT;              // Copy of L6470_status_layout
95
+    uint8_t AXIS_OCD_TH_MAX;              // Size of OCD_TH field
96
+    uint8_t AXIS_STALL_TH_MAX;            // Size of STALL_TH field
97
+    float AXIS_OCD_CURRENT_CONSTANT_INV;   // mA per count
98
+    float AXIS_STALL_CURRENT_CONSTANT_INV; // mA per count
99
+    uint8_t L6470_AXIS_CONFIG,            // Address of the CONFIG register
100
+            L6470_AXIS_STATUS;            // Address of the STATUS register
101
+    uint16_t L6470_ERROR_MASK,            // STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD  | STATUS_OCD | STATUS_STEP_LOSS_A | STATUS_STEP_LOSS_B
102
+             L6474_ERROR_MASK,            // STATUS_UVLO | STATUS_TH_WRN | STATUS_TH_SD  | STATUS_OCD
103
+             STATUS_AXIS_RAW,             // Copy of status register contents
104
+             STATUS_AXIS,                 // Copy of status register contents but with all error bits active low
105
+             STATUS_AXIS_OCD,             // Overcurrent detected bit position
106
+             STATUS_AXIS_SCK_MOD,         // Step clock mode is active bit position
107
+             STATUS_AXIS_STEP_LOSS_A,     // Stall detected on A bridge bit position
108
+             STATUS_AXIS_STEP_LOSS_B,     // Stall detected on B bridge bit position
109
+             STATUS_AXIS_TH_SD,           // Thermal shutdown bit position
110
+             STATUS_AXIS_TH_WRN,          // Thermal warning bit position
111
+             STATUS_AXIS_UVLO,            // Undervoltage lockout is active bit position
112
+             STATUS_AXIS_WRONG_CMD,       // Last command not valid bit position
113
+             STATUS_AXIS_CMD_ERR,         // Command error bit position
114
+             STATUS_AXIS_NOTPERF_CMD;     // Last command not performed bit position
115
+  } L64XX_shadow_t;
116
+
117
+  static L64XX_shadow_t shadow;
118
+
119
+  #if ENABLED(MONITOR_L6470_DRIVER_STATUS)
120
+    static bool monitor_paused;
121
+    static inline void pause_monitor(const bool p) { monitor_paused = p; }
122
+    static void monitor_update(L64XX_axis_t stepper_index);
123
+    static void monitor_driver();
124
+  #else
125
+    static inline void pause_monitor(const bool) {}
126
+  #endif
127
+
128
+//protected:
129
+  // L64XXHelper methods
130
+  static void spi_init();
131
+  static uint8_t transfer_single(uint8_t data, int16_t ss_pin);
132
+  static uint8_t transfer_chain(uint8_t data, int16_t ss_pin, uint8_t chain_position);
133
+
134
+private:
135
+  static void append_stepper_err(char* &p, const uint8_t stepper_index, const char * const err=nullptr);
136
+
137
+};
138
+
139
+void echo_yes_no(const bool yes);
140
+
141
+extern L64XX_Marlin L64xxManager;

+ 98
- 0
Marlin/src/libs/L64XX/README.md View File

@@ -0,0 +1,98 @@
1
+### L64XX Stepper Driver
2
+
3
+*Arduino-L6470* library revision 0.8.0 or above is required.
4
+
5
+This software can be used with the L6470, L6474, L6480 and the powerSTEP01 (collectively referred to as "L64xx" from now on). Different drivers can be mixed within a system.
6
+
7
+These devices use voltage PWMs to drive the stepper phases. On the L6474 the phase current is controlled by the `TVAL` register. On all the other drivers the phase current is indirectly controlled via the `KVAL_HOLD` register which scales the PWM duty cycle.
8
+
9
+This software assumes that all drivers are in one SPI daisy chain.
10
+
11
+### Hardware Setup
12
+
13
+- MOSI from controller tied to SDI on the first device
14
+
15
+- SDO of the first device is tied to SDI of the next device
16
+
17
+- SDO of the last device is tied to MISO of the controller
18
+
19
+- All devices share the same `SCK` and `SS_PIN` pins. The user must supply a macro to control the `RESET_PIN`(s).
20
+
21
+- Each L6470 passes the data it saw on its SDI to its neighbor on the **NEXT** SPI cycle (8 bit delay).
22
+
23
+- Each L6470 acts on the **last** SPI data it saw when the `SS_PIN` **goes high**.
24
+
25
+The L6474 uses the standard STEP DIR interface. Phase currents are changed in response to step pulses. The direction is set by the DIR pin. Instead of an ENA pin, stepper power is controlled with SPI commands.
26
+
27
+The other drivers operate in `STEP_CLOCK` mode. In this mode the Direction / Enable functions are done with SPI commands and the phase currents are changed in response to STEP pulses.
28
+
29
+### Hardware / Software Interaction
30
+
31
+Except for the L6474, powering up a stepper and setting the direction are done by the same command. You can't do one without the other.
32
+
33
+**All** directions are set **every time** a new block is popped off the queue by the stepper ISR.
34
+
35
+When setting direction, SPI transfers are minimized by using arrays and a specialized SPI method. *Arduino-L6470* library calls are not used. For N L64xx drivers, this results in N bytes transferred. If library calls were used then N<sup>2</sup> bytes would be sent.
36
+
37
+### Power-up (Reset) Sequence
38
+
39
+- Stepper objects are instantiated before the `setup()` entry point is reached.
40
+
41
+- In `setup()` (before stepper drivers are initialized) the `L6470_init()` method is called to do the following:
42
+
43
+  - If present, pulse the hardware reset pin.
44
+
45
+  - Populate the `L6470_chain` array, which maps positions in the SPI stream to commands/data for L64XX stepper drivers.
46
+
47
+  - Initialize the L64XX Software SPI pin states.
48
+
49
+  - Initialize L64XX drivers. They may be reset later by a call to `L6470_init_to_defaults()`.
50
+
51
+The steppers are **NOT** powered up (enabled) during this sequence.
52
+
53
+### `L6470_chain` array
54
+
55
+This array is used by all routines that transmit SPI data. For a chain with N devices, the array contains:
56
+
57
+Index|Value
58
+-----|-----
59
+0|Number of drivers in chain
60
+1|Axis index of the first device in the chain (closest to MOSI)
61
+...|
62
+N|Axis index of the last device chain (closest to MISO)
63
+
64
+### Set Direction and Enable
65
+
66
+The `DIR_WRITE` macros for the L64xx drivers are written so that the standard X, Y, Z and extruder logic used by the `set_directions()` routine is not altered. These macros write the correct forward/reverse command to the corresponding location in the array `L6470_dir_commands`. On the L6474 the array the command used just enables the stepper because direction is set by the DIR pin.
67
+
68
+At the end of the `set_directions()` routine, the array `L6470_chain` is used to grab the corresponding direction/enable commands out of the array `L6470_dir_commands` and put them in the correct sequence in the array `L6470_buf`. Array `L6470_buf` is then passed to the **`void`** `L6470_Transfer` function which actually sends the data to the devices.
69
+
70
+### Utilities, etc.
71
+
72
+The **absolute position** registers should accurately reflect Marlin’s stepper position counts. They are set to zero during initialization. `G28` sets them to the Marlin counts for the corresponding axis after homing. NOTE: These registers are often the negative of the Marlin counts. This is because the Marlin counts reflect the logical direction while the registers reflect the stepper direction. The register contents are displayed via the `M114 D` command.
73
+
74
+The `L6470_monitor` feature reads the status of each device every half second. It will report if there are any error conditions present or if communications has been lost/restored. The `KVAL_HOLD` value is reduced every 2 – 2.5 seconds if the thermal warning or thermal shutdown conditions are present.
75
+
76
+**M122** displays the settings of most of the bits in the status register plus a couple of other items.
77
+
78
+**M906** can be used to set the `KVAL_HOLD` register (`TVAL` on L6474) one driver at a time. If a setting is not included with the command then the contents of the registers that affect the phase current/voltage are displayed.
79
+
80
+**M916, M917 & M918**
81
+
82
+These utilities are used to tune the system. They can get you in the ballpark for acceptable jerk, acceleration, top speed and `KVAL_HOLD` settings (`TVAL` on L6474). In general they seem to provide an overly optimistic `KVAL_HOLD` (`TVAL`) setting because of the lag between setting `KVAL_HOLD` (`TVAL`) and the driver reaching final temperature. Enabling the `L6470_monitor` feature during prints will provide the **final useful setting**.
83
+
84
+The amount of power needed to move the stepper without skipping steps increases as jerk, acceleration, top speed, and micro-steps increase. The power dissipated by the driver increases as the power to the stepper increases. The net result is a balancing act between jerk, acceleration, top speed, micro-steps, and power dissipated by the driver.
85
+
86
+**M916** - Increases `KVAL_HOLD` (`TVAL`) while moving one axis until a thermal warning is generated. This routine is also useful for determining the approximate `KVAL_HOLD` (`TVAL`) where the stepper stops losing steps. The sound will get noticeably quieter as it stops losing steps.
87
+
88
+**M917** - Find minimum current thresholds. This is accomplished by doing the following steps while moving an axis:
89
+
90
+1. Decrease OCD current until overcurrent error.
91
+
92
+2. Increase OCD until overcurrent error goes away.
93
+
94
+3. Decrease stall threshold until stall error (not available on the L6474).
95
+
96
+4. Increase stall until stall error goes away (not available on the L6474).
97
+
98
+**M918** - Increase speed until error or max feedrate achieved.

+ 28
- 26
Marlin/src/module/stepper.cpp View File

@@ -117,8 +117,10 @@ Stepper stepper; // Singleton
117 117
   #include "../feature/runout.h"
118 118
 #endif
119 119
 
120
-#if HAS_DRIVER(L6470)
121
-  #include "../libs/L6470/L6470_Marlin.h"
120
+#if HAS_L64XX
121
+  #include "../libs/L64XX/L64XX_Marlin.h"
122
+  uint8_t L6470_buf[MAX_L6470 + 1];   // chip command sequence - element 0 not used
123
+  bool L64XX_OK_to_power_up = false;  // flag to keep L64xx steppers powered down after a reset or power up
122 124
 #endif
123 125
 
124 126
 #if ENABLED(POWER_LOSS_RECOVERY)
@@ -371,21 +373,17 @@ void Stepper::wake_up() {
371 373
  */
372 374
 void Stepper::set_directions() {
373 375
 
374
-  #if HAS_DRIVER(L6470)
375
-    uint8_t L6470_buf[MAX_L6470 + 1];   // chip command sequence - element 0 not used
376
-  #endif
377
-
378 376
   #if MINIMUM_STEPPER_PRE_DIR_DELAY > 0
379 377
     DELAY_NS(MINIMUM_STEPPER_PRE_DIR_DELAY);
380 378
   #endif
381 379
 
382 380
   #define SET_STEP_DIR(A)                       \
383 381
     if (motor_direction(_AXIS(A))) {            \
384
-      A##_APPLY_DIR(INVERT_## A##_DIR, false);  \
382
+      A##_APPLY_DIR(INVERT_##A##_DIR, false);   \
385 383
       count_direction[_AXIS(A)] = -1;           \
386 384
     }                                           \
387 385
     else {                                      \
388
-      A##_APPLY_DIR(!INVERT_## A##_DIR, false); \
386
+      A##_APPLY_DIR(!INVERT_##A##_DIR, false);  \
389 387
       count_direction[_AXIS(A)] = 1;            \
390 388
     }
391 389
 
@@ -425,25 +423,25 @@ void Stepper::set_directions() {
425 423
     #endif
426 424
   #endif // !LIN_ADVANCE
427 425
 
428
-  #if HAS_DRIVER(L6470)
429
-
430
-    if (L6470.spi_active) {
431
-      L6470.spi_abort = true;                     // interrupted a SPI transfer - need to shut it down gracefully
432
-      for (uint8_t j = 1; j <= L6470::chain[0]; j++)
433
-        L6470_buf[j] = dSPIN_NOP;                 // fill buffer with NOOP commands
434
-      L6470.transfer(L6470_buf, L6470::chain[0]);  // send enough NOOPs to complete any command
435
-      L6470.transfer(L6470_buf, L6470::chain[0]);
436
-      L6470.transfer(L6470_buf, L6470::chain[0]);
437
-    }
438
-
439
-    // The L6470.dir_commands[] array holds the direction command for each stepper
426
+  #if HAS_L64XX
427
+    if (L64XX_OK_to_power_up) { // OK to send the direction commands (which powers up the L64XX steppers)
428
+      if (L64xxManager.spi_active) {
429
+        L64xxManager.spi_abort = true;                    // Interrupted SPI transfer needs to shut down gracefully
430
+        for (uint8_t j = 1; j <= L64XX::chain[0]; j++)
431
+          L6470_buf[j] = dSPIN_NOP;                         // Fill buffer with NOOPs
432
+        L64xxManager.transfer(L6470_buf, L64XX::chain[0]);  // Send enough NOOPs to complete any command
433
+        L64xxManager.transfer(L6470_buf, L64XX::chain[0]);
434
+        L64xxManager.transfer(L6470_buf, L64XX::chain[0]);
435
+      }
440 436
 
441
-    //scan command array and copy matches into L6470.transfer
442
-    for (uint8_t j = 1; j <= L6470::chain[0]; j++)
443
-      L6470_buf[j] = L6470.dir_commands[L6470::chain[j]];
437
+      // L64xxManager.dir_commands[] is an array that holds direction command for each stepper
444 438
 
445
-    L6470.transfer(L6470_buf, L6470::chain[0]);  // send the command stream to the drivers
439
+      // Scan command array, copy matches into L64xxManager.transfer
440
+      for (uint8_t j = 1; j <= L64XX::chain[0]; j++)
441
+        L6470_buf[j] = L64xxManager.dir_commands[L64XX::chain[j]];
446 442
 
443
+      L64xxManager.transfer(L6470_buf, L64XX::chain[0]);  // send the command stream to the drivers
444
+    }
447 445
   #endif
448 446
 
449 447
   // A small delay may be needed after changing direction
@@ -1846,8 +1844,8 @@ uint32_t Stepper::stepper_block_phase_isr() {
1846 1844
       #endif
1847 1845
 
1848 1846
       if (
1849
-        #if HAS_DRIVER(L6470)
1850
-          true  // Always set direction for L6470 (This also enables the chips)
1847
+        #if HAS_L64XX
1848
+          true  // Always set direction for L64xx (This also enables the chips)
1851 1849
         #else
1852 1850
           current_block->direction_bits != last_direction_bits
1853 1851
           #if DISABLED(MIXING_EXTRUDER)
@@ -1859,6 +1857,10 @@ uint32_t Stepper::stepper_block_phase_isr() {
1859 1857
         #if EXTRUDERS > 1
1860 1858
           last_moved_extruder = stepper_extruder;
1861 1859
         #endif
1860
+
1861
+        #if HAS_L64XX
1862
+          L64XX_OK_to_power_up = true;
1863
+        #endif
1862 1864
         set_directions();
1863 1865
       }
1864 1866
 

+ 0
- 143
Marlin/src/module/stepper/L6470.cpp View File

@@ -1,143 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-
23
-/**
24
- * stepper/L6470.cpp
25
- * Stepper driver indirection for L6470 drivers
26
- */
27
-
28
-#include "../../inc/MarlinConfig.h"
29
-
30
-#if HAS_DRIVER(L6470)
31
-
32
-#include "L6470.h"
33
-
34
-#define _L6470_DEFINE(ST) L6470 stepper##ST((const int)L6470_CHAIN_SS_PIN)
35
-
36
-// L6470 Stepper objects
37
-#if AXIS_DRIVER_TYPE_X(L6470)
38
-  _L6470_DEFINE(X);
39
-#endif
40
-#if AXIS_DRIVER_TYPE_X2(L6470)
41
-  _L6470_DEFINE(X2);
42
-#endif
43
-#if AXIS_DRIVER_TYPE_Y(L6470)
44
-  _L6470_DEFINE(Y);
45
-#endif
46
-#if AXIS_DRIVER_TYPE_Y2(L6470)
47
-  _L6470_DEFINE(Y2);
48
-#endif
49
-#if AXIS_DRIVER_TYPE_Z(L6470)
50
-  _L6470_DEFINE(Z);
51
-#endif
52
-#if AXIS_DRIVER_TYPE_Z2(L6470)
53
-  _L6470_DEFINE(Z2);
54
-#endif
55
-#if AXIS_DRIVER_TYPE_Z3(L6470)
56
-  _L6470_DEFINE(Z3);
57
-#endif
58
-#if AXIS_DRIVER_TYPE_E0(L6470)
59
-  _L6470_DEFINE(E0);
60
-#endif
61
-#if AXIS_DRIVER_TYPE_E1(L6470)
62
-  _L6470_DEFINE(E1);
63
-#endif
64
-#if AXIS_DRIVER_TYPE_E2(L6470)
65
-  _L6470_DEFINE(E2);
66
-#endif
67
-#if AXIS_DRIVER_TYPE_E3(L6470)
68
-  _L6470_DEFINE(E3);
69
-#endif
70
-#if AXIS_DRIVER_TYPE_E4(L6470)
71
-  _L6470_DEFINE(E4);
72
-#endif
73
-#if AXIS_DRIVER_TYPE_E5(L6470)
74
-  _L6470_DEFINE(E5);
75
-#endif
76
-
77
-// not using L6470 library's init command because it
78
-// briefly sends power to the steppers
79
-
80
-#define _L6470_INIT_CHIP(Q) do{                             \
81
-  stepper##Q.resetDev();                                    \
82
-  stepper##Q.softFree();                                    \
83
-  stepper##Q.SetParam(L6470_CONFIG, CONFIG_PWM_DIV_1        \
84
-                                  | CONFIG_PWM_MUL_2        \
85
-                                  | CONFIG_SR_290V_us       \
86
-                                  | CONFIG_OC_SD_DISABLE    \
87
-                                  | CONFIG_VS_COMP_DISABLE  \
88
-                                  | CONFIG_SW_HARD_STOP     \
89
-                                  | CONFIG_INT_16MHZ);      \
90
-  stepper##Q.SetParam(L6470_KVAL_RUN, 0xFF);                \
91
-  stepper##Q.SetParam(L6470_KVAL_ACC, 0xFF);                \
92
-  stepper##Q.SetParam(L6470_KVAL_DEC, 0xFF);                \
93
-  stepper##Q.setMicroSteps(Q##_MICROSTEPS);                 \
94
-  stepper##Q.setOverCurrent(Q##_OVERCURRENT);               \
95
-  stepper##Q.setStallCurrent(Q##_STALLCURRENT);             \
96
-  stepper##Q.SetParam(L6470_KVAL_HOLD, Q##_MAX_VOLTAGE);    \
97
-  stepper##Q.SetParam(L6470_ABS_POS, 0);                    \
98
-  stepper##Q.getStatus();                                   \
99
-}while(0)
100
-
101
-void L6470_Marlin::init_to_defaults() {
102
-  #if AXIS_DRIVER_TYPE_X(L6470)
103
-    _L6470_INIT_CHIP(X);
104
-  #endif
105
-  #if AXIS_DRIVER_TYPE_X2(L6470)
106
-    _L6470_INIT_CHIP(X2);
107
-  #endif
108
-  #if AXIS_DRIVER_TYPE_Y(L6470)
109
-    _L6470_INIT_CHIP(Y);
110
-  #endif
111
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
112
-    _L6470_INIT_CHIP(Y2);
113
-  #endif
114
-  #if AXIS_DRIVER_TYPE_Z(L6470)
115
-    _L6470_INIT_CHIP(Z);
116
-  #endif
117
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
118
-    _L6470_INIT_CHIP(Z2);
119
-  #endif
120
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
121
-    _L6470_INIT_CHIP(Z3);
122
-  #endif
123
-  #if AXIS_DRIVER_TYPE_E0(L6470)
124
-    _L6470_INIT_CHIP(E0);
125
-  #endif
126
-  #if AXIS_DRIVER_TYPE_E1(L6470)
127
-    _L6470_INIT_CHIP(E1);
128
-  #endif
129
-  #if AXIS_DRIVER_TYPE_E2(L6470)
130
-    _L6470_INIT_CHIP(E2);
131
-  #endif
132
-  #if AXIS_DRIVER_TYPE_E3(L6470)
133
-    _L6470_INIT_CHIP(E3);
134
-  #endif
135
-  #if AXIS_DRIVER_TYPE_E4(L6470)
136
-    _L6470_INIT_CHIP(E4);
137
-  #endif
138
-  #if AXIS_DRIVER_TYPE_E5(L6470)
139
-    _L6470_INIT_CHIP(E5);
140
-  #endif
141
-}
142
-
143
-#endif // L6470

+ 0
- 176
Marlin/src/module/stepper/L6470.h View File

@@ -1,176 +0,0 @@
1
-/**
2
- * Marlin 3D Printer Firmware
3
- * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
- *
21
- */
22
-#pragma once
23
-
24
-/**
25
- * stepper/L6470.h
26
- * Stepper driver indirection for L6470 drivers
27
- */
28
-
29
-#include "../../inc/MarlinConfig.h"
30
-#include "../../libs/L6470/L6470_Marlin.h"
31
-
32
-// L6470 has STEP on normal pins, but DIR/ENABLE via SPI
33
-#define L6470_WRITE_DIR_COMMAND(STATE,Q) do{ L6470_dir_commands[Q] = (STATE ?  dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD); }while(0)
34
-
35
-// X Stepper
36
-#if AXIS_DRIVER_TYPE_X(L6470)
37
-  extern L6470 stepperX;
38
-  #define X_ENABLE_INIT NOOP
39
-  #define X_ENABLE_WRITE(STATE) NOOP
40
-  #define X_ENABLE_READ() (stepperX.getStatus() & STATUS_HIZ)
41
-  #define X_DIR_INIT NOOP
42
-  #define X_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X)
43
-  #define X_DIR_READ() (stepperX.getStatus() & STATUS_DIR)
44
-#endif
45
-
46
-// Y Stepper
47
-#if AXIS_DRIVER_TYPE_Y(L6470)
48
-  extern L6470 stepperY;
49
-  #define Y_ENABLE_INIT NOOP
50
-  #define Y_ENABLE_WRITE(STATE) NOOP
51
-  #define Y_ENABLE_READ() (stepperY.getStatus() & STATUS_HIZ)
52
-  #define Y_DIR_INIT NOOP
53
-  #define Y_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y)
54
-  #define Y_DIR_READ() (stepperY.getStatus() & STATUS_DIR)
55
-#endif
56
-
57
-// Z Stepper
58
-#if AXIS_DRIVER_TYPE_Z(L6470)
59
-  extern L6470 stepperZ;
60
-  #define Z_ENABLE_INIT NOOP
61
-  #define Z_ENABLE_WRITE(STATE) NOOP
62
-  #define Z_ENABLE_READ() (stepperZ.getStatus() & STATUS_HIZ)
63
-  #define Z_DIR_INIT NOOP
64
-  #define Z_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z)
65
-  #define Z_DIR_READ() (stepperZ.getStatus() & STATUS_DIR)
66
-#endif
67
-
68
-// X2 Stepper
69
-#if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(L6470)
70
-  extern L6470 stepperX2;
71
-  #define X2_ENABLE_INIT NOOP
72
-  #define X2_ENABLE_WRITE(STATE) NOOP
73
-  #define X2_ENABLE_READ() (stepperX2.getStatus() & STATUS_HIZ)
74
-  #define X2_DIR_INIT NOOP
75
-  #define X2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,X2)
76
-  #define X2_DIR_READ() (stepperX2.getStatus() & STATUS_DIR)
77
-#endif
78
-
79
-// Y2 Stepper
80
-#if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(L6470)
81
-  extern L6470 stepperY2;
82
-  #define Y2_ENABLE_INIT NOOP
83
-  #define Y2_ENABLE_WRITE(STATE) NOOP
84
-  #define Y2_ENABLE_READ() (stepperY2.getStatus() & STATUS_HIZ)
85
-  #define Y2_DIR_INIT NOOP
86
-  #define Y2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Y2)
87
-  #define Y2_DIR_READ() (stepperY2.getStatus() & STATUS_DIR)
88
-#endif
89
-
90
-// Z2 Stepper
91
-#if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(L6470)
92
-  extern L6470 stepperZ2;
93
-  #define Z2_ENABLE_INIT NOOP
94
-  #define Z2_ENABLE_WRITE(STATE) NOOP
95
-  #define Z2_ENABLE_READ() (stepperZ2.getStatus() & STATUS_HIZ)
96
-  #define Z2_DIR_INIT NOOP
97
-  #define Z2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z2)
98
-  #define Z2_DIR_READ() (stepperZ2.getStatus() & STATUS_DIR)
99
-#endif
100
-
101
-// Z3 Stepper
102
-#if HAS_Z3_ENABLE && AXIS_DRIVER_TYPE_Z3(L6470)
103
-  extern L6470 stepperZ3;
104
-  #define Z3_ENABLE_INIT NOOP
105
-  #define Z3_ENABLE_WRITE(STATE) NOOP
106
-  #define Z3_ENABLE_READ() (stepperZ3.getStatus() & STATUS_HIZ)
107
-  #define Z3_DIR_INIT NOOP
108
-  #define Z3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,Z3)
109
-  #define Z3_DIR_READ() (stepperZ3.getStatus() & STATUS_DIR)
110
-#endif
111
-
112
-// E0 Stepper
113
-#if AXIS_DRIVER_TYPE_E0(L6470)
114
-  extern L6470 stepperE0;
115
-  #define E0_ENABLE_INIT NOOP
116
-  #define E0_ENABLE_WRITE(STATE) NOOP
117
-  #define E0_ENABLE_READ() (stepperE0.getStatus() & STATUS_HIZ)
118
-  #define E0_DIR_INIT NOOP
119
-  #define E0_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E0)
120
-  #define E0_DIR_READ() (stepperE0.getStatus() & STATUS_DIR)
121
-#endif
122
-
123
-// E1 Stepper
124
-#if AXIS_DRIVER_TYPE_E1(L6470)
125
-  extern L6470 stepperE1;
126
-  #define E1_ENABLE_INIT NOOP
127
-  #define E1_ENABLE_WRITE(STATE) NOOP
128
-  #define E1_ENABLE_READ() (stepperE1.getStatus() & STATUS_HIZ)
129
-  #define E1_DIR_INIT NOOP
130
-  #define E1_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E1)
131
-  #define E1_DIR_READ() (stepperE1.getStatus() & STATUS_DIR)
132
-#endif
133
-
134
-// E2 Stepper
135
-#if AXIS_DRIVER_TYPE_E2(L6470)
136
-  extern L6470 stepperE2;
137
-  #define E2_ENABLE_INIT NOOP
138
-  #define E2_ENABLE_WRITE(STATE) NOOP
139
-  #define E2_ENABLE_READ() (stepperE2.getStatus() & STATUS_HIZ)
140
-  #define E2_DIR_INIT NOOP
141
-  #define E2_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E2)
142
-  #define E2_DIR_READ() (stepperE2.getStatus() & STATUS_DIR)
143
-#endif
144
-
145
-// E3 Stepper
146
-#if AXIS_DRIVER_TYPE_E3(L6470)
147
-  extern L6470 stepperE3;
148
-  #define E3_ENABLE_INIT NOOP
149
-  #define E3_ENABLE_WRITE(STATE) NOOP
150
-  #define E3_ENABLE_READ() (stepperE3.getStatus() & STATUS_HIZ)
151
-  #define E3_DIR_INIT NOOP
152
-  #define E3_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E3)
153
-  #define E3_DIR_READ() (stepperE3.getStatus() & STATUS_DIR)
154
-#endif
155
-
156
-// E4 Stepper
157
-#if AXIS_DRIVER_TYPE_E4(L6470)
158
-  extern L6470 stepperE4;
159
-  #define E4_ENABLE_INIT NOOP
160
-  #define E4_ENABLE_WRITE(STATE) NOOP
161
-  #define E4_ENABLE_READ() (stepperE4.getStatus() & STATUS_HIZ)
162
-  #define E4_DIR_INIT NOOP
163
-  #define E4_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E4)
164
-  #define E4_DIR_READ() (stepperE4.getStatus() & STATUS_DIR)
165
-#endif
166
-
167
-// E5 Stepper
168
-#if AXIS_DRIVER_TYPE_E5(L6470)
169
-  extern L6470 stepperE5;
170
-  #define E5_ENABLE_INIT NOOP
171
-  #define E5_ENABLE_WRITE(STATE) NOOP
172
-  #define E5_ENABLE_READ() (stepperE5.getStatus() & STATUS_HIZ)
173
-  #define E5_DIR_INIT NOOP
174
-  #define E5_DIR_WRITE(STATE) L6470_WRITE_DIR_COMMAND(STATE,E5)
175
-  #define E5_DIR_READ() (stepperE5.getStatus() & STATUS_DIR)
176
-#endif

+ 210
- 0
Marlin/src/module/stepper/L64xx.cpp View File

@@ -0,0 +1,210 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * stepper/L64xx.cpp
25
+ * Stepper driver indirection for L64XX drivers
26
+ */
27
+
28
+#include "../../inc/MarlinConfig.h"
29
+
30
+#if HAS_L64XX
31
+
32
+#include "L64xx.h"
33
+
34
+#if AXIS_IS_L64XX(X)
35
+  L64XX_CLASS(X) stepperX(L6470_CHAIN_SS_PIN);
36
+#endif
37
+#if AXIS_IS_L64XX(X2)
38
+  L64XX_CLASS(X2) stepperX2(L6470_CHAIN_SS_PIN);
39
+#endif
40
+#if AXIS_IS_L64XX(Y)
41
+  L64XX_CLASS(Y) stepperY(L6470_CHAIN_SS_PIN);
42
+#endif
43
+#if AXIS_IS_L64XX(Y2)
44
+  L64XX_CLASS(Y2) stepperY2(L6470_CHAIN_SS_PIN);
45
+#endif
46
+#if AXIS_IS_L64XX(Z)
47
+  L64XX_CLASS(Z) stepperZ(L6470_CHAIN_SS_PIN);
48
+#endif
49
+#if AXIS_IS_L64XX(Z2)
50
+  L64XX_CLASS(Z2) stepperZ2(L6470_CHAIN_SS_PIN);
51
+#endif
52
+#if AXIS_IS_L64XX(Z3)
53
+  L64XX_CLASS(Z3) stepperZ3(L6470_CHAIN_SS_PIN);
54
+#endif
55
+#if AXIS_IS_L64XX(E0)
56
+  L64XX_CLASS(E0) stepperE0(L6470_CHAIN_SS_PIN);
57
+#endif
58
+#if AXIS_IS_L64XX(E1)
59
+  L64XX_CLASS(E1) stepperE1(L6470_CHAIN_SS_PIN);
60
+#endif
61
+#if AXIS_IS_L64XX(E2)
62
+  L64XX_CLASS(E2) stepperE2(L6470_CHAIN_SS_PIN);
63
+#endif
64
+#if AXIS_IS_L64XX(E3)
65
+  L64XX_CLASS(E3) stepperE3(L6470_CHAIN_SS_PIN);
66
+#endif
67
+#if AXIS_IS_L64XX(E4)
68
+  L64XX_CLASS(E4) stepperE4(L6470_CHAIN_SS_PIN);
69
+#endif
70
+#if AXIS_IS_L64XX(E5)
71
+  L64XX_CLASS(E5) stepperE5(L6470_CHAIN_SS_PIN);
72
+#endif
73
+
74
+// Not using L64XX class init method because it
75
+// briefly sends power to the steppers
76
+
77
+inline void L6470_init_chip(L64XX &st, const int ms, const int oc, const int sc, const int mv, const int slew_rate) {
78
+  st.set_handlers(L64xxManager.spi_init, L64xxManager.transfer_single, L64xxManager.transfer_chain);  // specify which external SPI routines to use
79
+  switch (st.L6470_status_layout) {
80
+    case L6470_STATUS_LAYOUT: {
81
+      st.resetDev();
82
+      st.softFree();
83
+      st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ);
84
+      st.SetParam(L6470_KVAL_RUN, 0xFF);
85
+      st.SetParam(L6470_KVAL_ACC, 0xFF);
86
+      st.SetParam(L6470_KVAL_DEC, 0xFF);
87
+      st.setMicroSteps(ms);
88
+      st.setOverCurrent(oc);
89
+      st.setStallCurrent(sc);
90
+      st.SetParam(L6470_KVAL_HOLD, mv);
91
+      st.SetParam(L6470_ABS_POS, 0);
92
+      uint32_t config_temp = st.GetParam(st.L64XX_CONFIG);
93
+      config_temp &= ~CONFIG_POW_SR;
94
+      switch (slew_rate) {
95
+        case 0: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_75V_us); break;
96
+        default:
97
+        case 1: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_110V_us); break;
98
+        case 3:
99
+        case 2: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_260V_us); break;
100
+      }
101
+      st.getStatus();
102
+      st.getStatus();
103
+      break;
104
+    }
105
+
106
+    case L6474_STATUS_LAYOUT: {
107
+      st.free();
108
+      //st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ);
109
+      //st.SetParam(L6474_TVAL, 0xFF);
110
+      st.setMicroSteps(ms);
111
+      st.setOverCurrent(oc);
112
+      st.setTVALCurrent(sc);
113
+      st.SetParam(L6470_ABS_POS, 0);
114
+      uint32_t config_temp = st.GetParam(st.L64XX_CONFIG);
115
+      config_temp &= ~CONFIG_POW_SR & ~CONFIG_EN_TQREG;  // clear out slew rate and set current to be controlled by TVAL register
116
+      switch (slew_rate) {
117
+        case 0: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_75V_us); break;
118
+        default:
119
+        case 1: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_110V_us); break;
120
+        case 3:
121
+        case 2: st.SetParam(st.L64XX_CONFIG, config_temp | CONFIG_SR_260V_us); break;
122
+        //case 0: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_75V_us); break;
123
+        //default:
124
+        //case 1: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_110V_us); break;
125
+        //case 3:
126
+        //case 2: st.SetParam(st.L64XX_CONFIG, 0x2E88 | CONFIG_EN_TQREG | CONFIG_SR_260V_us); break;
127
+
128
+        //case 0: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break;
129
+        //default:
130
+        //case 1: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break;
131
+        //case 3:
132
+        //case 2: st.SetParam(st.L64XX_CONFIG, 0x2E88 ); break;
133
+      }
134
+      st.getStatus();
135
+      st.getStatus();
136
+      break;
137
+    }
138
+
139
+    case L6480_STATUS_LAYOUT: {
140
+      st.resetDev();
141
+      st.softFree();
142
+      st.SetParam(st.L64XX_CONFIG, CONFIG_PWM_DIV_1 | CONFIG_PWM_MUL_2 | CONFIG_OC_SD_DISABLE | CONFIG_VS_COMP_DISABLE | CONFIG_SW_HARD_STOP | CONFIG_INT_16MHZ);
143
+      st.SetParam(L6470_KVAL_RUN, 0xFF);
144
+      st.SetParam(L6470_KVAL_ACC, 0xFF);
145
+      st.SetParam(L6470_KVAL_DEC, 0xFF);
146
+      st.setMicroSteps(ms);
147
+      st.setOverCurrent(oc);
148
+      st.setStallCurrent(sc);
149
+      st.SetParam(+-L6470_KVAL_HOLD, mv);
150
+      st.SetParam(L6470_ABS_POS, 0);
151
+      st.SetParam(st.L64XX_CONFIG,(st.GetParam(st.L64XX_CONFIG) | PWR_VCC_7_5V));
152
+      st.getStatus();     // must clear out status bits before can set slew rate
153
+      st.getStatus();
154
+      switch (slew_rate) {
155
+        case 0: st.SetParam(L6470_GATECFG1, CONFIG1_SR_220V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_220V_us); break;
156
+        default:
157
+        case 1: st.SetParam(L6470_GATECFG1, CONFIG1_SR_400V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_400V_us); break;
158
+        case 2: st.SetParam(L6470_GATECFG1, CONFIG1_SR_520V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_520V_us); break;
159
+        case 3: st.SetParam(L6470_GATECFG1, CONFIG1_SR_980V_us); st.SetParam(L6470_GATECFG2, CONFIG2_SR_980V_us); break;
160
+      }
161
+      break;
162
+    }
163
+  }
164
+}
165
+
166
+#define L6470_INIT_CHIP(Q) L6470_init_chip(stepper##Q, Q##_MICROSTEPS, Q##_OVERCURRENT, Q##_STALLCURRENT, Q##_MAX_VOLTAGE, Q##_SLEW_RATE)
167
+
168
+void L64XX_Marlin::init_to_defaults() {
169
+  #if AXIS_IS_L64XX(X)
170
+    L6470_INIT_CHIP(X);
171
+  #endif
172
+  #if AXIS_IS_L64XX(X2)
173
+    L6470_INIT_CHIP(X2);
174
+  #endif
175
+  #if AXIS_IS_L64XX(Y)
176
+    L6470_INIT_CHIP(Y);
177
+  #endif
178
+  #if AXIS_IS_L64XX(Y2)
179
+    L6470_INIT_CHIP(Y2);
180
+  #endif
181
+  #if AXIS_IS_L64XX(Z)
182
+    L6470_INIT_CHIP(Z);
183
+  #endif
184
+  #if AXIS_IS_L64XX(Z2)
185
+    L6470_INIT_CHIP(Z2);
186
+  #endif
187
+  #if AXIS_IS_L64XX(Z3)
188
+    L6470_INIT_CHIP(Z3);
189
+  #endif
190
+  #if AXIS_IS_L64XX(E0)
191
+    L6470_INIT_CHIP(E0);
192
+  #endif
193
+  #if AXIS_IS_L64XX(E1)
194
+    L6470_INIT_CHIP(E1);
195
+  #endif
196
+  #if AXIS_IS_L64XX(E2)
197
+    L6470_INIT_CHIP(E2);
198
+  #endif
199
+  #if AXIS_IS_L64XX(E3)
200
+    L6470_INIT_CHIP(E3);
201
+  #endif
202
+  #if AXIS_IS_L64XX(E4)
203
+    L6470_INIT_CHIP(E4);
204
+  #endif
205
+  #if AXIS_IS_L64XX(E5)
206
+    L6470_INIT_CHIP(E5);
207
+  #endif
208
+}
209
+
210
+#endif // HAS_L64XX

+ 263
- 0
Marlin/src/module/stepper/L64xx.h View File

@@ -0,0 +1,263 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2019 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 <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+#pragma once
23
+
24
+/**
25
+ * stepper/L64xx.h
26
+ * Stepper driver indirection for L64XX drivers
27
+ */
28
+
29
+#include "../../inc/MarlinConfig.h"
30
+#include "../../libs/L64XX/L64XX_Marlin.h"
31
+
32
+// Convert option names to L64XX classes
33
+#define CLASS_L6470       L6470
34
+#define CLASS_L6474       L6474
35
+#define CLASS_POWERSTEP01 powerSTEP01
36
+
37
+#define __L64XX_CLASS(TYPE) CLASS_##TYPE
38
+#define _L64XX_CLASS(TYPE)  __L64XX_CLASS(TYPE)
39
+#define L64XX_CLASS(ST)     _L64XX_CLASS(ST##_DRIVER_TYPE)
40
+
41
+#define L6474_DIR_WRITE(A,STATE) do{ L64xxManager.dir_commands[A] = dSPIN_L6474_ENABLE; WRITE(A##_DIR_PIN, STATE); }while(0)
42
+#define L64XX_DIR_WRITE(A,STATE) do{ L64xxManager.dir_commands[A] = (STATE) ? dSPIN_STEP_CLOCK_REV : dSPIN_STEP_CLOCK_FWD; }while(0)
43
+
44
+// X Stepper
45
+#if AXIS_IS_L64XX(X)
46
+  extern L64XX_CLASS(X)         stepperX;
47
+  #define X_ENABLE_INIT         NOOP
48
+  #define X_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperX.free())
49
+  #define X_ENABLE_READ         (stepperX.getStatus() & STATUS_HIZ)
50
+  #if AXIS_DRIVER_TYPE_X(L6474)
51
+    #define X_DIR_INIT          SET_OUTPUT(X_DIR_PIN)
52
+    #define X_DIR_WRITE(STATE)  L6474_DIR_WRITE(X, STATE)
53
+    #define X_DIR_READ          READ(X_DIR_PIN)
54
+  #else
55
+    #define X_DIR_INIT          NOOP
56
+    #define X_DIR_WRITE(STATE)  L64XX_DIR_WRITE(X, STATE)
57
+    #define X_DIR_READ          (stepper##X.getStatus() & STATUS_DIR);
58
+  #endif
59
+#endif
60
+
61
+// Y Stepper
62
+#if AXIS_IS_L64XX(Y)
63
+  extern L64XX_CLASS(Y)         stepperY;
64
+  #define Y_ENABLE_INIT         NOOP
65
+  #define Y_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperY.free())
66
+  #define Y_ENABLE_READ         (stepperY.getStatus() & STATUS_HIZ)
67
+  #if AXIS_DRIVER_TYPE_Y(L6474)
68
+    #define Y_DIR_INIT          SET_OUTPUT(Y_DIR_PIN)
69
+    #define Y_DIR_WRITE(STATE)  L6474_DIR_WRITE(Y, STATE)
70
+    #define Y_DIR_READ          READ(Y_DIR_PIN)
71
+  #else
72
+    #define Y_DIR_INIT          NOOP
73
+    #define Y_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Y, STATE)
74
+    #define Y_DIR_READ          (stepper##Y.getStatus() & STATUS_DIR);
75
+  #endif
76
+#endif
77
+
78
+// Z Stepper
79
+#if AXIS_IS_L64XX(Z)
80
+  extern L64XX_CLASS(Z)         stepperZ;
81
+  #define Z_ENABLE_INIT         NOOP
82
+  #define Z_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ.free())
83
+  #define Z_ENABLE_READ         (stepperZ.getStatus() & STATUS_HIZ)
84
+  #if AXIS_DRIVER_TYPE_Z(L6474)
85
+    #define Z_DIR_INIT          SET_OUTPUT(Z_DIR_PIN)
86
+    #define Z_DIR_WRITE(STATE)  L6474_DIR_WRITE(Z, STATE)
87
+    #define Z_DIR_READ          READ(Z_DIR_PIN)
88
+  #else
89
+    #define Z_DIR_INIT          NOOP
90
+    #define Z_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Z, STATE)
91
+    #define Z_DIR_READ          (stepper##Z.getStatus() & STATUS_DIR);
92
+  #endif
93
+#endif
94
+
95
+// X2 Stepper
96
+#if HAS_X2_ENABLE && AXIS_IS_L64XX(X2)
97
+  extern L64XX_CLASS(X2)         stepperX2;
98
+  #define X2_ENABLE_INIT         NOOP
99
+  #define X2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperX2.free())
100
+  #define X2_ENABLE_READ         (stepperX2.getStatus() & STATUS_HIZ)
101
+  #if AXIS_DRIVER_TYPE_X2(L6474)
102
+    #define X2_DIR_INIT          SET_OUTPUT(X2_DIR_PIN)
103
+    #define X2_DIR_WRITE(STATE)  L6474_DIR_WRITE(X2, STATE)
104
+    #define X2_DIR_READ          READ(X2_DIR_PIN)
105
+  #else
106
+    #define X2_DIR_INIT          NOOP
107
+    #define X2_DIR_WRITE(STATE)  L64XX_DIR_WRITE(X2, STATE)
108
+    #define X2_DIR_READ          (stepper##X2.getStatus() & STATUS_DIR);
109
+  #endif
110
+#endif
111
+
112
+// Y2 Stepper
113
+#if HAS_Y2_ENABLE && AXIS_IS_L64XX(Y2)
114
+  extern L64XX_CLASS(Y2)         stepperY2;
115
+  #define Y2_ENABLE_INIT         NOOP
116
+  #define Y2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperY2.free())
117
+  #define Y2_ENABLE_READ         (stepperY2.getStatus() & STATUS_HIZ)
118
+  #if AXIS_DRIVER_TYPE_Y2(L6474)
119
+    #define Y2_DIR_INIT          SET_OUTPUT(Y2_DIR_PIN)
120
+    #define Y2_DIR_WRITE(STATE)  L6474_DIR_WRITE(Y2, STATE)
121
+    #define Y2_DIR_READ          READ(Y2_DIR_PIN)
122
+  #else
123
+    #define Y2_DIR_INIT          NOOP
124
+    #define Y2_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Y2, STATE)
125
+    #define Y2_DIR_READ          (stepper##Y2.getStatus() & STATUS_DIR);
126
+  #endif
127
+#endif
128
+
129
+// Z2 Stepper
130
+#if HAS_Z2_ENABLE && AXIS_IS_L64XX(Z2)
131
+  extern L64XX_CLASS(Z2)         stepperZ2;
132
+  #define Z2_ENABLE_INIT         NOOP
133
+  #define Z2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ2.free())
134
+  #define Z2_ENABLE_READ         (stepperZ2.getStatus() & STATUS_HIZ)
135
+  #if AXIS_DRIVER_TYPE_Z2(L6474)
136
+    #define Z2_DIR_INIT          SET_OUTPUT(Z2_DIR_PIN)
137
+    #define Z2_DIR_WRITE(STATE)  L6474_DIR_WRITE(Z2, STATE)
138
+    #define Z2_DIR_READ          READ(Z2_DIR_PIN)
139
+  #else
140
+    #define Z2_DIR_INIT          NOOP
141
+    #define Z2_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Z2, STATE)
142
+    #define Z2_DIR_READ          (stepper##Z2.getStatus() & STATUS_DIR);
143
+  #endif
144
+#endif
145
+
146
+// Z3 Stepper
147
+#if HAS_Z3_ENABLE && AXIS_IS_L64XX(Z3)
148
+  extern L64XX_CLASS(Z3)         stepperZ3;
149
+  #define Z3_ENABLE_INIT         NOOP
150
+  #define Z3_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperZ3.free())
151
+  #define Z3_ENABLE_READ         (stepperZ3.getStatus() & STATUS_HIZ)
152
+  #if AXIS_DRIVER_TYPE_Z3(L6474)
153
+    #define Z3_DIR_INIT          SET_OUTPUT(Z3_DIR_PIN)
154
+    #define Z3_DIR_WRITE(STATE)  L6474_DIR_WRITE(Z3, STATE)
155
+    #define Z3_DIR_READ          READ(Z3_DIR_PIN)
156
+  #else
157
+    #define Z3_DIR_INIT          NOOP
158
+    #define Z3_DIR_WRITE(STATE)  L64XX_DIR_WRITE(Z3, STATE)
159
+    #define Z3_DIR_READ          (stepper##Z3.getStatus() & STATUS_DIR);
160
+  #endif
161
+#endif
162
+
163
+// E0 Stepper
164
+#if AXIS_IS_L64XX(E0)
165
+  extern L64XX_CLASS(E0)         stepperE0;
166
+  #define E0_ENABLE_INIT         NOOP
167
+  #define E0_ENABLE_WRITE(STATE)  (STATE ? NOOP : stepperE0.free())
168
+  #define E0_ENABLE_READ         (stepperE0.getStatus() & STATUS_HIZ)
169
+  #if AXIS_DRIVER_TYPE_E0(L6474)
170
+    #define E0_DIR_INIT          SET_OUTPUT(E0_DIR_PIN)
171
+    #define E0_DIR_WRITE(STATE)  L6474_DIR_WRITE(E0, STATE)
172
+    #define E0_DIR_READ          READ(E0_DIR_PIN)
173
+  #else
174
+    #define E0_DIR_INIT          NOOP
175
+    #define E0_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E0, STATE)
176
+    #define E0_DIR_READ          (stepper##E0.getStatus() & STATUS_DIR);
177
+  #endif
178
+#endif
179
+
180
+// E1 Stepper
181
+#if AXIS_IS_L64XX(E1)
182
+  extern L64XX_CLASS(E1)         stepperE1;
183
+  #define E1_ENABLE_INIT         NOOP
184
+  #define E1_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE1.free())
185
+  #define E1_ENABLE_READ         (stepperE1.getStatus() & STATUS_HIZ)
186
+  #if AXIS_DRIVER_TYPE_E1(L6474)
187
+    #define E1_DIR_INIT          SET_OUTPUT(E1_DIR_PIN)
188
+    #define E1_DIR_WRITE(STATE)  L6474_DIR_WRITE(E1, STATE)
189
+    #define E1_DIR_READ          READ(E1_DIR_PIN)
190
+  #else
191
+    #define E1_DIR_INIT          NOOP
192
+    #define E1_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E1, STATE)
193
+    #define E1_DIR_READ          (stepper##E1.getStatus() & STATUS_DIR);
194
+  #endif
195
+#endif
196
+
197
+// E2 Stepper
198
+#if AXIS_IS_L64XX(E2)
199
+  extern L64XX_CLASS(E2)         stepperE2;
200
+  #define E2_ENABLE_INIT         NOOP
201
+  #define E2_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE2.free())
202
+  #define E2_ENABLE_READ         (stepperE2.getStatus() & STATUS_HIZ)
203
+  #if AXIS_DRIVER_TYPE_E2(L6474)
204
+    #define E2_DIR_INIT          SET_OUTPUT(E2_DIR_PIN)
205
+    #define E2_DIR_WRITE(STATE)  L6474_DIR_WRITE(E2, STATE)
206
+    #define E2_DIR_READ          READ(E2_DIR_PIN)
207
+  #else
208
+    #define E2_DIR_INIT          NOOP
209
+    #define E2_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E2, STATE)
210
+    #define E2_DIR_READ          (stepper##E2.getStatus() & STATUS_DIR);
211
+  #endif
212
+#endif
213
+
214
+// E3 Stepper
215
+#if AXIS_IS_L64XX(E3)
216
+  extern L64XX_CLASS(E3)         stepperE3;
217
+  #define E3_ENABLE_INIT         NOOP
218
+  #define E3_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE3.free())
219
+  #define E3_ENABLE_READ         (stepperE3.getStatus() & STATUS_HIZ)
220
+  #if AXIS_DRIVER_TYPE_E3(L6474)
221
+    #define E3_DIR_INIT          SET_OUTPUT(E3_DIR_PIN)
222
+    #define E3_DIR_WRITE(STATE)  L6474_DIR_WRITE(E3, STATE)
223
+    #define E3_DIR_READ          READ(E3_DIR_PIN)
224
+  #else
225
+    #define E3_DIR_INIT          NOOP
226
+    #define E3_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E3, STATE)
227
+    #define E3_DIR_READ          (stepper##E3.getStatus() & STATUS_DIR);
228
+  #endif
229
+#endif
230
+
231
+// E4 Stepper
232
+#if AXIS_IS_L64XX(E4)
233
+  extern L64XX_CLASS(E4)         stepperE4;
234
+  #define E4_ENABLE_INIT         NOOP
235
+  #define E4_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE4.free())
236
+  #define E4_ENABLE_READ         (stepperE4.getStatus() & STATUS_HIZ)
237
+  #if AXIS_DRIVER_TYPE_E4(L6474)
238
+    #define E4_DIR_INIT          SET_OUTPUT(E4_DIR_PIN)
239
+    #define E4_DIR_WRITE(STATE)  L6474_DIR_WRITE(E4, STATE)
240
+    #define E4_DIR_READ          READ(E4_DIR_PIN)
241
+  #else
242
+    #define E4_DIR_INIT          NOOP
243
+    #define E4_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E4, STATE)
244
+    #define E4_DIR_READ          (stepper##E4.getStatus() & STATUS_DIR);
245
+  #endif
246
+#endif
247
+
248
+// E5 Stepper
249
+#if AXIS_IS_L64XX(E5)
250
+  extern L64XX_CLASS(E5)         stepperE5;
251
+  #define E5_ENABLE_INIT         NOOP
252
+  #define E5_ENABLE_WRITE(STATE) (STATE ? NOOP : stepperE5.free())
253
+  #define E5_ENABLE_READ         (stepperE5.getStatus() & STATUS_HIZ)
254
+  #if AXIS_DRIVER_TYPE_E5(L6474)
255
+    #define E5_DIR_INIT          SET_OUTPUT(E5_DIR_PIN)
256
+    #define E5_DIR_WRITE(STATE)  L6474_DIR_WRITE(E5, STATE)
257
+    #define E5_DIR_READ          READ(E5_DIR_PIN)
258
+  #else
259
+    #define E5_DIR_INIT          NOOP
260
+    #define E5_DIR_WRITE(STATE)  L64XX_DIR_WRITE(E5, STATE)
261
+    #define E5_DIR_READ          (stepper##E5.getStatus() & STATUS_DIR);
262
+  #endif
263
+#endif

+ 2
- 2
Marlin/src/module/stepper/indirection.cpp View File

@@ -43,8 +43,8 @@ void reset_stepper_drivers() {
43 43
     tmc26x_init_to_defaults();
44 44
   #endif
45 45
 
46
-  #if HAS_DRIVER(L6470)
47
-    L6470.init_to_defaults();
46
+  #if HAS_L64XX
47
+    L64xxManager.init_to_defaults();
48 48
   #endif
49 49
 
50 50
   #if HAS_TRINAMIC

+ 2
- 2
Marlin/src/module/stepper/indirection.h View File

@@ -32,8 +32,8 @@
32 32
 
33 33
 #include "../../inc/MarlinConfig.h"
34 34
 
35
-#if HAS_DRIVER(L6470)
36
-  #include "L6470.h"
35
+#if HAS_L64XX
36
+  #include "L64xx.h"
37 37
 #endif
38 38
 
39 39
 #if HAS_DRIVER(TMC26X)

+ 9
- 1
buildroot/share/tests/megaatmega2560-tests View File

@@ -297,8 +297,16 @@ exec_test $1 $2 "Full-featured CR-10S config"
297 297
 # Delta Config (generic) + ABL bilinear + BLTOUCH
298 298
 use_example_configs delta/generic
299 299
 opt_set LCD_LANGUAGE cz
300
+opt_set X_DRIVER_TYPE L6470
301
+opt_set Y_DRIVER_TYPE L6470
302
+opt_set Z_DRIVER_TYPE L6470
303
+opt_add L6470_CHAIN_SCK_PIN  53
304
+opt_add L6470_CHAIN_MISO_PIN 49
305
+opt_add L6470_CHAIN_MOSI_PIN 40
306
+opt_add L6470_CHAIN_SS_PIN   42
307
+opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP"
300 308
 opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH
301
-exec_test $1 $2 "RAMPS | DELTA | RRD LCD | ABL Bilinear | BLTOUCH"
309
+exec_test $1 $2 "DELTA | L6470 | RRD LCD | ABL Bilinear | BLTOUCH"
302 310
 
303 311
 #
304 312
 # Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS

+ 3
- 2
config/default/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/default/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/3DFabXYZ/Migbot/Configuration.h View File

@@ -660,12 +660,13 @@
660 660
  *
661 661
  * A4988 is assumed for unspecified drivers.
662 662
  *
663
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
663
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
664
+ *          TB6560, TB6600, TMC2100,
664 665
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
665 666
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
666 667
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
667 668
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
668
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
669
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
669 670
  */
670 671
 //#define X_DRIVER_TYPE  A4988
671 672
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/3DFabXYZ/Migbot/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/ADIMLab/Gantry v1/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 #define X_DRIVER_TYPE  A4988
665 666
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/ADIMLab/Gantry v1/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/ADIMLab/Gantry v2/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 #define X_DRIVER_TYPE  A4988
665 666
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/ADIMLab/Gantry v2/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/AlephObjects/TAZ4/Configuration.h View File

@@ -674,12 +674,13 @@
674 674
  *
675 675
  * A4988 is assumed for unspecified drivers.
676 676
  *
677
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
677
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
678
+ *          TB6560, TB6600, TMC2100,
678 679
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
679 680
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
680 681
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
681 682
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
682
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
683
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
683 684
  */
684 685
 //#define X_DRIVER_TYPE  A4988
685 686
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/AlephObjects/TAZ4/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Alfawise/U20-bltouch/Configuration.h View File

@@ -717,12 +717,13 @@
717 717
  *
718 718
  * A4988 is assumed for unspecified drivers.
719 719
  *
720
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
720
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
721
+ *          TB6560, TB6600, TMC2100,
721 722
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
722 723
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
723 724
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
724 725
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
725
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
726
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
726 727
  */
727 728
 #define X_DRIVER_TYPE  A4988
728 729
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Alfawise/U20-bltouch/Configuration_adv.h View File

@@ -2219,12 +2219,12 @@
2219 2219
 
2220 2220
 #endif // HAS_TRINAMIC
2221 2221
 
2222
-// @section L6470
2222
+// @section L64XX
2223 2223
 
2224 2224
 /**
2225
- * L6470 Stepper Driver options
2225
+ * L64XX Stepper Driver options
2226 2226
  *
2227
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2227
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2228 2228
  * https://github.com/ameyer/Arduino-L6470
2229 2229
  *
2230 2230
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2232,114 +2232,133 @@
2232 2232
  *     L6470_CHAIN_MISO_PIN
2233 2233
  *     L6470_CHAIN_MOSI_PIN
2234 2234
  *     L6470_CHAIN_SS_PIN
2235
- *     L6470_RESET_CHAIN_PIN  (optional)
2235
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2236 2236
  */
2237
-#if HAS_DRIVER(L6470)
2238 2237
 
2239
-  //#define L6470_CHITCHAT        // Display additional status info
2238
+#if HAS_L64XX
2240 2239
 
2241
-  #if AXIS_DRIVER_TYPE_X(L6470)
2242
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2243
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2244
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2245
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2246
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2247
-  #endif
2240
+  //#define L6470_CHITCHAT        // Display additional status info
2248 2241
 
2249
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2242
+  #if AXIS_IS_L64XX(X)
2243
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2244
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2245
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2246
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2247
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2248
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2249
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2250
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2251
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2252
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2253
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2254
+  #endif
2255
+
2256
+  #if AXIS_IS_L64XX(X2)
2250 2257
     #define X2_MICROSTEPS      128
2251 2258
     #define X2_OVERCURRENT    2000
2252 2259
     #define X2_STALLCURRENT   1500
2253 2260
     #define X2_MAX_VOLTAGE     127
2254 2261
     #define X2_CHAIN_POS        -1
2262
+    #define X2_SLEW_RATE         1
2255 2263
   #endif
2256 2264
 
2257
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2265
+  #if AXIS_IS_L64XX(Y)
2258 2266
     #define Y_MICROSTEPS       128
2259 2267
     #define Y_OVERCURRENT     2000
2260 2268
     #define Y_STALLCURRENT    1500
2261 2269
     #define Y_MAX_VOLTAGE      127
2262 2270
     #define Y_CHAIN_POS         -1
2271
+    #define Y_SLEW_RATE          1
2263 2272
   #endif
2264 2273
 
2265
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2274
+  #if AXIS_IS_L64XX(Y2)
2266 2275
     #define Y2_MICROSTEPS      128
2267 2276
     #define Y2_OVERCURRENT    2000
2268 2277
     #define Y2_STALLCURRENT   1500
2269 2278
     #define Y2_MAX_VOLTAGE     127
2270 2279
     #define Y2_CHAIN_POS        -1
2280
+    #define Y2_SLEW_RATE         1
2271 2281
   #endif
2272 2282
 
2273
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2283
+  #if AXIS_IS_L64XX(Z)
2274 2284
     #define Z_MICROSTEPS       128
2275 2285
     #define Z_OVERCURRENT     2000
2276 2286
     #define Z_STALLCURRENT    1500
2277 2287
     #define Z_MAX_VOLTAGE      127
2278 2288
     #define Z_CHAIN_POS         -1
2289
+    #define Z_SLEW_RATE          1
2279 2290
   #endif
2280 2291
 
2281
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2292
+  #if AXIS_IS_L64XX(Z2)
2282 2293
     #define Z2_MICROSTEPS      128
2283 2294
     #define Z2_OVERCURRENT    2000
2284 2295
     #define Z2_STALLCURRENT   1500
2285 2296
     #define Z2_MAX_VOLTAGE     127
2286 2297
     #define Z2_CHAIN_POS        -1
2298
+    #define Z2_SLEW_RATE         1
2287 2299
   #endif
2288 2300
 
2289
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2301
+  #if AXIS_IS_L64XX(Z3)
2290 2302
     #define Z3_MICROSTEPS      128
2291 2303
     #define Z3_OVERCURRENT    2000
2292 2304
     #define Z3_STALLCURRENT   1500
2293 2305
     #define Z3_MAX_VOLTAGE     127
2294 2306
     #define Z3_CHAIN_POS        -1
2307
+    #define Z3_SLEW_RATE         1
2295 2308
   #endif
2296 2309
 
2297
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2310
+  #if AXIS_IS_L64XX(E0)
2298 2311
     #define E0_MICROSTEPS      128
2299 2312
     #define E0_OVERCURRENT    2000
2300 2313
     #define E0_STALLCURRENT   1500
2301 2314
     #define E0_MAX_VOLTAGE     127
2302 2315
     #define E0_CHAIN_POS        -1
2316
+    #define E0_SLEW_RATE         1
2303 2317
   #endif
2304 2318
 
2305
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2319
+  #if AXIS_IS_L64XX(E1)
2306 2320
     #define E1_MICROSTEPS      128
2307 2321
     #define E1_OVERCURRENT    2000
2308 2322
     #define E1_STALLCURRENT   1500
2309 2323
     #define E1_MAX_VOLTAGE     127
2310 2324
     #define E1_CHAIN_POS        -1
2325
+    #define E1_SLEW_RATE         1
2311 2326
   #endif
2312 2327
 
2313
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2328
+  #if AXIS_IS_L64XX(E2)
2314 2329
     #define E2_MICROSTEPS      128
2315 2330
     #define E2_OVERCURRENT    2000
2316 2331
     #define E2_STALLCURRENT   1500
2317 2332
     #define E2_MAX_VOLTAGE     127
2318 2333
     #define E2_CHAIN_POS        -1
2334
+    #define E2_SLEW_RATE         1
2319 2335
   #endif
2320 2336
 
2321
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2337
+  #if AXIS_IS_L64XX(E3)
2322 2338
     #define E3_MICROSTEPS      128
2323 2339
     #define E3_OVERCURRENT    2000
2324 2340
     #define E3_STALLCURRENT   1500
2325 2341
     #define E3_MAX_VOLTAGE     127
2326 2342
     #define E3_CHAIN_POS        -1
2343
+    #define E3_SLEW_RATE         1
2327 2344
   #endif
2328 2345
 
2329
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2346
+  #if AXIS_IS_L64XX(E4)
2330 2347
     #define E4_MICROSTEPS      128
2331 2348
     #define E4_OVERCURRENT    2000
2332 2349
     #define E4_STALLCURRENT   1500
2333 2350
     #define E4_MAX_VOLTAGE     127
2334 2351
     #define E4_CHAIN_POS        -1
2352
+    #define E4_SLEW_RATE         1
2335 2353
   #endif
2336 2354
 
2337
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2355
+  #if AXIS_IS_L64XX(E5)
2338 2356
     #define E5_MICROSTEPS      128
2339 2357
     #define E5_OVERCURRENT    2000
2340 2358
     #define E5_STALLCURRENT   1500
2341 2359
     #define E5_MAX_VOLTAGE     127
2342 2360
     #define E5_CHAIN_POS        -1
2361
+    #define E5_SLEW_RATE         1
2343 2362
   #endif
2344 2363
 
2345 2364
   /**
@@ -2365,7 +2384,7 @@
2365 2384
     //#define L6470_STOP_ON_ERROR
2366 2385
   #endif
2367 2386
 
2368
-#endif // L6470
2387
+#endif // HAS_L64XX
2369 2388
 
2370 2389
 /**
2371 2390
  * TWI/I2C BUS

+ 3
- 2
config/examples/Alfawise/U20/Configuration.h View File

@@ -717,12 +717,13 @@
717 717
  *
718 718
  * A4988 is assumed for unspecified drivers.
719 719
  *
720
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
720
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
721
+ *          TB6560, TB6600, TMC2100,
721 722
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
722 723
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
723 724
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
724 725
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
725
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
726
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
726 727
  */
727 728
 #define X_DRIVER_TYPE  A4988
728 729
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Alfawise/U20/Configuration_adv.h View File

@@ -2218,12 +2218,12 @@
2218 2218
 
2219 2219
 #endif // HAS_TRINAMIC
2220 2220
 
2221
-// @section L6470
2221
+// @section L64XX
2222 2222
 
2223 2223
 /**
2224
- * L6470 Stepper Driver options
2224
+ * L64XX Stepper Driver options
2225 2225
  *
2226
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2226
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2227 2227
  * https://github.com/ameyer/Arduino-L6470
2228 2228
  *
2229 2229
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2231,114 +2231,133 @@
2231 2231
  *     L6470_CHAIN_MISO_PIN
2232 2232
  *     L6470_CHAIN_MOSI_PIN
2233 2233
  *     L6470_CHAIN_SS_PIN
2234
- *     L6470_RESET_CHAIN_PIN  (optional)
2234
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2235 2235
  */
2236
-#if HAS_DRIVER(L6470)
2237 2236
 
2238
-  //#define L6470_CHITCHAT        // Display additional status info
2237
+#if HAS_L64XX
2239 2238
 
2240
-  #if AXIS_DRIVER_TYPE_X(L6470)
2241
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2242
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2243
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2244
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2245
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2246
-  #endif
2239
+  //#define L6470_CHITCHAT        // Display additional status info
2247 2240
 
2248
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2241
+  #if AXIS_IS_L64XX(X)
2242
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2243
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2244
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2245
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2246
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2247
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2248
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2249
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2250
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2251
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2252
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2253
+  #endif
2254
+
2255
+  #if AXIS_IS_L64XX(X2)
2249 2256
     #define X2_MICROSTEPS      128
2250 2257
     #define X2_OVERCURRENT    2000
2251 2258
     #define X2_STALLCURRENT   1500
2252 2259
     #define X2_MAX_VOLTAGE     127
2253 2260
     #define X2_CHAIN_POS        -1
2261
+    #define X2_SLEW_RATE         1
2254 2262
   #endif
2255 2263
 
2256
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2264
+  #if AXIS_IS_L64XX(Y)
2257 2265
     #define Y_MICROSTEPS       128
2258 2266
     #define Y_OVERCURRENT     2000
2259 2267
     #define Y_STALLCURRENT    1500
2260 2268
     #define Y_MAX_VOLTAGE      127
2261 2269
     #define Y_CHAIN_POS         -1
2270
+    #define Y_SLEW_RATE          1
2262 2271
   #endif
2263 2272
 
2264
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2273
+  #if AXIS_IS_L64XX(Y2)
2265 2274
     #define Y2_MICROSTEPS      128
2266 2275
     #define Y2_OVERCURRENT    2000
2267 2276
     #define Y2_STALLCURRENT   1500
2268 2277
     #define Y2_MAX_VOLTAGE     127
2269 2278
     #define Y2_CHAIN_POS        -1
2279
+    #define Y2_SLEW_RATE         1
2270 2280
   #endif
2271 2281
 
2272
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2282
+  #if AXIS_IS_L64XX(Z)
2273 2283
     #define Z_MICROSTEPS       128
2274 2284
     #define Z_OVERCURRENT     2000
2275 2285
     #define Z_STALLCURRENT    1500
2276 2286
     #define Z_MAX_VOLTAGE      127
2277 2287
     #define Z_CHAIN_POS         -1
2288
+    #define Z_SLEW_RATE          1
2278 2289
   #endif
2279 2290
 
2280
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2291
+  #if AXIS_IS_L64XX(Z2)
2281 2292
     #define Z2_MICROSTEPS      128
2282 2293
     #define Z2_OVERCURRENT    2000
2283 2294
     #define Z2_STALLCURRENT   1500
2284 2295
     #define Z2_MAX_VOLTAGE     127
2285 2296
     #define Z2_CHAIN_POS        -1
2297
+    #define Z2_SLEW_RATE         1
2286 2298
   #endif
2287 2299
 
2288
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2300
+  #if AXIS_IS_L64XX(Z3)
2289 2301
     #define Z3_MICROSTEPS      128
2290 2302
     #define Z3_OVERCURRENT    2000
2291 2303
     #define Z3_STALLCURRENT   1500
2292 2304
     #define Z3_MAX_VOLTAGE     127
2293 2305
     #define Z3_CHAIN_POS        -1
2306
+    #define Z3_SLEW_RATE         1
2294 2307
   #endif
2295 2308
 
2296
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2309
+  #if AXIS_IS_L64XX(E0)
2297 2310
     #define E0_MICROSTEPS      128
2298 2311
     #define E0_OVERCURRENT    2000
2299 2312
     #define E0_STALLCURRENT   1500
2300 2313
     #define E0_MAX_VOLTAGE     127
2301 2314
     #define E0_CHAIN_POS        -1
2315
+    #define E0_SLEW_RATE         1
2302 2316
   #endif
2303 2317
 
2304
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2318
+  #if AXIS_IS_L64XX(E1)
2305 2319
     #define E1_MICROSTEPS      128
2306 2320
     #define E1_OVERCURRENT    2000
2307 2321
     #define E1_STALLCURRENT   1500
2308 2322
     #define E1_MAX_VOLTAGE     127
2309 2323
     #define E1_CHAIN_POS        -1
2324
+    #define E1_SLEW_RATE         1
2310 2325
   #endif
2311 2326
 
2312
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2327
+  #if AXIS_IS_L64XX(E2)
2313 2328
     #define E2_MICROSTEPS      128
2314 2329
     #define E2_OVERCURRENT    2000
2315 2330
     #define E2_STALLCURRENT   1500
2316 2331
     #define E2_MAX_VOLTAGE     127
2317 2332
     #define E2_CHAIN_POS        -1
2333
+    #define E2_SLEW_RATE         1
2318 2334
   #endif
2319 2335
 
2320
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2336
+  #if AXIS_IS_L64XX(E3)
2321 2337
     #define E3_MICROSTEPS      128
2322 2338
     #define E3_OVERCURRENT    2000
2323 2339
     #define E3_STALLCURRENT   1500
2324 2340
     #define E3_MAX_VOLTAGE     127
2325 2341
     #define E3_CHAIN_POS        -1
2342
+    #define E3_SLEW_RATE         1
2326 2343
   #endif
2327 2344
 
2328
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2345
+  #if AXIS_IS_L64XX(E4)
2329 2346
     #define E4_MICROSTEPS      128
2330 2347
     #define E4_OVERCURRENT    2000
2331 2348
     #define E4_STALLCURRENT   1500
2332 2349
     #define E4_MAX_VOLTAGE     127
2333 2350
     #define E4_CHAIN_POS        -1
2351
+    #define E4_SLEW_RATE         1
2334 2352
   #endif
2335 2353
 
2336
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2354
+  #if AXIS_IS_L64XX(E5)
2337 2355
     #define E5_MICROSTEPS      128
2338 2356
     #define E5_OVERCURRENT    2000
2339 2357
     #define E5_STALLCURRENT   1500
2340 2358
     #define E5_MAX_VOLTAGE     127
2341 2359
     #define E5_CHAIN_POS        -1
2360
+    #define E5_SLEW_RATE         1
2342 2361
   #endif
2343 2362
 
2344 2363
   /**
@@ -2364,7 +2383,7 @@
2364 2383
     //#define L6470_STOP_ON_ERROR
2365 2384
   #endif
2366 2385
 
2367
-#endif // L6470
2386
+#endif // HAS_L64XX
2368 2387
 
2369 2388
 /**
2370 2389
  * TWI/I2C BUS

+ 3
- 2
config/examples/AliExpress/CL-260/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 3
- 2
config/examples/AliExpress/UM2pExt/Configuration.h View File

@@ -665,12 +665,13 @@
665 665
  *
666 666
  * A4988 is assumed for unspecified drivers.
667 667
  *
668
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
668
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
669
+ *          TB6560, TB6600, TMC2100,
669 670
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
670 671
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
671 672
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
672 673
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
673
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
674
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
674 675
  */
675 676
 //#define X_DRIVER_TYPE  A4988
676 677
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/AliExpress/UM2pExt/Configuration_adv.h View File

@@ -2219,12 +2219,12 @@
2219 2219
 
2220 2220
 #endif // HAS_TRINAMIC
2221 2221
 
2222
-// @section L6470
2222
+// @section L64XX
2223 2223
 
2224 2224
 /**
2225
- * L6470 Stepper Driver options
2225
+ * L64XX Stepper Driver options
2226 2226
  *
2227
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2227
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2228 2228
  * https://github.com/ameyer/Arduino-L6470
2229 2229
  *
2230 2230
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2232,114 +2232,133 @@
2232 2232
  *     L6470_CHAIN_MISO_PIN
2233 2233
  *     L6470_CHAIN_MOSI_PIN
2234 2234
  *     L6470_CHAIN_SS_PIN
2235
- *     L6470_RESET_CHAIN_PIN  (optional)
2235
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2236 2236
  */
2237
-#if HAS_DRIVER(L6470)
2238 2237
 
2239
-  //#define L6470_CHITCHAT        // Display additional status info
2238
+#if HAS_L64XX
2240 2239
 
2241
-  #if AXIS_DRIVER_TYPE_X(L6470)
2242
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2243
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2244
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2245
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2246
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2247
-  #endif
2240
+  //#define L6470_CHITCHAT        // Display additional status info
2248 2241
 
2249
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2242
+  #if AXIS_IS_L64XX(X)
2243
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2244
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2245
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2246
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2247
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2248
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2249
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2250
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2251
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2252
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2253
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2254
+  #endif
2255
+
2256
+  #if AXIS_IS_L64XX(X2)
2250 2257
     #define X2_MICROSTEPS      128
2251 2258
     #define X2_OVERCURRENT    2000
2252 2259
     #define X2_STALLCURRENT   1500
2253 2260
     #define X2_MAX_VOLTAGE     127
2254 2261
     #define X2_CHAIN_POS        -1
2262
+    #define X2_SLEW_RATE         1
2255 2263
   #endif
2256 2264
 
2257
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2265
+  #if AXIS_IS_L64XX(Y)
2258 2266
     #define Y_MICROSTEPS       128
2259 2267
     #define Y_OVERCURRENT     2000
2260 2268
     #define Y_STALLCURRENT    1500
2261 2269
     #define Y_MAX_VOLTAGE      127
2262 2270
     #define Y_CHAIN_POS         -1
2271
+    #define Y_SLEW_RATE          1
2263 2272
   #endif
2264 2273
 
2265
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2274
+  #if AXIS_IS_L64XX(Y2)
2266 2275
     #define Y2_MICROSTEPS      128
2267 2276
     #define Y2_OVERCURRENT    2000
2268 2277
     #define Y2_STALLCURRENT   1500
2269 2278
     #define Y2_MAX_VOLTAGE     127
2270 2279
     #define Y2_CHAIN_POS        -1
2280
+    #define Y2_SLEW_RATE         1
2271 2281
   #endif
2272 2282
 
2273
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2283
+  #if AXIS_IS_L64XX(Z)
2274 2284
     #define Z_MICROSTEPS       128
2275 2285
     #define Z_OVERCURRENT     2000
2276 2286
     #define Z_STALLCURRENT    1500
2277 2287
     #define Z_MAX_VOLTAGE      127
2278 2288
     #define Z_CHAIN_POS         -1
2289
+    #define Z_SLEW_RATE          1
2279 2290
   #endif
2280 2291
 
2281
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2292
+  #if AXIS_IS_L64XX(Z2)
2282 2293
     #define Z2_MICROSTEPS      128
2283 2294
     #define Z2_OVERCURRENT    2000
2284 2295
     #define Z2_STALLCURRENT   1500
2285 2296
     #define Z2_MAX_VOLTAGE     127
2286 2297
     #define Z2_CHAIN_POS        -1
2298
+    #define Z2_SLEW_RATE         1
2287 2299
   #endif
2288 2300
 
2289
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2301
+  #if AXIS_IS_L64XX(Z3)
2290 2302
     #define Z3_MICROSTEPS      128
2291 2303
     #define Z3_OVERCURRENT    2000
2292 2304
     #define Z3_STALLCURRENT   1500
2293 2305
     #define Z3_MAX_VOLTAGE     127
2294 2306
     #define Z3_CHAIN_POS        -1
2307
+    #define Z3_SLEW_RATE         1
2295 2308
   #endif
2296 2309
 
2297
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2310
+  #if AXIS_IS_L64XX(E0)
2298 2311
     #define E0_MICROSTEPS      128
2299 2312
     #define E0_OVERCURRENT    2000
2300 2313
     #define E0_STALLCURRENT   1500
2301 2314
     #define E0_MAX_VOLTAGE     127
2302 2315
     #define E0_CHAIN_POS        -1
2316
+    #define E0_SLEW_RATE         1
2303 2317
   #endif
2304 2318
 
2305
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2319
+  #if AXIS_IS_L64XX(E1)
2306 2320
     #define E1_MICROSTEPS      128
2307 2321
     #define E1_OVERCURRENT    2000
2308 2322
     #define E1_STALLCURRENT   1500
2309 2323
     #define E1_MAX_VOLTAGE     127
2310 2324
     #define E1_CHAIN_POS        -1
2325
+    #define E1_SLEW_RATE         1
2311 2326
   #endif
2312 2327
 
2313
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2328
+  #if AXIS_IS_L64XX(E2)
2314 2329
     #define E2_MICROSTEPS      128
2315 2330
     #define E2_OVERCURRENT    2000
2316 2331
     #define E2_STALLCURRENT   1500
2317 2332
     #define E2_MAX_VOLTAGE     127
2318 2333
     #define E2_CHAIN_POS        -1
2334
+    #define E2_SLEW_RATE         1
2319 2335
   #endif
2320 2336
 
2321
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2337
+  #if AXIS_IS_L64XX(E3)
2322 2338
     #define E3_MICROSTEPS      128
2323 2339
     #define E3_OVERCURRENT    2000
2324 2340
     #define E3_STALLCURRENT   1500
2325 2341
     #define E3_MAX_VOLTAGE     127
2326 2342
     #define E3_CHAIN_POS        -1
2343
+    #define E3_SLEW_RATE         1
2327 2344
   #endif
2328 2345
 
2329
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2346
+  #if AXIS_IS_L64XX(E4)
2330 2347
     #define E4_MICROSTEPS      128
2331 2348
     #define E4_OVERCURRENT    2000
2332 2349
     #define E4_STALLCURRENT   1500
2333 2350
     #define E4_MAX_VOLTAGE     127
2334 2351
     #define E4_CHAIN_POS        -1
2352
+    #define E4_SLEW_RATE         1
2335 2353
   #endif
2336 2354
 
2337
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2355
+  #if AXIS_IS_L64XX(E5)
2338 2356
     #define E5_MICROSTEPS      128
2339 2357
     #define E5_OVERCURRENT    2000
2340 2358
     #define E5_STALLCURRENT   1500
2341 2359
     #define E5_MAX_VOLTAGE     127
2342 2360
     #define E5_CHAIN_POS        -1
2361
+    #define E5_SLEW_RATE         1
2343 2362
   #endif
2344 2363
 
2345 2364
   /**
@@ -2365,7 +2384,7 @@
2365 2384
     //#define L6470_STOP_ON_ERROR
2366 2385
   #endif
2367 2386
 
2368
-#endif // L6470
2387
+#endif // HAS_L64XX
2369 2388
 
2370 2389
 /**
2371 2390
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/A2/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/A2/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/A2plus/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/A2plus/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/A6/Configuration.h View File

@@ -674,12 +674,13 @@
674 674
  *
675 675
  * A4988 is assumed for unspecified drivers.
676 676
  *
677
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
677
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
678
+ *          TB6560, TB6600, TMC2100,
678 679
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
679 680
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
680 681
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
681 682
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
682
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
683
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
683 684
  */
684 685
 //#define X_DRIVER_TYPE  A4988
685 686
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/A6/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/A8/Configuration.h View File

@@ -667,12 +667,13 @@
667 667
  *
668 668
  * A4988 is assumed for unspecified drivers.
669 669
  *
670
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
670
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
671
+ *          TB6560, TB6600, TMC2100,
671 672
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
672 673
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
673 674
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
674 675
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
675
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
676
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
676 677
  */
677 678
 //#define X_DRIVER_TYPE  A4988
678 679
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/A8/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/A8plus/Configuration.h View File

@@ -665,12 +665,13 @@
665 665
  *
666 666
  * A4988 is assumed for unspecified drivers.
667 667
  *
668
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
668
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
669
+ *          TB6560, TB6600, TMC2100,
669 670
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
670 671
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
671 672
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
672 673
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
673
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
674
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
674 675
  */
675 676
 #define X_DRIVER_TYPE  A4988
676 677
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/A8plus/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/E10/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 #define X_DRIVER_TYPE  A4988
665 666
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/E10/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Anet/E16/Configuration.h View File

@@ -666,12 +666,13 @@
666 666
  *
667 667
  * A4988 is assumed for unspecified drivers.
668 668
  *
669
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
669
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
670
+ *          TB6560, TB6600, TMC2100,
670 671
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
671 672
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
672 673
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
673 674
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
674
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
675
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
675 676
  */
676 677
 #define X_DRIVER_TYPE  A4988
677 678
 #define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Anet/E16/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/AnyCubic/i3/Configuration.h View File

@@ -664,12 +664,13 @@
664 664
  *
665 665
  * A4988 is assumed for unspecified drivers.
666 666
  *
667
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
667
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
668
+ *          TB6560, TB6600, TMC2100,
668 669
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
669 670
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
670 671
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
671 672
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
672
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
673
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
673 674
  */
674 675
 //#define X_DRIVER_TYPE  A4988
675 676
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/AnyCubic/i3/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/ArmEd/Configuration.h View File

@@ -655,12 +655,13 @@
655 655
  *
656 656
  * A4988 is assumed for unspecified drivers.
657 657
  *
658
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
658
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
659
+ *          TB6560, TB6600, TMC2100,
659 660
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
660 661
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
661 662
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
662 663
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
663
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
664
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
664 665
  */
665 666
 //#define X_DRIVER_TYPE  A4988
666 667
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/ArmEd/Configuration_adv.h View File

@@ -2221,12 +2221,12 @@
2221 2221
 
2222 2222
 #endif // HAS_TRINAMIC
2223 2223
 
2224
-// @section L6470
2224
+// @section L64XX
2225 2225
 
2226 2226
 /**
2227
- * L6470 Stepper Driver options
2227
+ * L64XX Stepper Driver options
2228 2228
  *
2229
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2229
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2230 2230
  * https://github.com/ameyer/Arduino-L6470
2231 2231
  *
2232 2232
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2234,114 +2234,133 @@
2234 2234
  *     L6470_CHAIN_MISO_PIN
2235 2235
  *     L6470_CHAIN_MOSI_PIN
2236 2236
  *     L6470_CHAIN_SS_PIN
2237
- *     L6470_RESET_CHAIN_PIN  (optional)
2237
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2238 2238
  */
2239
-#if HAS_DRIVER(L6470)
2240 2239
 
2241
-  //#define L6470_CHITCHAT        // Display additional status info
2240
+#if HAS_L64XX
2242 2241
 
2243
-  #if AXIS_DRIVER_TYPE_X(L6470)
2244
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2245
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2246
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2247
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2248
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2249
-  #endif
2242
+  //#define L6470_CHITCHAT        // Display additional status info
2250 2243
 
2251
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2244
+  #if AXIS_IS_L64XX(X)
2245
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2246
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2247
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2248
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2249
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2250
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2251
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2252
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2253
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2254
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2255
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2256
+  #endif
2257
+
2258
+  #if AXIS_IS_L64XX(X2)
2252 2259
     #define X2_MICROSTEPS      128
2253 2260
     #define X2_OVERCURRENT    2000
2254 2261
     #define X2_STALLCURRENT   1500
2255 2262
     #define X2_MAX_VOLTAGE     127
2256 2263
     #define X2_CHAIN_POS        -1
2264
+    #define X2_SLEW_RATE         1
2257 2265
   #endif
2258 2266
 
2259
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2267
+  #if AXIS_IS_L64XX(Y)
2260 2268
     #define Y_MICROSTEPS       128
2261 2269
     #define Y_OVERCURRENT     2000
2262 2270
     #define Y_STALLCURRENT    1500
2263 2271
     #define Y_MAX_VOLTAGE      127
2264 2272
     #define Y_CHAIN_POS         -1
2273
+    #define Y_SLEW_RATE          1
2265 2274
   #endif
2266 2275
 
2267
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2276
+  #if AXIS_IS_L64XX(Y2)
2268 2277
     #define Y2_MICROSTEPS      128
2269 2278
     #define Y2_OVERCURRENT    2000
2270 2279
     #define Y2_STALLCURRENT   1500
2271 2280
     #define Y2_MAX_VOLTAGE     127
2272 2281
     #define Y2_CHAIN_POS        -1
2282
+    #define Y2_SLEW_RATE         1
2273 2283
   #endif
2274 2284
 
2275
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2285
+  #if AXIS_IS_L64XX(Z)
2276 2286
     #define Z_MICROSTEPS       128
2277 2287
     #define Z_OVERCURRENT     2000
2278 2288
     #define Z_STALLCURRENT    1500
2279 2289
     #define Z_MAX_VOLTAGE      127
2280 2290
     #define Z_CHAIN_POS         -1
2291
+    #define Z_SLEW_RATE          1
2281 2292
   #endif
2282 2293
 
2283
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2294
+  #if AXIS_IS_L64XX(Z2)
2284 2295
     #define Z2_MICROSTEPS      128
2285 2296
     #define Z2_OVERCURRENT    2000
2286 2297
     #define Z2_STALLCURRENT   1500
2287 2298
     #define Z2_MAX_VOLTAGE     127
2288 2299
     #define Z2_CHAIN_POS        -1
2300
+    #define Z2_SLEW_RATE         1
2289 2301
   #endif
2290 2302
 
2291
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2303
+  #if AXIS_IS_L64XX(Z3)
2292 2304
     #define Z3_MICROSTEPS      128
2293 2305
     #define Z3_OVERCURRENT    2000
2294 2306
     #define Z3_STALLCURRENT   1500
2295 2307
     #define Z3_MAX_VOLTAGE     127
2296 2308
     #define Z3_CHAIN_POS        -1
2309
+    #define Z3_SLEW_RATE         1
2297 2310
   #endif
2298 2311
 
2299
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2312
+  #if AXIS_IS_L64XX(E0)
2300 2313
     #define E0_MICROSTEPS      128
2301 2314
     #define E0_OVERCURRENT    2000
2302 2315
     #define E0_STALLCURRENT   1500
2303 2316
     #define E0_MAX_VOLTAGE     127
2304 2317
     #define E0_CHAIN_POS        -1
2318
+    #define E0_SLEW_RATE         1
2305 2319
   #endif
2306 2320
 
2307
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2321
+  #if AXIS_IS_L64XX(E1)
2308 2322
     #define E1_MICROSTEPS      128
2309 2323
     #define E1_OVERCURRENT    2000
2310 2324
     #define E1_STALLCURRENT   1500
2311 2325
     #define E1_MAX_VOLTAGE     127
2312 2326
     #define E1_CHAIN_POS        -1
2327
+    #define E1_SLEW_RATE         1
2313 2328
   #endif
2314 2329
 
2315
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2330
+  #if AXIS_IS_L64XX(E2)
2316 2331
     #define E2_MICROSTEPS      128
2317 2332
     #define E2_OVERCURRENT    2000
2318 2333
     #define E2_STALLCURRENT   1500
2319 2334
     #define E2_MAX_VOLTAGE     127
2320 2335
     #define E2_CHAIN_POS        -1
2336
+    #define E2_SLEW_RATE         1
2321 2337
   #endif
2322 2338
 
2323
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2339
+  #if AXIS_IS_L64XX(E3)
2324 2340
     #define E3_MICROSTEPS      128
2325 2341
     #define E3_OVERCURRENT    2000
2326 2342
     #define E3_STALLCURRENT   1500
2327 2343
     #define E3_MAX_VOLTAGE     127
2328 2344
     #define E3_CHAIN_POS        -1
2345
+    #define E3_SLEW_RATE         1
2329 2346
   #endif
2330 2347
 
2331
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2348
+  #if AXIS_IS_L64XX(E4)
2332 2349
     #define E4_MICROSTEPS      128
2333 2350
     #define E4_OVERCURRENT    2000
2334 2351
     #define E4_STALLCURRENT   1500
2335 2352
     #define E4_MAX_VOLTAGE     127
2336 2353
     #define E4_CHAIN_POS        -1
2354
+    #define E4_SLEW_RATE         1
2337 2355
   #endif
2338 2356
 
2339
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2357
+  #if AXIS_IS_L64XX(E5)
2340 2358
     #define E5_MICROSTEPS      128
2341 2359
     #define E5_OVERCURRENT    2000
2342 2360
     #define E5_STALLCURRENT   1500
2343 2361
     #define E5_MAX_VOLTAGE     127
2344 2362
     #define E5_CHAIN_POS        -1
2363
+    #define E5_SLEW_RATE         1
2345 2364
   #endif
2346 2365
 
2347 2366
   /**
@@ -2367,7 +2386,7 @@
2367 2386
     //#define L6470_STOP_ON_ERROR
2368 2387
   #endif
2369 2388
 
2370
-#endif // L6470
2389
+#endif // HAS_L64XX
2371 2390
 
2372 2391
 /**
2373 2392
  * TWI/I2C BUS

+ 3
- 2
config/examples/Artillery/Genius/Configuration.h View File

@@ -637,12 +637,13 @@
637 637
  *
638 638
  * A4988 is assumed for unspecified drivers.
639 639
  *
640
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
640
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
641
+ *          TB6560, TB6600, TMC2100,
641 642
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
642 643
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
643 644
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
644 645
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
645
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
646
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
646 647
  */
647 648
 #define X_DRIVER_TYPE  TMC2100
648 649
 #define Y_DRIVER_TYPE  TMC2100

+ 45
- 26
config/examples/Artillery/Genius/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Artillery/Sidewinder X1/Configuration.h View File

@@ -659,12 +659,13 @@
659 659
  *
660 660
  * A4988 is assumed for unspecified drivers.
661 661
  *
662
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
662
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
663
+ *          TB6560, TB6600, TMC2100,
663 664
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
664 665
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
665 666
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
666 667
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
667
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
668
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
668 669
  */
669 670
 #define X_DRIVER_TYPE  TMC2100
670 671
 #define Y_DRIVER_TYPE  TMC2100

+ 45
- 26
config/examples/Artillery/Sidewinder X1/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Azteeg/X5GT/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 3
- 2
config/examples/BIBO/TouchX/cyclops/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/BIBO/TouchX/cyclops/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/BIBO/TouchX/default/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/BIBO/TouchX/default/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/BQ/Hephestos/Configuration.h View File

@@ -642,12 +642,13 @@
642 642
  *
643 643
  * A4988 is assumed for unspecified drivers.
644 644
  *
645
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
645
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
646
+ *          TB6560, TB6600, TMC2100,
646 647
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
647 648
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
648 649
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
649 650
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
650
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
651
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
651 652
  */
652 653
 //#define X_DRIVER_TYPE  A4988
653 654
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/BQ/Hephestos/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/BQ/Hephestos_2/Configuration.h View File

@@ -655,12 +655,13 @@
655 655
  *
656 656
  * A4988 is assumed for unspecified drivers.
657 657
  *
658
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
658
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
659
+ *          TB6560, TB6600, TMC2100,
659 660
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
660 661
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
661 662
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
662 663
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
663
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
664
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
664 665
  */
665 666
 //#define X_DRIVER_TYPE  A4988
666 667
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/BQ/Hephestos_2/Configuration_adv.h View File

@@ -2225,12 +2225,12 @@
2225 2225
 
2226 2226
 #endif // HAS_TRINAMIC
2227 2227
 
2228
-// @section L6470
2228
+// @section L64XX
2229 2229
 
2230 2230
 /**
2231
- * L6470 Stepper Driver options
2231
+ * L64XX Stepper Driver options
2232 2232
  *
2233
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2233
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2234 2234
  * https://github.com/ameyer/Arduino-L6470
2235 2235
  *
2236 2236
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2238,114 +2238,133 @@
2238 2238
  *     L6470_CHAIN_MISO_PIN
2239 2239
  *     L6470_CHAIN_MOSI_PIN
2240 2240
  *     L6470_CHAIN_SS_PIN
2241
- *     L6470_RESET_CHAIN_PIN  (optional)
2241
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2242 2242
  */
2243
-#if HAS_DRIVER(L6470)
2244 2243
 
2245
-  //#define L6470_CHITCHAT        // Display additional status info
2244
+#if HAS_L64XX
2246 2245
 
2247
-  #if AXIS_DRIVER_TYPE_X(L6470)
2248
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2249
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2250
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2251
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2252
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2253
-  #endif
2246
+  //#define L6470_CHITCHAT        // Display additional status info
2254 2247
 
2255
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2248
+  #if AXIS_IS_L64XX(X)
2249
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2250
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2251
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2252
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2253
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2254
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2255
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2256
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2257
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2258
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2259
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2260
+  #endif
2261
+
2262
+  #if AXIS_IS_L64XX(X2)
2256 2263
     #define X2_MICROSTEPS      128
2257 2264
     #define X2_OVERCURRENT    2000
2258 2265
     #define X2_STALLCURRENT   1500
2259 2266
     #define X2_MAX_VOLTAGE     127
2260 2267
     #define X2_CHAIN_POS        -1
2268
+    #define X2_SLEW_RATE         1
2261 2269
   #endif
2262 2270
 
2263
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2271
+  #if AXIS_IS_L64XX(Y)
2264 2272
     #define Y_MICROSTEPS       128
2265 2273
     #define Y_OVERCURRENT     2000
2266 2274
     #define Y_STALLCURRENT    1500
2267 2275
     #define Y_MAX_VOLTAGE      127
2268 2276
     #define Y_CHAIN_POS         -1
2277
+    #define Y_SLEW_RATE          1
2269 2278
   #endif
2270 2279
 
2271
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2280
+  #if AXIS_IS_L64XX(Y2)
2272 2281
     #define Y2_MICROSTEPS      128
2273 2282
     #define Y2_OVERCURRENT    2000
2274 2283
     #define Y2_STALLCURRENT   1500
2275 2284
     #define Y2_MAX_VOLTAGE     127
2276 2285
     #define Y2_CHAIN_POS        -1
2286
+    #define Y2_SLEW_RATE         1
2277 2287
   #endif
2278 2288
 
2279
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2289
+  #if AXIS_IS_L64XX(Z)
2280 2290
     #define Z_MICROSTEPS       128
2281 2291
     #define Z_OVERCURRENT     2000
2282 2292
     #define Z_STALLCURRENT    1500
2283 2293
     #define Z_MAX_VOLTAGE      127
2284 2294
     #define Z_CHAIN_POS         -1
2295
+    #define Z_SLEW_RATE          1
2285 2296
   #endif
2286 2297
 
2287
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2298
+  #if AXIS_IS_L64XX(Z2)
2288 2299
     #define Z2_MICROSTEPS      128
2289 2300
     #define Z2_OVERCURRENT    2000
2290 2301
     #define Z2_STALLCURRENT   1500
2291 2302
     #define Z2_MAX_VOLTAGE     127
2292 2303
     #define Z2_CHAIN_POS        -1
2304
+    #define Z2_SLEW_RATE         1
2293 2305
   #endif
2294 2306
 
2295
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2307
+  #if AXIS_IS_L64XX(Z3)
2296 2308
     #define Z3_MICROSTEPS      128
2297 2309
     #define Z3_OVERCURRENT    2000
2298 2310
     #define Z3_STALLCURRENT   1500
2299 2311
     #define Z3_MAX_VOLTAGE     127
2300 2312
     #define Z3_CHAIN_POS        -1
2313
+    #define Z3_SLEW_RATE         1
2301 2314
   #endif
2302 2315
 
2303
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2316
+  #if AXIS_IS_L64XX(E0)
2304 2317
     #define E0_MICROSTEPS      128
2305 2318
     #define E0_OVERCURRENT    2000
2306 2319
     #define E0_STALLCURRENT   1500
2307 2320
     #define E0_MAX_VOLTAGE     127
2308 2321
     #define E0_CHAIN_POS        -1
2322
+    #define E0_SLEW_RATE         1
2309 2323
   #endif
2310 2324
 
2311
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2325
+  #if AXIS_IS_L64XX(E1)
2312 2326
     #define E1_MICROSTEPS      128
2313 2327
     #define E1_OVERCURRENT    2000
2314 2328
     #define E1_STALLCURRENT   1500
2315 2329
     #define E1_MAX_VOLTAGE     127
2316 2330
     #define E1_CHAIN_POS        -1
2331
+    #define E1_SLEW_RATE         1
2317 2332
   #endif
2318 2333
 
2319
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2334
+  #if AXIS_IS_L64XX(E2)
2320 2335
     #define E2_MICROSTEPS      128
2321 2336
     #define E2_OVERCURRENT    2000
2322 2337
     #define E2_STALLCURRENT   1500
2323 2338
     #define E2_MAX_VOLTAGE     127
2324 2339
     #define E2_CHAIN_POS        -1
2340
+    #define E2_SLEW_RATE         1
2325 2341
   #endif
2326 2342
 
2327
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2343
+  #if AXIS_IS_L64XX(E3)
2328 2344
     #define E3_MICROSTEPS      128
2329 2345
     #define E3_OVERCURRENT    2000
2330 2346
     #define E3_STALLCURRENT   1500
2331 2347
     #define E3_MAX_VOLTAGE     127
2332 2348
     #define E3_CHAIN_POS        -1
2349
+    #define E3_SLEW_RATE         1
2333 2350
   #endif
2334 2351
 
2335
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2352
+  #if AXIS_IS_L64XX(E4)
2336 2353
     #define E4_MICROSTEPS      128
2337 2354
     #define E4_OVERCURRENT    2000
2338 2355
     #define E4_STALLCURRENT   1500
2339 2356
     #define E4_MAX_VOLTAGE     127
2340 2357
     #define E4_CHAIN_POS        -1
2358
+    #define E4_SLEW_RATE         1
2341 2359
   #endif
2342 2360
 
2343
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2361
+  #if AXIS_IS_L64XX(E5)
2344 2362
     #define E5_MICROSTEPS      128
2345 2363
     #define E5_OVERCURRENT    2000
2346 2364
     #define E5_STALLCURRENT   1500
2347 2365
     #define E5_MAX_VOLTAGE     127
2348 2366
     #define E5_CHAIN_POS        -1
2367
+    #define E5_SLEW_RATE         1
2349 2368
   #endif
2350 2369
 
2351 2370
   /**
@@ -2371,7 +2390,7 @@
2371 2390
     //#define L6470_STOP_ON_ERROR
2372 2391
   #endif
2373 2392
 
2374
-#endif // L6470
2393
+#endif // HAS_L64XX
2375 2394
 
2376 2395
 /**
2377 2396
  * TWI/I2C BUS

+ 3
- 2
config/examples/BQ/WITBOX/Configuration.h View File

@@ -642,12 +642,13 @@
642 642
  *
643 643
  * A4988 is assumed for unspecified drivers.
644 644
  *
645
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
645
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
646
+ *          TB6560, TB6600, TMC2100,
646 647
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
647 648
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
648 649
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
649 650
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
650
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
651
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
651 652
  */
652 653
 //#define X_DRIVER_TYPE  A4988
653 654
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/BQ/WITBOX/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration.h View File

@@ -646,12 +646,13 @@
646 646
  *
647 647
  * A4988 is assumed for unspecified drivers.
648 648
  *
649
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
649
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
650
+ *          TB6560, TB6600, TMC2100,
650 651
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
651 652
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
652 653
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
653 654
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
654
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
655
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
655 656
  */
656 657
 #define X_DRIVER_TYPE  TMC2209
657 658
 #define Y_DRIVER_TYPE  TMC2209

+ 45
- 26
config/examples/BigTreeTech/SKR Mini E3 1.0/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration.h View File

@@ -647,12 +647,13 @@
647 647
  *
648 648
  * A4988 is assumed for unspecified drivers.
649 649
  *
650
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
650
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
651
+ *          TB6560, TB6600, TMC2100,
651 652
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
652 653
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
653 654
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
654 655
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
655
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
656
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
656 657
  */
657 658
 #define X_DRIVER_TYPE  TMC2209
658 659
 #define Y_DRIVER_TYPE  TMC2209

+ 45
- 26
config/examples/BigTreeTech/SKR Mini E3 1.2/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Cartesio/Configuration.h View File

@@ -653,12 +653,13 @@
653 653
  *
654 654
  * A4988 is assumed for unspecified drivers.
655 655
  *
656
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
656
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
657
+ *          TB6560, TB6600, TMC2100,
657 658
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
658 659
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
659 660
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
660 661
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
661
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
662
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
662 663
  */
663 664
 //#define X_DRIVER_TYPE  A4988
664 665
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Cartesio/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-10/Configuration.h View File

@@ -664,12 +664,13 @@
664 664
  *
665 665
  * A4988 is assumed for unspecified drivers.
666 666
  *
667
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
667
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
668
+ *          TB6560, TB6600, TMC2100,
668 669
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
669 670
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
670 671
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
671 672
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
672
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
673
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
673 674
  */
674 675
 //#define X_DRIVER_TYPE  A4988
675 676
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Creality/CR-10/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-10S/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Creality/CR-10S/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-10_5S/Configuration.h View File

@@ -654,12 +654,13 @@
654 654
  *
655 655
  * A4988 is assumed for unspecified drivers.
656 656
  *
657
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
657
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
658
+ *          TB6560, TB6600, TMC2100,
658 659
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
659 660
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
660 661
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
661 662
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
662
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
663 664
  */
664 665
 //#define X_DRIVER_TYPE  A4988
665 666
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Creality/CR-10_5S/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-10mini/Configuration.h View File

@@ -673,12 +673,13 @@
673 673
  *
674 674
  * A4988 is assumed for unspecified drivers.
675 675
  *
676
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
676
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
677
+ *          TB6560, TB6600, TMC2100,
677 678
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
678 679
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
679 680
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
680 681
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
681
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
682
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
682 683
  */
683 684
 //#define X_DRIVER_TYPE  A4988
684 685
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Creality/CR-10mini/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-20 Pro/Configuration.h View File

@@ -658,12 +658,13 @@
658 658
  *
659 659
  * A4988 is assumed for unspecified drivers.
660 660
  *
661
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
661
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
662
+ *          TB6560, TB6600, TMC2100,
662 663
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
663 664
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
664 665
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
665 666
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
666
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
667
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
667 668
  */
668 669
 //#define X_DRIVER_TYPE  A4988
669 670
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Creality/CR-20 Pro/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-20/Configuration.h View File

@@ -658,12 +658,13 @@
658 658
  *
659 659
  * A4988 is assumed for unspecified drivers.
660 660
  *
661
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
661
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
662
+ *          TB6560, TB6600, TMC2100,
662 663
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
663 664
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
664 665
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
665 666
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
666
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
667
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
667 668
  */
668 669
 //#define X_DRIVER_TYPE  A4988
669 670
 //#define Y_DRIVER_TYPE  A4988

+ 45
- 26
config/examples/Creality/CR-20/Configuration_adv.h View File

@@ -2217,12 +2217,12 @@
2217 2217
 
2218 2218
 #endif // HAS_TRINAMIC
2219 2219
 
2220
-// @section L6470
2220
+// @section L64XX
2221 2221
 
2222 2222
 /**
2223
- * L6470 Stepper Driver options
2223
+ * L64XX Stepper Driver options
2224 2224
  *
2225
- * Arduino-L6470 library (0.7.0 or higher) is required for this stepper driver.
2225
+ * Arduino-L6470 library (0.8.0 or higher) is required.
2226 2226
  * https://github.com/ameyer/Arduino-L6470
2227 2227
  *
2228 2228
  * Requires the following to be defined in your pins_YOUR_BOARD file
@@ -2230,114 +2230,133 @@
2230 2230
  *     L6470_CHAIN_MISO_PIN
2231 2231
  *     L6470_CHAIN_MOSI_PIN
2232 2232
  *     L6470_CHAIN_SS_PIN
2233
- *     L6470_RESET_CHAIN_PIN  (optional)
2233
+ *     ENABLE_RESET_L64XX_CHIPS(Q)  where Q is 1 to enable and 0 to reset
2234 2234
  */
2235
-#if HAS_DRIVER(L6470)
2236 2235
 
2237
-  //#define L6470_CHITCHAT        // Display additional status info
2236
+#if HAS_L64XX
2238 2237
 
2239
-  #if AXIS_DRIVER_TYPE_X(L6470)
2240
-    #define X_MICROSTEPS     128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128)
2241
-    #define X_OVERCURRENT   2000  // (mA) Current where the driver detects an over current (VALID: 375 x (1 - 16) - 6A max - rounds down)
2242
-    #define X_STALLCURRENT  1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2243
-    #define X_MAX_VOLTAGE    127  // 0-255, Maximum effective voltage seen by stepper
2244
-    #define X_CHAIN_POS       -1  // Position in SPI chain. (<=0 : Not in chain. 1 : Nearest MOSI)
2245
-  #endif
2238
+  //#define L6470_CHITCHAT        // Display additional status info
2246 2239
 
2247
-  #if AXIS_DRIVER_TYPE_X2(L6470)
2240
+  #if AXIS_IS_L64XX(X)
2241
+    #define X_MICROSTEPS       128  // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
2242
+    #define X_OVERCURRENT     2000  // (mA) Current where the driver detects an over current
2243
+                                    //   L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
2244
+                                    //   POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
2245
+    #define X_STALLCURRENT    1500  // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) -  4A max - rounds down)
2246
+                                    //   L6470 & L6474 - VALID: 31.25 * (1-128) -  4A max - rounds down
2247
+                                    //   POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
2248
+                                    //   L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
2249
+    #define X_MAX_VOLTAGE      127  // 0-255, Maximum effective voltage seen by stepper - not used by L6474
2250
+    #define X_CHAIN_POS         -1  // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
2251
+    #define X_SLEW_RATE          1  // 0-3, Slew 0 is slowest, 3 is fastest
2252
+  #endif
2253
+
2254
+  #if AXIS_IS_L64XX(X2)
2248 2255
     #define X2_MICROSTEPS      128
2249 2256
     #define X2_OVERCURRENT    2000
2250 2257
     #define X2_STALLCURRENT   1500
2251 2258
     #define X2_MAX_VOLTAGE     127
2252 2259
     #define X2_CHAIN_POS        -1
2260
+    #define X2_SLEW_RATE         1
2253 2261
   #endif
2254 2262
 
2255
-  #if AXIS_DRIVER_TYPE_Y(L6470)
2263
+  #if AXIS_IS_L64XX(Y)
2256 2264
     #define Y_MICROSTEPS       128
2257 2265
     #define Y_OVERCURRENT     2000
2258 2266
     #define Y_STALLCURRENT    1500
2259 2267
     #define Y_MAX_VOLTAGE      127
2260 2268
     #define Y_CHAIN_POS         -1
2269
+    #define Y_SLEW_RATE          1
2261 2270
   #endif
2262 2271
 
2263
-  #if AXIS_DRIVER_TYPE_Y2(L6470)
2272
+  #if AXIS_IS_L64XX(Y2)
2264 2273
     #define Y2_MICROSTEPS      128
2265 2274
     #define Y2_OVERCURRENT    2000
2266 2275
     #define Y2_STALLCURRENT   1500
2267 2276
     #define Y2_MAX_VOLTAGE     127
2268 2277
     #define Y2_CHAIN_POS        -1
2278
+    #define Y2_SLEW_RATE         1
2269 2279
   #endif
2270 2280
 
2271
-  #if AXIS_DRIVER_TYPE_Z(L6470)
2281
+  #if AXIS_IS_L64XX(Z)
2272 2282
     #define Z_MICROSTEPS       128
2273 2283
     #define Z_OVERCURRENT     2000
2274 2284
     #define Z_STALLCURRENT    1500
2275 2285
     #define Z_MAX_VOLTAGE      127
2276 2286
     #define Z_CHAIN_POS         -1
2287
+    #define Z_SLEW_RATE          1
2277 2288
   #endif
2278 2289
 
2279
-  #if AXIS_DRIVER_TYPE_Z2(L6470)
2290
+  #if AXIS_IS_L64XX(Z2)
2280 2291
     #define Z2_MICROSTEPS      128
2281 2292
     #define Z2_OVERCURRENT    2000
2282 2293
     #define Z2_STALLCURRENT   1500
2283 2294
     #define Z2_MAX_VOLTAGE     127
2284 2295
     #define Z2_CHAIN_POS        -1
2296
+    #define Z2_SLEW_RATE         1
2285 2297
   #endif
2286 2298
 
2287
-  #if AXIS_DRIVER_TYPE_Z3(L6470)
2299
+  #if AXIS_IS_L64XX(Z3)
2288 2300
     #define Z3_MICROSTEPS      128
2289 2301
     #define Z3_OVERCURRENT    2000
2290 2302
     #define Z3_STALLCURRENT   1500
2291 2303
     #define Z3_MAX_VOLTAGE     127
2292 2304
     #define Z3_CHAIN_POS        -1
2305
+    #define Z3_SLEW_RATE         1
2293 2306
   #endif
2294 2307
 
2295
-  #if AXIS_DRIVER_TYPE_E0(L6470)
2308
+  #if AXIS_IS_L64XX(E0)
2296 2309
     #define E0_MICROSTEPS      128
2297 2310
     #define E0_OVERCURRENT    2000
2298 2311
     #define E0_STALLCURRENT   1500
2299 2312
     #define E0_MAX_VOLTAGE     127
2300 2313
     #define E0_CHAIN_POS        -1
2314
+    #define E0_SLEW_RATE         1
2301 2315
   #endif
2302 2316
 
2303
-  #if AXIS_DRIVER_TYPE_E1(L6470)
2317
+  #if AXIS_IS_L64XX(E1)
2304 2318
     #define E1_MICROSTEPS      128
2305 2319
     #define E1_OVERCURRENT    2000
2306 2320
     #define E1_STALLCURRENT   1500
2307 2321
     #define E1_MAX_VOLTAGE     127
2308 2322
     #define E1_CHAIN_POS        -1
2323
+    #define E1_SLEW_RATE         1
2309 2324
   #endif
2310 2325
 
2311
-  #if AXIS_DRIVER_TYPE_E2(L6470)
2326
+  #if AXIS_IS_L64XX(E2)
2312 2327
     #define E2_MICROSTEPS      128
2313 2328
     #define E2_OVERCURRENT    2000
2314 2329
     #define E2_STALLCURRENT   1500
2315 2330
     #define E2_MAX_VOLTAGE     127
2316 2331
     #define E2_CHAIN_POS        -1
2332
+    #define E2_SLEW_RATE         1
2317 2333
   #endif
2318 2334
 
2319
-  #if AXIS_DRIVER_TYPE_E3(L6470)
2335
+  #if AXIS_IS_L64XX(E3)
2320 2336
     #define E3_MICROSTEPS      128
2321 2337
     #define E3_OVERCURRENT    2000
2322 2338
     #define E3_STALLCURRENT   1500
2323 2339
     #define E3_MAX_VOLTAGE     127
2324 2340
     #define E3_CHAIN_POS        -1
2341
+    #define E3_SLEW_RATE         1
2325 2342
   #endif
2326 2343
 
2327
-  #if AXIS_DRIVER_TYPE_E4(L6470)
2344
+  #if AXIS_IS_L64XX(E4)
2328 2345
     #define E4_MICROSTEPS      128
2329 2346
     #define E4_OVERCURRENT    2000
2330 2347
     #define E4_STALLCURRENT   1500
2331 2348
     #define E4_MAX_VOLTAGE     127
2332 2349
     #define E4_CHAIN_POS        -1
2350
+    #define E4_SLEW_RATE         1
2333 2351
   #endif
2334 2352
 
2335
-  #if AXIS_DRIVER_TYPE_E5(L6470)
2353
+  #if AXIS_IS_L64XX(E5)
2336 2354
     #define E5_MICROSTEPS      128
2337 2355
     #define E5_OVERCURRENT    2000
2338 2356
     #define E5_STALLCURRENT   1500
2339 2357
     #define E5_MAX_VOLTAGE     127
2340 2358
     #define E5_CHAIN_POS        -1
2359
+    #define E5_SLEW_RATE         1
2341 2360
   #endif
2342 2361
 
2343 2362
   /**
@@ -2363,7 +2382,7 @@
2363 2382
     //#define L6470_STOP_ON_ERROR
2364 2383
   #endif
2365 2384
 
2366
-#endif // L6470
2385
+#endif // HAS_L64XX
2367 2386
 
2368 2387
 /**
2369 2388
  * TWI/I2C BUS

+ 3
- 2
config/examples/Creality/CR-8/Configuration.h View File

@@ -664,12 +664,13 @@
664 664
  *
665 665
  * A4988 is assumed for unspecified drivers.
666 666
  *
667
- * Options: A4988, A5984, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
667
+ * Options: A4988, A5984, DRV8825, LV8729, L6470, L6474, POWERSTEP01,
668
+ *          TB6560, TB6600, TMC2100,
668 669
  *          TMC2130, TMC2130_STANDALONE, TMC2160, TMC2160_STANDALONE,
669 670
  *          TMC2208, TMC2208_STANDALONE, TMC2209, TMC2209_STANDALONE,
670 671
  *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
671 672
  *          TMC5130, TMC5130_STANDALONE, TMC5160, TMC5160_STANDALONE
672
- * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
673
+ * :['A4988', 'A5984', 'DRV8825', 'LV8729', 'L6470', 'L6474', 'POWERSTEP01', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2160', 'TMC2160_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC2209', 'TMC2209_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE', 'TMC5160', 'TMC5160_STANDALONE']
673 674
  */
674 675
 //#define X_DRIVER_TYPE  A4988
675 676
 //#define Y_DRIVER_TYPE  A4988

+ 0
- 0
config/examples/Creality/CR-8/Configuration_adv.h View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save