Browse Source

M569 to change stepping mode. Add new TMC section to LCD. (#12884)

teemuatlut 5 years ago
parent
commit
e6805582a6
84 changed files with 1541 additions and 79 deletions
  1. 8
    0
      Marlin/Configuration_adv.h
  2. 8
    0
      Marlin/src/config/default/Configuration_adv.h
  3. 8
    0
      Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h
  4. 8
    0
      Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h
  5. 8
    0
      Marlin/src/config/examples/Anet/A2/Configuration_adv.h
  6. 8
    0
      Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h
  7. 8
    0
      Marlin/src/config/examples/Anet/A6/Configuration_adv.h
  8. 8
    0
      Marlin/src/config/examples/Anet/A8/Configuration_adv.h
  9. 8
    0
      Marlin/src/config/examples/ArmEd/Configuration_adv.h
  10. 8
    0
      Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
  11. 8
    0
      Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h
  12. 8
    0
      Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h
  13. 8
    0
      Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h
  14. 8
    0
      Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h
  15. 8
    0
      Marlin/src/config/examples/Cartesio/Configuration_adv.h
  16. 8
    0
      Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h
  17. 8
    0
      Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h
  18. 8
    0
      Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h
  19. 8
    0
      Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h
  20. 8
    0
      Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h
  21. 8
    0
      Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h
  22. 8
    0
      Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h
  23. 8
    0
      Marlin/src/config/examples/Einstart-S/Configuration_adv.h
  24. 8
    0
      Marlin/src/config/examples/Felix/Configuration_adv.h
  25. 8
    0
      Marlin/src/config/examples/FlashForge/CreatorPro/Configuration_adv.h
  26. 8
    0
      Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h
  27. 8
    0
      Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h
  28. 8
    0
      Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h
  29. 8
    0
      Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h
  30. 8
    0
      Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h
  31. 8
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h
  32. 8
    0
      Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h
  33. 8
    0
      Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h
  34. 8
    0
      Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h
  35. 8
    0
      Marlin/src/config/examples/MakerParts/Configuration_adv.h
  36. 8
    0
      Marlin/src/config/examples/Malyan/M150/Configuration_adv.h
  37. 8
    0
      Marlin/src/config/examples/Malyan/M200/Configuration_adv.h
  38. 8
    0
      Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h
  39. 8
    0
      Marlin/src/config/examples/Mks/Robin/Configuration_adv.h
  40. 8
    0
      Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h
  41. 8
    0
      Marlin/src/config/examples/RigidBot/Configuration_adv.h
  42. 8
    0
      Marlin/src/config/examples/SCARA/Configuration_adv.h
  43. 8
    0
      Marlin/src/config/examples/Sanguinololu/Configuration_adv.h
  44. 8
    0
      Marlin/src/config/examples/TheBorg/Configuration_adv.h
  45. 8
    0
      Marlin/src/config/examples/TinyBoy2/Configuration_adv.h
  46. 8
    0
      Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h
  47. 8
    0
      Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h
  48. 8
    0
      Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h
  49. 8
    0
      Marlin/src/config/examples/VORONDesign/Configuration_adv.h
  50. 8
    0
      Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h
  51. 8
    0
      Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h
  52. 8
    0
      Marlin/src/config/examples/WASP/PowerWASP/Configuration_adv.h
  53. 8
    0
      Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h
  54. 8
    0
      Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h
  55. 8
    0
      Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h
  56. 8
    0
      Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h
  57. 8
    0
      Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h
  58. 8
    0
      Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h
  59. 8
    0
      Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h
  60. 8
    0
      Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h
  61. 8
    0
      Marlin/src/config/examples/delta/generic/Configuration_adv.h
  62. 8
    0
      Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h
  63. 8
    0
      Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h
  64. 8
    0
      Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h
  65. 8
    0
      Marlin/src/config/examples/makibox/Configuration_adv.h
  66. 8
    0
      Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h
  67. 8
    0
      Marlin/src/config/examples/wt150/Configuration_adv.h
  68. 50
    0
      Marlin/src/feature/tmc_util.cpp
  69. 111
    13
      Marlin/src/feature/tmc_util.h
  70. 165
    0
      Marlin/src/gcode/feature/trinamic/M569.cpp
  71. 3
    0
      Marlin/src/gcode/gcode.cpp
  72. 4
    0
      Marlin/src/gcode/gcode.h
  73. 13
    13
      Marlin/src/inc/Conditionals_post.h
  74. 7
    7
      Marlin/src/inc/SanityCheck.h
  75. 5
    0
      Marlin/src/lcd/extensible_ui/ui_api.cpp
  76. 19
    0
      Marlin/src/lcd/language/language_en.h
  77. 2
    1
      Marlin/src/lcd/menu/menu.cpp
  78. 6
    3
      Marlin/src/lcd/menu/menu.h
  79. 5
    0
      Marlin/src/lcd/menu/menu_configuration.cpp
  80. 352
    0
      Marlin/src/lcd/menu/menu_tmc.cpp
  81. 8
    0
      Marlin/src/lcd/ultralcd.cpp
  82. 210
    1
      Marlin/src/module/configuration_store.cpp
  83. 11
    15
      Marlin/src/module/stepper_indirection.cpp
  84. 34
    26
      Marlin/src/module/stepper_indirection.h

+ 8
- 0
Marlin/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/default/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Anet/A2/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Anet/A6/Configuration_adv.h View File

1380
   //#define TMC_SW_SCK        -1
1380
   //#define TMC_SW_SCK        -1
1381
 
1381
 
1382
   /**
1382
   /**
1383
+   * Software enable
1384
+   *
1385
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1386
+   * function through a communication line such as SPI or UART.
1387
+   */
1388
+  //#define SOFTWARE_DRIVER_ENABLE
1389
+
1390
+  /**
1383
    * Use Trinamic's ultra quiet stepping mode.
1391
    * Use Trinamic's ultra quiet stepping mode.
1384
    * When disabled, Marlin will use spreadCycle stepping mode.
1392
    * When disabled, Marlin will use spreadCycle stepping mode.
1385
    */
1393
    */

+ 8
- 0
Marlin/src/config/examples/Anet/A8/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/ArmEd/Configuration_adv.h View File

1355
   //#define TMC_SW_SCK        -1
1355
   //#define TMC_SW_SCK        -1
1356
 
1356
 
1357
   /**
1357
   /**
1358
+   * Software enable
1359
+   *
1360
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1361
+   * function through a communication line such as SPI or UART.
1362
+   */
1363
+  //#define SOFTWARE_DRIVER_ENABLE
1364
+
1365
+  /**
1358
    * Use Trinamic's ultra quiet stepping mode.
1366
    * Use Trinamic's ultra quiet stepping mode.
1359
    * When disabled, Marlin will use spreadCycle stepping mode.
1367
    * When disabled, Marlin will use spreadCycle stepping mode.
1360
    */
1368
    */

+ 8
- 0
Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h View File

1380
   //#define TMC_SW_SCK        -1
1380
   //#define TMC_SW_SCK        -1
1381
 
1381
 
1382
   /**
1382
   /**
1383
+   * Software enable
1384
+   *
1385
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1386
+   * function through a communication line such as SPI or UART.
1387
+   */
1388
+  //#define SOFTWARE_DRIVER_ENABLE
1389
+
1390
+  /**
1383
    * Use Trinamic's ultra quiet stepping mode.
1391
    * Use Trinamic's ultra quiet stepping mode.
1384
    * When disabled, Marlin will use spreadCycle stepping mode.
1392
    * When disabled, Marlin will use spreadCycle stepping mode.
1385
    */
1393
    */

+ 8
- 0
Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h View File

1389
   //#define TMC_SW_SCK        -1
1389
   //#define TMC_SW_SCK        -1
1390
 
1390
 
1391
   /**
1391
   /**
1392
+   * Software enable
1393
+   *
1394
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1395
+   * function through a communication line such as SPI or UART.
1396
+   */
1397
+  //#define SOFTWARE_DRIVER_ENABLE
1398
+
1399
+  /**
1392
    * Use Trinamic's ultra quiet stepping mode.
1400
    * Use Trinamic's ultra quiet stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1401
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    */
1402
    */

+ 8
- 0
Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Cartesio/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

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

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

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

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Einstart-S/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Felix/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/FlashForge/CreatorPro/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h View File

1386
   //#define TMC_SW_SCK        -1
1386
   //#define TMC_SW_SCK        -1
1387
 
1387
 
1388
   /**
1388
   /**
1389
+   * Software enable
1390
+   *
1391
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1392
+   * function through a communication line such as SPI or UART.
1393
+   */
1394
+  //#define SOFTWARE_DRIVER_ENABLE
1395
+
1396
+  /**
1389
    * Use Trinamic's ultra quiet stepping mode.
1397
    * Use Trinamic's ultra quiet stepping mode.
1390
    * When disabled, Marlin will use spreadCycle stepping mode.
1398
    * When disabled, Marlin will use spreadCycle stepping mode.
1391
    */
1399
    */

+ 8
- 0
Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h View File

1386
   //#define TMC_SW_SCK        -1
1386
   //#define TMC_SW_SCK        -1
1387
 
1387
 
1388
   /**
1388
   /**
1389
+   * Software enable
1390
+   *
1391
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1392
+   * function through a communication line such as SPI or UART.
1393
+   */
1394
+  //#define SOFTWARE_DRIVER_ENABLE
1395
+
1396
+  /**
1389
    * Use Trinamic's ultra quiet stepping mode.
1397
    * Use Trinamic's ultra quiet stepping mode.
1390
    * When disabled, Marlin will use spreadCycle stepping mode.
1398
    * When disabled, Marlin will use spreadCycle stepping mode.
1391
    */
1399
    */

+ 8
- 0
Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/MakerParts/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Malyan/M150/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Malyan/M200/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Mks/Robin/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h View File

1389
   //#define TMC_SW_SCK        -1
1389
   //#define TMC_SW_SCK        -1
1390
 
1390
 
1391
   /**
1391
   /**
1392
+   * Software enable
1393
+   *
1394
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1395
+   * function through a communication line such as SPI or UART.
1396
+   */
1397
+  //#define SOFTWARE_DRIVER_ENABLE
1398
+
1399
+  /**
1392
    * Use Trinamic's ultra quiet stepping mode.
1400
    * Use Trinamic's ultra quiet stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1401
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    */
1402
    */

+ 8
- 0
Marlin/src/config/examples/RigidBot/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/SCARA/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Sanguinololu/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/TheBorg/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/TinyBoy2/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/VORONDesign/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h View File

1394
   //#define TMC_SW_SCK        -1
1394
   //#define TMC_SW_SCK        -1
1395
 
1395
 
1396
   /**
1396
   /**
1397
+   * Software enable
1398
+   *
1399
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1400
+   * function through a communication line such as SPI or UART.
1401
+   */
1402
+  //#define SOFTWARE_DRIVER_ENABLE
1403
+
1404
+  /**
1397
    * Use Trinamic's ultra quiet stepping mode.
1405
    * Use Trinamic's ultra quiet stepping mode.
1398
    * When disabled, Marlin will use spreadCycle stepping mode.
1406
    * When disabled, Marlin will use spreadCycle stepping mode.
1399
    */
1407
    */

+ 8
- 0
Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/WASP/PowerWASP/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 8
- 0
Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h View File

1356
   //#define TMC_SW_SCK        -1
1356
   //#define TMC_SW_SCK        -1
1357
 
1357
 
1358
   /**
1358
   /**
1359
+   * Software enable
1360
+   *
1361
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1362
+   * function through a communication line such as SPI or UART.
1363
+   */
1364
+  //#define SOFTWARE_DRIVER_ENABLE
1365
+
1366
+  /**
1359
    * Use Trinamic's ultra quiet stepping mode.
1367
    * Use Trinamic's ultra quiet stepping mode.
1360
    * When disabled, Marlin will use spreadCycle stepping mode.
1368
    * When disabled, Marlin will use spreadCycle stepping mode.
1361
    */
1369
    */

+ 8
- 0
Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/generic/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h View File

1383
   //#define TMC_SW_SCK        -1
1383
   //#define TMC_SW_SCK        -1
1384
 
1384
 
1385
   /**
1385
   /**
1386
+   * Software enable
1387
+   *
1388
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1389
+   * function through a communication line such as SPI or UART.
1390
+   */
1391
+  //#define SOFTWARE_DRIVER_ENABLE
1392
+
1393
+  /**
1386
    * Use Trinamic's ultra quiet stepping mode.
1394
    * Use Trinamic's ultra quiet stepping mode.
1387
    * When disabled, Marlin will use spreadCycle stepping mode.
1395
    * When disabled, Marlin will use spreadCycle stepping mode.
1388
    */
1396
    */

+ 8
- 0
Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/makibox/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h View File

1381
   //#define TMC_SW_SCK        -1
1381
   //#define TMC_SW_SCK        -1
1382
 
1382
 
1383
   /**
1383
   /**
1384
+   * Software enable
1385
+   *
1386
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1387
+   * function through a communication line such as SPI or UART.
1388
+   */
1389
+  //#define SOFTWARE_DRIVER_ENABLE
1390
+
1391
+  /**
1384
    * Use Trinamic's ultra quiet stepping mode.
1392
    * Use Trinamic's ultra quiet stepping mode.
1385
    * When disabled, Marlin will use spreadCycle stepping mode.
1393
    * When disabled, Marlin will use spreadCycle stepping mode.
1386
    */
1394
    */

+ 8
- 0
Marlin/src/config/examples/wt150/Configuration_adv.h View File

1382
   //#define TMC_SW_SCK        -1
1382
   //#define TMC_SW_SCK        -1
1383
 
1383
 
1384
   /**
1384
   /**
1385
+   * Software enable
1386
+   *
1387
+   * Use for drivers that do not use a dedicated enable pin, but rather handle the same
1388
+   * function through a communication line such as SPI or UART.
1389
+   */
1390
+  //#define SOFTWARE_DRIVER_ENABLE
1391
+
1392
+  /**
1385
    * Use Trinamic's ultra quiet stepping mode.
1393
    * Use Trinamic's ultra quiet stepping mode.
1386
    * When disabled, Marlin will use spreadCycle stepping mode.
1394
    * When disabled, Marlin will use spreadCycle stepping mode.
1387
    */
1395
    */

+ 50
- 0
Marlin/src/feature/tmc_util.cpp View File

40
   #endif
40
   #endif
41
 #endif
41
 #endif
42
 
42
 
43
+#if HAS_LCD_MENU
44
+  #include "../module/stepper.h"
45
+#endif
46
+
43
 /**
47
 /**
44
  * Check for over temperature or short to ground error flags.
48
  * Check for over temperature or short to ground error flags.
45
  * Report and log warning of overtemperature condition.
49
  * Report and log warning of overtemperature condition.
980
   if (axis_connection) ui.set_status_P(PSTR("TMC CONNECTION ERROR"));
984
   if (axis_connection) ui.set_status_P(PSTR("TMC CONNECTION ERROR"));
981
 }
985
 }
982
 
986
 
987
+#if HAS_LCD_MENU
988
+
989
+  void init_tmc_section() {
990
+    #if AXIS_IS_TMC(X)
991
+      stepperX.init_lcd_variables(X_AXIS);
992
+    #endif
993
+    #if AXIS_IS_TMC(Y)
994
+      stepperY.init_lcd_variables(Y_AXIS);
995
+    #endif
996
+    #if AXIS_IS_TMC(Z)
997
+      stepperZ.init_lcd_variables(Z_AXIS);
998
+    #endif
999
+    #if AXIS_IS_TMC(X2)
1000
+      stepperX2.init_lcd_variables(X_AXIS);
1001
+    #endif
1002
+    #if AXIS_IS_TMC(Y2)
1003
+      stepperY2.init_lcd_variables(Y_AXIS);
1004
+    #endif
1005
+    #if AXIS_IS_TMC(Z2)
1006
+      stepperZ2.init_lcd_variables(Z_AXIS);
1007
+    #endif
1008
+    #if AXIS_IS_TMC(Z3)
1009
+      stepperZ3.init_lcd_variables(Z_AXIS);
1010
+    #endif
1011
+    #if AXIS_IS_TMC(E0)
1012
+      stepperE0.init_lcd_variables(E_AXIS);
1013
+    #endif
1014
+    #if AXIS_IS_TMC(E1)
1015
+      stepperE1.init_lcd_variables(E_AXIS_N(1));
1016
+    #endif
1017
+    #if AXIS_IS_TMC(E2)
1018
+      stepperE2.init_lcd_variables(E_AXIS_N(2));
1019
+    #endif
1020
+    #if AXIS_IS_TMC(E3)
1021
+      stepperE3.init_lcd_variables(E_AXIS_N(3));
1022
+    #endif
1023
+    #if AXIS_IS_TMC(E4)
1024
+      stepperE4.init_lcd_variables(E_AXIS_N(4));
1025
+    #endif
1026
+    #if AXIS_IS_TMC(E5)
1027
+      stepperE5.init_lcd_variables(E_AXIS_N(5));
1028
+    #endif
1029
+  }
1030
+
1031
+#endif
1032
+
983
 #endif // HAS_TRINAMIC
1033
 #endif // HAS_TRINAMIC

+ 111
- 13
Marlin/src/feature/tmc_util.h View File

26
 #if HAS_TRINAMIC
26
 #if HAS_TRINAMIC
27
   #include <TMCStepper.h>
27
   #include <TMCStepper.h>
28
 #endif
28
 #endif
29
+#if HAS_LCD_MENU
30
+  #include "../module/planner.h"
31
+#endif
29
 
32
 
30
 #define TMC_X_LABEL 'X', '0'
33
 #define TMC_X_LABEL 'X', '0'
31
 #define TMC_Y_LABEL 'Y', '0'
34
 #define TMC_Y_LABEL 'Y', '0'
50
 #define CHOPPER_PRUSAMK3_24V { 4,  1, 4 }
53
 #define CHOPPER_PRUSAMK3_24V { 4,  1, 4 }
51
 #define CHOPPER_MARLIN_119   { 5,  2, 3 }
54
 #define CHOPPER_MARLIN_119   { 5,  2, 3 }
52
 
55
 
56
+constexpr uint16_t _tmc_thrs(const uint16_t msteps, const int32_t thrs, const uint32_t spmm) {
57
+  return 12650000UL * msteps / (256 * thrs * spmm);
58
+}
59
+
53
 template<char AXIS_LETTER, char DRIVER_ID>
60
 template<char AXIS_LETTER, char DRIVER_ID>
54
 class TMCStorage {
61
 class TMCStorage {
55
   protected:
62
   protected:
56
     // Only a child class has access to constructor => Don't create on its own! "Poor man's abstract class"
63
     // Only a child class has access to constructor => Don't create on its own! "Poor man's abstract class"
57
     TMCStorage() {}
64
     TMCStorage() {}
58
 
65
 
66
+  public:
59
     uint16_t val_mA = 0;
67
     uint16_t val_mA = 0;
60
 
68
 
61
-  public:
62
     #if ENABLED(MONITOR_DRIVER_STATUS)
69
     #if ENABLED(MONITOR_DRIVER_STATUS)
63
       uint8_t otpw_count = 0,
70
       uint8_t otpw_count = 0,
64
               error_count = 0;
71
               error_count = 0;
65
       bool flag_otpw = false;
72
       bool flag_otpw = false;
66
-      bool getOTPW() { return flag_otpw; }
67
-      void clear_otpw() { flag_otpw = 0; }
73
+      inline bool getOTPW() { return flag_otpw; }
74
+      inline void clear_otpw() { flag_otpw = 0; }
68
     #endif
75
     #endif
69
 
76
 
70
-    uint16_t getMilliamps() { return val_mA; }
77
+    inline uint16_t getMilliamps() { return val_mA; }
71
 
78
 
72
-    void printLabel() {
79
+    inline void printLabel() {
73
       SERIAL_CHAR(AXIS_LETTER);
80
       SERIAL_CHAR(AXIS_LETTER);
74
       if (DRIVER_ID > '0') SERIAL_CHAR(DRIVER_ID);
81
       if (DRIVER_ID > '0') SERIAL_CHAR(DRIVER_ID);
75
     }
82
     }
83
+
84
+    struct {
85
+      #if STEALTHCHOP_ENABLED
86
+        bool stealthChop_enabled = false;
87
+      #endif
88
+      #if ENABLED(HYBRID_THRESHOLD)
89
+        uint8_t hybrid_thrs = 0;
90
+      #endif
91
+      #if ENABLED(SENSORLESS_HOMING)
92
+        int8_t homing_thrs = 0;
93
+      #endif
94
+    } stored;
76
 };
95
 };
77
 
96
 
78
 template<class TMC, char AXIS_LETTER, char DRIVER_ID>
97
 template<class TMC, char AXIS_LETTER, char DRIVER_ID>
84
     TMCMarlin(uint16_t CS, float RS, uint16_t pinMOSI, uint16_t pinMISO, uint16_t pinSCK) :
103
     TMCMarlin(uint16_t CS, float RS, uint16_t pinMOSI, uint16_t pinMISO, uint16_t pinSCK) :
85
       TMC(CS, RS, pinMOSI, pinMISO, pinSCK)
104
       TMC(CS, RS, pinMOSI, pinMISO, pinSCK)
86
       {}
105
       {}
87
-    uint16_t rms_current() { return TMC::rms_current(); }
88
-    void rms_current(uint16_t mA) {
106
+    inline uint16_t rms_current() { return TMC::rms_current(); }
107
+    inline void rms_current(uint16_t mA) {
89
       this->val_mA = mA;
108
       this->val_mA = mA;
90
       TMC::rms_current(mA);
109
       TMC::rms_current(mA);
91
     }
110
     }
92
-    void rms_current(uint16_t mA, float mult) {
111
+    inline void rms_current(uint16_t mA, float mult) {
93
       this->val_mA = mA;
112
       this->val_mA = mA;
94
       TMC::rms_current(mA, mult);
113
       TMC::rms_current(mA, mult);
95
     }
114
     }
115
+
116
+    #if STEALTHCHOP_ENABLED
117
+      inline void refresh_stepping_mode() { this->en_pwm_mode(this->stored.stealthChop_enabled); }
118
+      inline bool get_stealthChop_status() { return this->en_pwm_mode(); }
119
+    #endif
120
+
121
+    #if HAS_LCD_MENU
122
+
123
+      inline void init_lcd_variables(const AxisEnum spmm_id) {
124
+        #if ENABLED(HYBRID_THRESHOLD)
125
+          this->stored.hybrid_thrs = _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[spmm_id]);
126
+        #endif
127
+        #if ENABLED(SENSORLESS_HOMING)
128
+          this->stored.homing_thrs = this->sgt();
129
+        #endif
130
+      }
131
+
132
+      inline void refresh_stepper_current() { rms_current(this->val_mA); }
133
+
134
+      #if ENABLED(HYBRID_THRESHOLD)
135
+        inline void refresh_hybrid_thrs(float spmm) { this->TPWMTHRS(_tmc_thrs(this->microsteps(), this->stored.hybrid_thrs, spmm)); }
136
+      #endif
137
+      #if ENABLED(SENSORLESS_HOMING)
138
+        inline void refresh_homing_thrs() { this->sgt(this->stored.homing_thrs); }
139
+      #endif
140
+    #endif
96
 };
141
 };
97
 template<char AXIS_LETTER, char DRIVER_ID>
142
 template<char AXIS_LETTER, char DRIVER_ID>
98
 class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID> : public TMC2208Stepper, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
143
 class TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID> : public TMC2208Stepper, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
104
       TMC2208Stepper(RX, TX, RS, has_rx=true)
149
       TMC2208Stepper(RX, TX, RS, has_rx=true)
105
       {}
150
       {}
106
     uint16_t rms_current() { return TMC2208Stepper::rms_current(); }
151
     uint16_t rms_current() { return TMC2208Stepper::rms_current(); }
107
-    void rms_current(uint16_t mA) {
152
+    inline void rms_current(uint16_t mA) {
108
       this->val_mA = mA;
153
       this->val_mA = mA;
109
       TMC2208Stepper::rms_current(mA);
154
       TMC2208Stepper::rms_current(mA);
110
     }
155
     }
111
-    void rms_current(uint16_t mA, float mult) {
156
+    inline void rms_current(uint16_t mA, float mult) {
112
       this->val_mA = mA;
157
       this->val_mA = mA;
113
       TMC2208Stepper::rms_current(mA, mult);
158
       TMC2208Stepper::rms_current(mA, mult);
114
     }
159
     }
160
+
161
+    #if STEALTHCHOP_ENABLED
162
+      inline void refresh_stepping_mode() { en_spreadCycle(!this->stored.stealthChop_enabled); }
163
+      inline bool get_stealthChop_status() { !this->en_spreadCycle(); }
164
+    #endif
165
+
166
+    #if HAS_LCD_MENU
167
+
168
+      inline void init_lcd_variables(const AxisEnum spmm_id) {
169
+        #if ENABLED(HYBRID_THRESHOLD)
170
+          this->stored.hybrid_thrs = _tmc_thrs(this->microsteps(), this->TPWMTHRS(), planner.settings.axis_steps_per_mm[spmm_id]);
171
+        #endif
172
+        #if STEALTHCHOP_ENABLED
173
+          this->stored.stealthChop_enabled = !this->en_spreadCycle();
174
+        #endif
175
+      }
176
+
177
+      inline void refresh_stepper_current() { rms_current(this->val_mA); }
178
+
179
+      #if ENABLED(HYBRID_THRESHOLD)
180
+        inline void refresh_hybrid_thrs(float spmm) { this->TPWMTHRS(_tmc_thrs(this->microsteps(), this->stored.hybrid_thrs, spmm)); }
181
+      #endif
182
+    #endif
115
 };
183
 };
184
+template<char AXIS_LETTER, char DRIVER_ID>
185
+class TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID> : public TMC2660Stepper, public TMCStorage<AXIS_LETTER, DRIVER_ID> {
186
+  public:
187
+    TMCMarlin(uint16_t cs_pin, float RS) :
188
+      TMC2660Stepper(cs_pin, RS)
189
+      {}
190
+    TMCMarlin(uint16_t CS, float RS, uint16_t pinMOSI, uint16_t pinMISO, uint16_t pinSCK) :
191
+      TMC2660Stepper(CS, RS, pinMOSI, pinMISO, pinSCK)
192
+      {}
193
+    inline uint16_t rms_current() { return TMC2660Stepper::rms_current(); }
194
+    inline void rms_current(uint16_t mA) {
195
+      this->val_mA = mA;
196
+      TMC2660Stepper::rms_current(mA);
197
+    }
116
 
198
 
117
-constexpr uint16_t _tmc_thrs(const uint16_t msteps, const int32_t thrs, const uint32_t spmm) {
118
-  return 12650000UL * msteps / (256 * thrs * spmm);
119
-}
199
+    #if HAS_LCD_MENU
200
+      inline void init_lcd_variables(const AxisEnum spmm_id) {
201
+        #if ENABLED(SENSORLESS_HOMING)
202
+          this->stored.homing_thrs = this->sgt();
203
+        #endif
204
+      }
205
+
206
+      inline void refresh_stepper_current() { rms_current(this->val_mA); }
207
+
208
+      #if ENABLED(SENSORLESS_HOMING)
209
+        inline void refresh_homing_thrs() { this->sgt(this->stored.homing_thrs); }
210
+      #endif
211
+    #endif
212
+};
120
 
213
 
121
 template<typename TMC>
214
 template<typename TMC>
122
 void tmc_get_current(TMC &st) {
215
 void tmc_get_current(TMC &st) {
127
 void tmc_set_current(TMC &st, const int mA) {
220
 void tmc_set_current(TMC &st, const int mA) {
128
   st.rms_current(mA);
221
   st.rms_current(mA);
129
 }
222
 }
223
+
130
 #if ENABLED(MONITOR_DRIVER_STATUS)
224
 #if ENABLED(MONITOR_DRIVER_STATUS)
131
   template<typename TMC>
225
   template<typename TMC>
132
   void tmc_report_otpw(TMC &st) {
226
   void tmc_report_otpw(TMC &st) {
173
   void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
267
   void tmc_get_registers(const bool print_x, const bool print_y, const bool print_z, const bool print_e);
174
 #endif
268
 #endif
175
 
269
 
270
+#if HAS_LCD_MENU
271
+  void init_tmc_section();
272
+#endif
273
+
176
 /**
274
 /**
177
  * TMC2130 specific sensorless homing using stallGuard2.
275
  * TMC2130 specific sensorless homing using stallGuard2.
178
  * stallGuard2 only works when in spreadCycle mode.
276
  * stallGuard2 only works when in spreadCycle mode.

+ 165
- 0
Marlin/src/gcode/feature/trinamic/M569.cpp View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 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
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if HAS_STEALTHCHOP
26
+
27
+#include "../../gcode.h"
28
+#include "../../../feature/tmc_util.h"
29
+#include "../../../module/stepper_indirection.h"
30
+
31
+template<typename TMC>
32
+void tmc_say_stealth_status(TMC &st) {
33
+  st.printLabel();
34
+  SERIAL_ECHOPGM(" driver mode:\t");
35
+  serialprintPGM(st.get_stealthChop_status() ? PSTR("stealthChop") : PSTR("spreadCycle"));
36
+  SERIAL_EOL();
37
+}
38
+template<typename TMC>
39
+void tmc_set_stealthChop(TMC &st, const bool enable) {
40
+  st.stored.stealthChop_enabled = enable;
41
+  st.refresh_stepping_mode();
42
+}
43
+
44
+static void set_stealth_status(const bool enable, const int8_t target_extruder) {
45
+  #define TMC_SET_STEALTH(Q) tmc_set_stealthChop(stepper##Q, enable)
46
+
47
+  #if AXIS_HAS_STEALTHCHOP(X) || AXIS_HAS_STEALTHCHOP(X2) || AXIS_HAS_STEALTHCHOP(Y) || AXIS_HAS_STEALTHCHOP(Y2) || AXIS_HAS_STEALTHCHOP(Z) || AXIS_HAS_STEALTHCHOP(Z2) || AXIS_HAS_STEALTHCHOP(Z3)
48
+    const uint8_t index = parser.byteval('I');
49
+  #endif
50
+
51
+  LOOP_XYZE(i) if (parser.seen(axis_codes[i])) {
52
+    switch (i) {
53
+      case X_AXIS:
54
+        #if AXIS_HAS_STEALTHCHOP(X)
55
+          if (index == 0) TMC_SET_STEALTH(X);
56
+        #endif
57
+        #if AXIS_HAS_STEALTHCHOP(X2)
58
+          if (index == 1) TMC_SET_STEALTH(X2);
59
+        #endif
60
+        break;
61
+      case Y_AXIS:
62
+        #if AXIS_HAS_STEALTHCHOP(Y)
63
+          if (index == 0) TMC_SET_STEALTH(Y);
64
+        #endif
65
+        #if AXIS_HAS_STEALTHCHOP(Y2)
66
+          if (index == 1) TMC_SET_STEALTH(Y2);
67
+        #endif
68
+        break;
69
+      case Z_AXIS:
70
+        #if AXIS_HAS_STEALTHCHOP(Z)
71
+          if (index == 0) TMC_SET_STEALTH(Z);
72
+        #endif
73
+        #if AXIS_HAS_STEALTHCHOP(Z2)
74
+          if (index == 1) TMC_SET_STEALTH(Z2);
75
+        #endif
76
+        #if AXIS_HAS_STEALTHCHOP(Z3)
77
+          if (index == 2) TMC_SET_STEALTH(Z3);
78
+        #endif
79
+        break;
80
+      case E_AXIS: {
81
+        if (target_extruder < 0) return;
82
+        switch (target_extruder) {
83
+          #if AXIS_HAS_STEALTHCHOP(E0)
84
+            case 0: TMC_SET_STEALTH(E0); break;
85
+          #endif
86
+          #if AXIS_HAS_STEALTHCHOP(E1)
87
+            case 1: TMC_SET_STEALTH(E1); break;
88
+          #endif
89
+          #if AXIS_HAS_STEALTHCHOP(E2)
90
+            case 2: TMC_SET_STEALTH(E2); break;
91
+          #endif
92
+          #if AXIS_HAS_STEALTHCHOP(E3)
93
+            case 3: TMC_SET_STEALTH(E3); break;
94
+          #endif
95
+          #if AXIS_HAS_STEALTHCHOP(E4)
96
+            case 4: TMC_SET_STEALTH(E4); break;
97
+          #endif
98
+          #if AXIS_HAS_STEALTHCHOP(E5)
99
+            case 5: TMC_SET_STEALTH(E5); break;
100
+          #endif
101
+        }
102
+      } break;
103
+    }
104
+  }
105
+}
106
+
107
+static void say_stealth_status() {
108
+  #define TMC_SAY_STEALTH_STATUS(Q) tmc_say_stealth_status(stepper##Q)
109
+
110
+  #if AXIS_HAS_STEALTHCHOP(X)
111
+    TMC_SAY_STEALTH_STATUS(X);
112
+  #endif
113
+  #if AXIS_HAS_STEALTHCHOP(X2)
114
+    TMC_SAY_STEALTH_STATUS(X2);
115
+  #endif
116
+  #if AXIS_HAS_STEALTHCHOP(Y)
117
+    TMC_SAY_STEALTH_STATUS(Y);
118
+  #endif
119
+  #if AXIS_HAS_STEALTHCHOP(Y2)
120
+    TMC_SAY_STEALTH_STATUS(Y2);
121
+  #endif
122
+  #if AXIS_HAS_STEALTHCHOP(Z)
123
+    TMC_SAY_STEALTH_STATUS(Z);
124
+  #endif
125
+  #if AXIS_HAS_STEALTHCHOP(Z2)
126
+    TMC_SAY_STEALTH_STATUS(Z2);
127
+  #endif
128
+  #if AXIS_HAS_STEALTHCHOP(Z3)
129
+    TMC_SAY_STEALTH_STATUS(Z3);
130
+  #endif
131
+  #if AXIS_HAS_STEALTHCHOP(E0)
132
+    TMC_SAY_STEALTH_STATUS(E0);
133
+  #endif
134
+  #if AXIS_HAS_STEALTHCHOP(E1)
135
+    TMC_SAY_STEALTH_STATUS(E1);
136
+  #endif
137
+  #if AXIS_HAS_STEALTHCHOP(E2)
138
+    TMC_SAY_STEALTH_STATUS(E2);
139
+  #endif
140
+  #if AXIS_HAS_STEALTHCHOP(E3)
141
+    TMC_SAY_STEALTH_STATUS(E3);
142
+  #endif
143
+  #if AXIS_HAS_STEALTHCHOP(E4)
144
+    TMC_SAY_STEALTH_STATUS(E4);
145
+  #endif
146
+  #if AXIS_HAS_STEALTHCHOP(E5)
147
+    TMC_SAY_STEALTH_STATUS(E5);
148
+  #endif
149
+}
150
+
151
+/**
152
+ * M569: Enable stealthChop on an axis
153
+ *
154
+ *   S[1|0] to enable or disable
155
+ *   XYZE to target an axis
156
+ *   No arguments reports the stealthChop status of all capable drivers.
157
+ */
158
+void GcodeSuite::M569() {
159
+  if (parser.seen('S'))
160
+    set_stealth_status(parser.value_bool(), get_target_extruder_from_command());
161
+  else
162
+    say_stealth_status();
163
+}
164
+
165
+#endif // HAS_STEALTHCHOP

+ 3
- 0
Marlin/src/gcode/gcode.cpp View File

652
       #if HAS_TRINAMIC
652
       #if HAS_TRINAMIC
653
         case 122: M122(); break;
653
         case 122: M122(); break;
654
         case 906: M906(); break;                                  // M906: Set motor current in milliamps using axis codes X, Y, Z, E
654
         case 906: M906(); break;                                  // M906: Set motor current in milliamps using axis codes X, Y, Z, E
655
+        #if HAS_STEALTHCHOP
656
+          case 569: M569(); break;                                // M569: Enable stealthChop on an axis.
657
+        #endif
655
         #if ENABLED(MONITOR_DRIVER_STATUS)
658
         #if ENABLED(MONITOR_DRIVER_STATUS)
656
           case 911: M911(); break;                                // M911: Report TMC2130 prewarn triggered flags
659
           case 911: M911(); break;                                // M911: Report TMC2130 prewarn triggered flags
657
           case 912: M912(); break;                                // M912: Clear TMC2130 prewarn triggered flags
660
           case 912: M912(); break;                                // M912: Clear TMC2130 prewarn triggered flags

+ 4
- 0
Marlin/src/gcode/gcode.h View File

209
  * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
209
  * M503 - Print the current settings (in memory): "M503 S<verbose>". S0 specifies compact output.
210
  * M524 - Abort the current SD print job (started with M24)
210
  * M524 - Abort the current SD print job (started with M24)
211
  * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
211
  * M540 - Enable/disable SD card abort on endstop hit: "M540 S<state>". (Requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
212
+ * M569 - Enable stealthChop on an axis. (Requires at least one #_X_DRIVER_TYPE to be TMC2130 or TMC2208)
212
  * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
213
  * M600 - Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
213
  * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
214
  * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
214
  * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
215
  * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
796
   #if HAS_TRINAMIC
797
   #if HAS_TRINAMIC
797
     static void M122();
798
     static void M122();
798
     static void M906();
799
     static void M906();
800
+    #if HAS_STEALTHCHOP
801
+      static void M569();
802
+    #endif
799
     #if ENABLED(MONITOR_DRIVER_STATUS)
803
     #if ENABLED(MONITOR_DRIVER_STATUS)
800
       static void M911();
804
       static void M911();
801
       static void M912();
805
       static void M912();

+ 13
- 13
Marlin/src/inc/Conditionals_post.h View File

779
  */
779
  */
780
 
780
 
781
 // Steppers
781
 // Steppers
782
-#define HAS_X_ENABLE      (PIN_EXISTS(X_ENABLE))
782
+#define HAS_X_ENABLE      (PIN_EXISTS(X_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X)))
783
 #define HAS_X_DIR         (PIN_EXISTS(X_DIR))
783
 #define HAS_X_DIR         (PIN_EXISTS(X_DIR))
784
 #define HAS_X_STEP        (PIN_EXISTS(X_STEP))
784
 #define HAS_X_STEP        (PIN_EXISTS(X_STEP))
785
 #define HAS_X_MICROSTEPS  (PIN_EXISTS(X_MS1))
785
 #define HAS_X_MICROSTEPS  (PIN_EXISTS(X_MS1))
786
 
786
 
787
-#define HAS_X2_ENABLE     (PIN_EXISTS(X2_ENABLE))
787
+#define HAS_X2_ENABLE     (PIN_EXISTS(X2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)))
788
 #define HAS_X2_DIR        (PIN_EXISTS(X2_DIR))
788
 #define HAS_X2_DIR        (PIN_EXISTS(X2_DIR))
789
 #define HAS_X2_STEP       (PIN_EXISTS(X2_STEP))
789
 #define HAS_X2_STEP       (PIN_EXISTS(X2_STEP))
790
 #define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1))
790
 #define HAS_X2_MICROSTEPS (PIN_EXISTS(X2_MS1))
791
 
791
 
792
-#define HAS_Y_ENABLE      (PIN_EXISTS(Y_ENABLE))
792
+#define HAS_Y_ENABLE      (PIN_EXISTS(Y_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)))
793
 #define HAS_Y_DIR         (PIN_EXISTS(Y_DIR))
793
 #define HAS_Y_DIR         (PIN_EXISTS(Y_DIR))
794
 #define HAS_Y_STEP        (PIN_EXISTS(Y_STEP))
794
 #define HAS_Y_STEP        (PIN_EXISTS(Y_STEP))
795
 #define HAS_Y_MICROSTEPS  (PIN_EXISTS(Y_MS1))
795
 #define HAS_Y_MICROSTEPS  (PIN_EXISTS(Y_MS1))
796
 
796
 
797
-#define HAS_Y2_ENABLE     (PIN_EXISTS(Y2_ENABLE))
797
+#define HAS_Y2_ENABLE     (PIN_EXISTS(Y2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)))
798
 #define HAS_Y2_DIR        (PIN_EXISTS(Y2_DIR))
798
 #define HAS_Y2_DIR        (PIN_EXISTS(Y2_DIR))
799
 #define HAS_Y2_STEP       (PIN_EXISTS(Y2_STEP))
799
 #define HAS_Y2_STEP       (PIN_EXISTS(Y2_STEP))
800
 #define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1))
800
 #define HAS_Y2_MICROSTEPS (PIN_EXISTS(Y2_MS1))
801
 
801
 
802
-#define HAS_Z_ENABLE      (PIN_EXISTS(Z_ENABLE))
802
+#define HAS_Z_ENABLE      (PIN_EXISTS(Z_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)))
803
 #define HAS_Z_DIR         (PIN_EXISTS(Z_DIR))
803
 #define HAS_Z_DIR         (PIN_EXISTS(Z_DIR))
804
 #define HAS_Z_STEP        (PIN_EXISTS(Z_STEP))
804
 #define HAS_Z_STEP        (PIN_EXISTS(Z_STEP))
805
 #define HAS_Z_MICROSTEPS  (PIN_EXISTS(Z_MS1))
805
 #define HAS_Z_MICROSTEPS  (PIN_EXISTS(Z_MS1))
806
 
806
 
807
-#define HAS_Z2_ENABLE     (PIN_EXISTS(Z2_ENABLE))
807
+#define HAS_Z2_ENABLE     (PIN_EXISTS(Z2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)))
808
 #define HAS_Z2_DIR        (PIN_EXISTS(Z2_DIR))
808
 #define HAS_Z2_DIR        (PIN_EXISTS(Z2_DIR))
809
 #define HAS_Z2_STEP       (PIN_EXISTS(Z2_STEP))
809
 #define HAS_Z2_STEP       (PIN_EXISTS(Z2_STEP))
810
 #define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1))
810
 #define HAS_Z2_MICROSTEPS (PIN_EXISTS(Z2_MS1))
811
 
811
 
812
-#define HAS_Z3_ENABLE     (PIN_EXISTS(Z3_ENABLE))
812
+#define HAS_Z3_ENABLE     (PIN_EXISTS(Z3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)))
813
 #define HAS_Z3_DIR        (PIN_EXISTS(Z3_DIR))
813
 #define HAS_Z3_DIR        (PIN_EXISTS(Z3_DIR))
814
 #define HAS_Z3_STEP       (PIN_EXISTS(Z3_STEP))
814
 #define HAS_Z3_STEP       (PIN_EXISTS(Z3_STEP))
815
 #define HAS_Z3_MICROSTEPS (PIN_EXISTS(Z3_MS1))
815
 #define HAS_Z3_MICROSTEPS (PIN_EXISTS(Z3_MS1))
816
 
816
 
817
 // Extruder steppers and solenoids
817
 // Extruder steppers and solenoids
818
-#define HAS_E0_ENABLE     (PIN_EXISTS(E0_ENABLE))
818
+#define HAS_E0_ENABLE     (PIN_EXISTS(E0_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)))
819
 #define HAS_E0_DIR        (PIN_EXISTS(E0_DIR))
819
 #define HAS_E0_DIR        (PIN_EXISTS(E0_DIR))
820
 #define HAS_E0_STEP       (PIN_EXISTS(E0_STEP))
820
 #define HAS_E0_STEP       (PIN_EXISTS(E0_STEP))
821
 #define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1))
821
 #define HAS_E0_MICROSTEPS (PIN_EXISTS(E0_MS1))
822
 #define HAS_SOLENOID_0    (PIN_EXISTS(SOL0))
822
 #define HAS_SOLENOID_0    (PIN_EXISTS(SOL0))
823
 
823
 
824
-#define HAS_E1_ENABLE     (PIN_EXISTS(E1_ENABLE))
824
+#define HAS_E1_ENABLE     (PIN_EXISTS(E1_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)))
825
 #define HAS_E1_DIR        (PIN_EXISTS(E1_DIR))
825
 #define HAS_E1_DIR        (PIN_EXISTS(E1_DIR))
826
 #define HAS_E1_STEP       (PIN_EXISTS(E1_STEP))
826
 #define HAS_E1_STEP       (PIN_EXISTS(E1_STEP))
827
 #define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1))
827
 #define HAS_E1_MICROSTEPS (PIN_EXISTS(E1_MS1))
828
 #define HAS_SOLENOID_1    (PIN_EXISTS(SOL1))
828
 #define HAS_SOLENOID_1    (PIN_EXISTS(SOL1))
829
 
829
 
830
-#define HAS_E2_ENABLE     (PIN_EXISTS(E2_ENABLE))
830
+#define HAS_E2_ENABLE     (PIN_EXISTS(E2_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)))
831
 #define HAS_E2_DIR        (PIN_EXISTS(E2_DIR))
831
 #define HAS_E2_DIR        (PIN_EXISTS(E2_DIR))
832
 #define HAS_E2_STEP       (PIN_EXISTS(E2_STEP))
832
 #define HAS_E2_STEP       (PIN_EXISTS(E2_STEP))
833
 #define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1))
833
 #define HAS_E2_MICROSTEPS (PIN_EXISTS(E2_MS1))
834
 #define HAS_SOLENOID_2    (PIN_EXISTS(SOL2))
834
 #define HAS_SOLENOID_2    (PIN_EXISTS(SOL2))
835
 
835
 
836
-#define HAS_E3_ENABLE     (PIN_EXISTS(E3_ENABLE))
836
+#define HAS_E3_ENABLE     (PIN_EXISTS(E3_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)))
837
 #define HAS_E3_DIR        (PIN_EXISTS(E3_DIR))
837
 #define HAS_E3_DIR        (PIN_EXISTS(E3_DIR))
838
 #define HAS_E3_STEP       (PIN_EXISTS(E3_STEP))
838
 #define HAS_E3_STEP       (PIN_EXISTS(E3_STEP))
839
 #define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1))
839
 #define HAS_E3_MICROSTEPS (PIN_EXISTS(E3_MS1))
840
 #define HAS_SOLENOID_3    (PIN_EXISTS(SOL3))
840
 #define HAS_SOLENOID_3    (PIN_EXISTS(SOL3))
841
 
841
 
842
-#define HAS_E4_ENABLE     (PIN_EXISTS(E4_ENABLE))
842
+#define HAS_E4_ENABLE     (PIN_EXISTS(E4_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)))
843
 #define HAS_E4_DIR        (PIN_EXISTS(E4_DIR))
843
 #define HAS_E4_DIR        (PIN_EXISTS(E4_DIR))
844
 #define HAS_E4_STEP       (PIN_EXISTS(E4_STEP))
844
 #define HAS_E4_STEP       (PIN_EXISTS(E4_STEP))
845
 #define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1))
845
 #define HAS_E4_MICROSTEPS (PIN_EXISTS(E4_MS1))
846
 #define HAS_SOLENOID_4    (PIN_EXISTS(SOL4))
846
 #define HAS_SOLENOID_4    (PIN_EXISTS(SOL4))
847
 
847
 
848
-#define HAS_E5_ENABLE     (PIN_EXISTS(E5_ENABLE))
848
+#define HAS_E5_ENABLE     (PIN_EXISTS(E5_ENABLE) || (ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)))
849
 #define HAS_E5_DIR        (PIN_EXISTS(E5_DIR))
849
 #define HAS_E5_DIR        (PIN_EXISTS(E5_DIR))
850
 #define HAS_E5_STEP       (PIN_EXISTS(E5_STEP))
850
 #define HAS_E5_STEP       (PIN_EXISTS(E5_STEP))
851
 #define HAS_E5_MICROSTEPS (PIN_EXISTS(E5_MS1))
851
 #define HAS_E5_MICROSTEPS (PIN_EXISTS(E5_MS1))

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

1298
   #error "TEMP_0_PIN not defined for this board."
1298
   #error "TEMP_0_PIN not defined for this board."
1299
 #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
1299
 #elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR)))
1300
   #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
1300
   #error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
1301
-#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !PIN_EXISTS(E0_ENABLE)))
1301
+#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PIN_EXISTS(E0_STEP) || !PIN_EXISTS(E0_DIR) || !HAS_E0_ENABLE))
1302
   #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1302
   #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1303
 #elif TEMP_SENSOR_0 == 0
1303
 #elif TEMP_SENSOR_0 == 0
1304
   #error "TEMP_SENSOR_0 is required."
1304
   #error "TEMP_SENSOR_0 is required."
1427
  */
1427
  */
1428
 #if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
1428
 #if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only
1429
   #if E_STEPPERS
1429
   #if E_STEPPERS
1430
-    #if !(PIN_EXISTS(E0_STEP) && PIN_EXISTS(E0_DIR) && PIN_EXISTS(E0_ENABLE))
1430
+    #if !(PIN_EXISTS(E0_STEP) && PIN_EXISTS(E0_DIR) && HAS_E0_ENABLE)
1431
       #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1431
       #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
1432
     #endif
1432
     #endif
1433
     #if E_STEPPERS > 1
1433
     #if E_STEPPERS > 1
1434
-      #if !(PIN_EXISTS(E1_STEP) && PIN_EXISTS(E1_DIR) && PIN_EXISTS(E1_ENABLE))
1434
+      #if !(PIN_EXISTS(E1_STEP) && PIN_EXISTS(E1_DIR) && HAS_E1_ENABLE)
1435
         #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
1435
         #error "E1_STEP_PIN, E1_DIR_PIN, or E1_ENABLE_PIN not defined for this board."
1436
       #endif
1436
       #endif
1437
       #if E_STEPPERS > 2
1437
       #if E_STEPPERS > 2
1438
-        #if !(PIN_EXISTS(E2_STEP) && PIN_EXISTS(E2_DIR) && PIN_EXISTS(E2_ENABLE))
1438
+        #if !(PIN_EXISTS(E2_STEP) && PIN_EXISTS(E2_DIR) && HAS_E2_ENABLE)
1439
           #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
1439
           #error "E2_STEP_PIN, E2_DIR_PIN, or E2_ENABLE_PIN not defined for this board."
1440
         #endif
1440
         #endif
1441
         #if E_STEPPERS > 3
1441
         #if E_STEPPERS > 3
1442
-          #if !(PIN_EXISTS(E3_STEP) && PIN_EXISTS(E3_DIR) && PIN_EXISTS(E3_ENABLE))
1442
+          #if !(PIN_EXISTS(E3_STEP) && PIN_EXISTS(E3_DIR) && HAS_E3_ENABLE)
1443
             #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
1443
             #error "E3_STEP_PIN, E3_DIR_PIN, or E3_ENABLE_PIN not defined for this board."
1444
           #endif
1444
           #endif
1445
           #if E_STEPPERS > 4
1445
           #if E_STEPPERS > 4
1446
-            #if !(PIN_EXISTS(E4_STEP) && PIN_EXISTS(E4_DIR) && PIN_EXISTS(E4_ENABLE))
1446
+            #if !(PIN_EXISTS(E4_STEP) && PIN_EXISTS(E4_DIR) && HAS_E4_ENABLE)
1447
               #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
1447
               #error "E4_STEP_PIN, E4_DIR_PIN, or E4_ENABLE_PIN not defined for this board."
1448
             #endif
1448
             #endif
1449
             #if E_STEPPERS > 5
1449
             #if E_STEPPERS > 5
1450
-              #if !(PIN_EXISTS(E5_STEP) && PIN_EXISTS(E5_DIR) && PIN_EXISTS(E5_ENABLE))
1450
+              #if !(PIN_EXISTS(E5_STEP) && PIN_EXISTS(E5_DIR) && HAS_E5_ENABLE)
1451
                 #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
1451
                 #error "E5_STEP_PIN, E5_DIR_PIN, or E5_ENABLE_PIN not defined for this board."
1452
               #endif
1452
               #endif
1453
             #endif // E_STEPPERS > 5
1453
             #endif // E_STEPPERS > 5

+ 5
- 0
Marlin/src/lcd/extensible_ui/ui_api.cpp View File

698
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
698
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
699
     SET_INPUT_PULLUP(SD_DETECT_PIN);
699
     SET_INPUT_PULLUP(SD_DETECT_PIN);
700
   #endif
700
   #endif
701
+
702
+  #if HAS_TRINAMIC
703
+    init_tmc_section();
704
+  #endif
705
+
701
   ExtUI::onStartup();
706
   ExtUI::onStartup();
702
 }
707
 }
703
 
708
 

+ 19
- 0
Marlin/src/lcd/language/language_en.h View File

1178
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Resuming...")
1178
     #define MSG_FILAMENT_CHANGE_RESUME_1      _UxGT("Resuming...")
1179
   #endif
1179
   #endif
1180
 #endif // LCD_HEIGHT < 4
1180
 #endif // LCD_HEIGHT < 4
1181
+
1182
+#ifndef MSG_TMC_DRIVERS
1183
+  #define MSG_TMC_DRIVERS                     _UxGT("TMC drivers")
1184
+#endif
1185
+#ifndef MSG_TMC_CURRENT
1186
+  #define MSG_TMC_CURRENT                     _UxGT("Driver current")
1187
+#endif
1188
+#ifndef MSG_TMC_HYBRID_THRS
1189
+  #define MSG_TMC_HYBRID_THRS                 _UxGT("Hybrid threshold")
1190
+#endif
1191
+#ifndef MSG_TMC_HOMING_THRS
1192
+  #define MSG_TMC_HOMING_THRS                 _UxGT("Sensorless homing")
1193
+#endif
1194
+#ifndef MSG_TMC_STEPPING_MODE
1195
+  #define MSG_TMC_STEPPING_MODE               _UxGT("Stepping mode")
1196
+#endif
1197
+#ifndef MSG_TMC_STEALTH_ENABLED
1198
+  #define MSG_TMC_STEALTH_ENABLED             _UxGT("StealthChop enabled")
1199
+#endif

+ 2
- 1
Marlin/src/lcd/menu/menu.cpp View File

164
 DEFINE_MENU_EDIT_ITEM(int4);
164
 DEFINE_MENU_EDIT_ITEM(int4);
165
 DEFINE_MENU_EDIT_ITEM(int8);
165
 DEFINE_MENU_EDIT_ITEM(int8);
166
 DEFINE_MENU_EDIT_ITEM(uint8);
166
 DEFINE_MENU_EDIT_ITEM(uint8);
167
-DEFINE_MENU_EDIT_ITEM(uint16);
167
+DEFINE_MENU_EDIT_ITEM(uint16_3);
168
+DEFINE_MENU_EDIT_ITEM(uint16_4);
168
 DEFINE_MENU_EDIT_ITEM(float3);
169
 DEFINE_MENU_EDIT_ITEM(float3);
169
 DEFINE_MENU_EDIT_ITEM(float52);
170
 DEFINE_MENU_EDIT_ITEM(float52);
170
 DEFINE_MENU_EDIT_ITEM(float43);
171
 DEFINE_MENU_EDIT_ITEM(float43);

+ 6
- 3
Marlin/src/lcd/menu/menu.h View File

47
 DECLARE_MENU_EDIT_TYPE(int16_t,  int4,        i16tostr4sign,   1     );
47
 DECLARE_MENU_EDIT_TYPE(int16_t,  int4,        i16tostr4sign,   1     );
48
 DECLARE_MENU_EDIT_TYPE(int8_t,   int8,        i8tostr3,        1     );
48
 DECLARE_MENU_EDIT_TYPE(int8_t,   int8,        i8tostr3,        1     );
49
 DECLARE_MENU_EDIT_TYPE(uint8_t,  uint8,       ui8tostr3,       1     );
49
 DECLARE_MENU_EDIT_TYPE(uint8_t,  uint8,       ui8tostr3,       1     );
50
-DECLARE_MENU_EDIT_TYPE(uint16_t, uint16,      ui16tostr3,      1     );
50
+DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_3,    ui16tostr3,      1     );
51
+DECLARE_MENU_EDIT_TYPE(uint16_t, uint16_4,    ui16tostr4,      0.1   );
51
 DECLARE_MENU_EDIT_TYPE(float,    float3,      ftostr3,         1     );
52
 DECLARE_MENU_EDIT_TYPE(float,    float3,      ftostr3,         1     );
52
 DECLARE_MENU_EDIT_TYPE(float,    float52,     ftostr52,      100     );
53
 DECLARE_MENU_EDIT_TYPE(float,    float52,     ftostr52,      100     );
53
 DECLARE_MENU_EDIT_TYPE(float,    float43,     ftostr43sign, 1000     );
54
 DECLARE_MENU_EDIT_TYPE(float,    float43,     ftostr43sign, 1000     );
105
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4);
106
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4);
106
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8);
107
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8);
107
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint8);
108
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint8);
108
-DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16);
109
+DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_3);
110
+DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(uint16_4);
109
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3);
111
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float3);
110
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52);
112
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float52);
111
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43);
113
 DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(float43);
176
 DECLARE_MENU_EDIT_ITEM(int4);
178
 DECLARE_MENU_EDIT_ITEM(int4);
177
 DECLARE_MENU_EDIT_ITEM(int8);
179
 DECLARE_MENU_EDIT_ITEM(int8);
178
 DECLARE_MENU_EDIT_ITEM(uint8);
180
 DECLARE_MENU_EDIT_ITEM(uint8);
179
-DECLARE_MENU_EDIT_ITEM(uint16);
181
+DECLARE_MENU_EDIT_ITEM(uint16_3);
182
+DECLARE_MENU_EDIT_ITEM(uint16_4);
180
 DECLARE_MENU_EDIT_ITEM(float3);
183
 DECLARE_MENU_EDIT_ITEM(float3);
181
 DECLARE_MENU_EDIT_ITEM(float52);
184
 DECLARE_MENU_EDIT_ITEM(float52);
182
 DECLARE_MENU_EDIT_ITEM(float43);
185
 DECLARE_MENU_EDIT_ITEM(float43);

+ 5
- 0
Marlin/src/lcd/menu/menu_configuration.cpp View File

44
 
44
 
45
 void menu_advanced_settings();
45
 void menu_advanced_settings();
46
 void menu_delta_calibrate();
46
 void menu_delta_calibrate();
47
+void menu_tmc();
47
 
48
 
48
 static void lcd_factory_settings() {
49
 static void lcd_factory_settings() {
49
   settings.reset();
50
   settings.reset();
353
     MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_pwm);
354
     MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_pwm);
354
   #endif
355
   #endif
355
 
356
 
357
+  #if HAS_TRINAMIC
358
+    MENU_ITEM(submenu, MSG_TMC_DRIVERS, menu_tmc);
359
+  #endif
360
+
356
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
361
   #if ENABLED(FILAMENT_RUNOUT_SENSOR)
357
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled, runout.reset);
362
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_RUNOUT_SENSOR_ENABLE, &runout.enabled, runout.reset);
358
   #endif
363
   #endif

+ 352
- 0
Marlin/src/lcd/menu/menu_tmc.cpp View File

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 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
+// TMC Menu
25
+//
26
+
27
+#include "../../inc/MarlinConfigPre.h"
28
+
29
+#if HAS_TRINAMIC && HAS_LCD_MENU
30
+
31
+#include "menu.h"
32
+#include "../../module/stepper_indirection.h"
33
+#include "../../feature/tmc_util.h"
34
+
35
+#define TMC_EDIT_STORED_I_RMS(ST) MENU_ITEM_EDIT_CALLBACK(uint16_4, MSG_##ST, &stepper##ST.val_mA, 100, 3000, refresh_stepper_current_##ST)
36
+
37
+#if AXIS_IS_TMC(X)
38
+  void refresh_stepper_current_X()  { stepperX.refresh_stepper_current();  }
39
+#endif
40
+#if AXIS_IS_TMC(Y)
41
+  void refresh_stepper_current_Y()  { stepperY.refresh_stepper_current();  }
42
+#endif
43
+#if AXIS_IS_TMC(Z)
44
+  void refresh_stepper_current_Z()  { stepperZ.refresh_stepper_current();  }
45
+#endif
46
+#if AXIS_IS_TMC(X2)
47
+  void refresh_stepper_current_X2() { stepperX2.refresh_stepper_current(); }
48
+#endif
49
+#if AXIS_IS_TMC(Y2)
50
+  void refresh_stepper_current_Y2() { stepperY2.refresh_stepper_current(); }
51
+#endif
52
+#if AXIS_IS_TMC(Z2)
53
+  void refresh_stepper_current_Z2() { stepperZ2.refresh_stepper_current(); }
54
+#endif
55
+#if AXIS_IS_TMC(Z3)
56
+  void refresh_stepper_current_Z3() { stepperZ3.refresh_stepper_current(); }
57
+#endif
58
+#if AXIS_IS_TMC(E0)
59
+  void refresh_stepper_current_E0() { stepperE0.refresh_stepper_current(); }
60
+#endif
61
+#if AXIS_IS_TMC(E1)
62
+  void refresh_stepper_current_E1() { stepperE1.refresh_stepper_current(); }
63
+#endif
64
+#if AXIS_IS_TMC(E2)
65
+  void refresh_stepper_current_E2() { stepperE2.refresh_stepper_current(); }
66
+#endif
67
+#if AXIS_IS_TMC(E3)
68
+  void refresh_stepper_current_E3() { stepperE3.refresh_stepper_current(); }
69
+#endif
70
+#if AXIS_IS_TMC(E4)
71
+  void refresh_stepper_current_E4() { stepperE4.refresh_stepper_current(); }
72
+#endif
73
+#if AXIS_IS_TMC(E5)
74
+  void refresh_stepper_current_E5() { stepperE5.refresh_stepper_current(); }
75
+#endif
76
+
77
+void menu_tmc_current() {
78
+  START_MENU();
79
+  MENU_BACK(MSG_TMC_DRIVERS);
80
+  #if AXIS_IS_TMC(X)
81
+    TMC_EDIT_STORED_I_RMS(X);
82
+  #endif
83
+  #if AXIS_IS_TMC(Y)
84
+    TMC_EDIT_STORED_I_RMS(Y);
85
+  #endif
86
+  #if AXIS_IS_TMC(Z)
87
+    TMC_EDIT_STORED_I_RMS(Z);
88
+  #endif
89
+  #if AXIS_IS_TMC(X2)
90
+    TMC_EDIT_STORED_I_RMS(X2);
91
+  #endif
92
+  #if AXIS_IS_TMC(Y2)
93
+    TMC_EDIT_STORED_I_RMS(Y2);
94
+  #endif
95
+  #if AXIS_IS_TMC(Z2)
96
+    TMC_EDIT_STORED_I_RMS(Z2);
97
+  #endif
98
+  #if AXIS_IS_TMC(Z3)
99
+    TMC_EDIT_STORED_I_RMS(Z3);
100
+  #endif
101
+  #if AXIS_IS_TMC(E0)
102
+    TMC_EDIT_STORED_I_RMS(E0);
103
+  #endif
104
+  #if AXIS_IS_TMC(E1)
105
+    TMC_EDIT_STORED_I_RMS(E1);
106
+  #endif
107
+  #if AXIS_IS_TMC(E2)
108
+    TMC_EDIT_STORED_I_RMS(E2);
109
+  #endif
110
+  #if AXIS_IS_TMC(E3)
111
+    TMC_EDIT_STORED_I_RMS(E3);
112
+  #endif
113
+  #if AXIS_IS_TMC(E4)
114
+    TMC_EDIT_STORED_I_RMS(E4);
115
+  #endif
116
+  #if AXIS_IS_TMC(E5)
117
+    TMC_EDIT_STORED_I_RMS(E5);
118
+  #endif
119
+  END_MENU();
120
+}
121
+
122
+#if ENABLED(HYBRID_THRESHOLD)
123
+
124
+  #define TMC_EDIT_STORED_HYBRID_THRS(ST) MENU_ITEM_EDIT_CALLBACK(uint8, MSG_##ST, &stepper##ST.stored.hybrid_thrs, 0, 255, refresh_hybrid_thrs_##ST);
125
+
126
+  #if AXIS_HAS_STEALTHCHOP(X)
127
+    void refresh_hybrid_thrs_X()  {  stepperX.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[X_AXIS]); }
128
+  #endif
129
+  #if AXIS_HAS_STEALTHCHOP(Y)
130
+    void refresh_hybrid_thrs_Y()  {  stepperY.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[Y_AXIS]); }
131
+  #endif
132
+  #if AXIS_HAS_STEALTHCHOP(Z)
133
+    void refresh_hybrid_thrs_Z()  {  stepperZ.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[Z_AXIS]); }
134
+  #endif
135
+  #if AXIS_HAS_STEALTHCHOP(X2)
136
+    void refresh_hybrid_thrs_X2() { stepperX2.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[X_AXIS]); }
137
+  #endif
138
+  #if AXIS_HAS_STEALTHCHOP(Y2)
139
+    void refresh_hybrid_thrs_Y2() { stepperY2.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[Y_AXIS]); }
140
+  #endif
141
+  #if AXIS_HAS_STEALTHCHOP(Z2)
142
+    void refresh_hybrid_thrs_Z2() { stepperZ2.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[Z_AXIS]); }
143
+  #endif
144
+  #if AXIS_HAS_STEALTHCHOP(Z3)
145
+    void refresh_hybrid_thrs_Z3() { stepperZ3.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[Z_AXIS]); }
146
+  #endif
147
+  #if AXIS_HAS_STEALTHCHOP(E0)
148
+    void refresh_hybrid_thrs_E0() { stepperE0.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[E_AXIS]); }
149
+  #endif
150
+  #if AXIS_HAS_STEALTHCHOP(E1)
151
+    void refresh_hybrid_thrs_E1() { stepperE1.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); }
152
+  #endif
153
+  #if AXIS_HAS_STEALTHCHOP(E2)
154
+    void refresh_hybrid_thrs_E2() { stepperE2.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[E_AXIS_N(2)]); }
155
+  #endif
156
+  #if AXIS_HAS_STEALTHCHOP(E3)
157
+    void refresh_hybrid_thrs_E3() { stepperE3.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[E_AXIS_N(3)]); }
158
+  #endif
159
+  #if AXIS_HAS_STEALTHCHOP(E4)
160
+    void refresh_hybrid_thrs_E4() { stepperE4.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[E_AXIS_N(4)]); }
161
+  #endif
162
+  #if AXIS_HAS_STEALTHCHOP(E5)
163
+    void refresh_hybrid_thrs_E5() { stepperE5.refresh_hybrid_thrs(planner.settings.axis_steps_per_mm[E_AXIS_N(5)]); }
164
+  #endif
165
+
166
+  void menu_tmc_hybrid_thrs() {
167
+    START_MENU();
168
+    MENU_BACK(MSG_TMC_DRIVERS);
169
+    #if AXIS_HAS_STEALTHCHOP(X)
170
+      TMC_EDIT_STORED_HYBRID_THRS(X);
171
+    #endif
172
+    #if AXIS_HAS_STEALTHCHOP(Y)
173
+      TMC_EDIT_STORED_HYBRID_THRS(Y);
174
+    #endif
175
+    #if AXIS_HAS_STEALTHCHOP(Z)
176
+      TMC_EDIT_STORED_HYBRID_THRS(Z);
177
+    #endif
178
+    #if AXIS_HAS_STEALTHCHOP(X2)
179
+      TMC_EDIT_STORED_HYBRID_THRS(X2);
180
+    #endif
181
+    #if AXIS_HAS_STEALTHCHOP(Y2)
182
+      TMC_EDIT_STORED_HYBRID_THRS(Y2);
183
+    #endif
184
+    #if AXIS_HAS_STEALTHCHOP(Z2)
185
+      TMC_EDIT_STORED_HYBRID_THRS(Z2);
186
+    #endif
187
+    #if AXIS_HAS_STEALTHCHOP(Z3)
188
+      TMC_EDIT_STORED_HYBRID_THRS(Z3);
189
+    #endif
190
+    #if AXIS_HAS_STEALTHCHOP(E0)
191
+      TMC_EDIT_STORED_HYBRID_THRS(E0);
192
+    #endif
193
+    #if AXIS_HAS_STEALTHCHOP(E1)
194
+      TMC_EDIT_STORED_HYBRID_THRS(E1);
195
+    #endif
196
+    #if AXIS_HAS_STEALTHCHOP(E2)
197
+      TMC_EDIT_STORED_HYBRID_THRS(E2);
198
+    #endif
199
+    #if AXIS_HAS_STEALTHCHOP(E3)
200
+      TMC_EDIT_STORED_HYBRID_THRS(E3);
201
+    #endif
202
+    #if AXIS_HAS_STEALTHCHOP(E4)
203
+      TMC_EDIT_STORED_HYBRID_THRS(E4);
204
+    #endif
205
+    #if AXIS_HAS_STEALTHCHOP(E5)
206
+      TMC_EDIT_STORED_HYBRID_THRS(E5);
207
+    #endif
208
+    END_MENU();
209
+  }
210
+
211
+#endif
212
+
213
+#if ENABLED(SENSORLESS_HOMING)
214
+
215
+  #define TMC_EDIT_STORED_SGT(ST) MENU_ITEM_EDIT_CALLBACK(int8, MSG_##ST, &stepper##ST.stored.homing_thrs, -64, 63, refresh_homing_thrs_##ST);
216
+
217
+  #if X_SENSORLESS
218
+    void refresh_homing_thrs_X()  { stepperX.refresh_homing_thrs();  }
219
+  #endif
220
+  #if Y_SENSORLESS
221
+    void refresh_homing_thrs_Y()  { stepperY.refresh_homing_thrs();  }
222
+  #endif
223
+  #if Z_SENSORLESS
224
+    void refresh_homing_thrs_Z()  { stepperZ.refresh_homing_thrs();  }
225
+  #endif
226
+
227
+  void menu_tmc_homing_thrs() {
228
+    START_MENU();
229
+    MENU_BACK(MSG_TMC_DRIVERS);
230
+    #if X_SENSORLESS
231
+      TMC_EDIT_STORED_SGT(X);
232
+    #endif
233
+    #if Y_SENSORLESS
234
+      TMC_EDIT_STORED_SGT(Y);
235
+    #endif
236
+    #if Z_SENSORLESS
237
+      TMC_EDIT_STORED_SGT(Z);
238
+    #endif
239
+    END_MENU();
240
+  }
241
+
242
+#endif
243
+
244
+#if STEALTHCHOP_ENABLED
245
+
246
+  #define TMC_EDIT_STEP_MODE(ST) MENU_ITEM_EDIT_CALLBACK(bool, MSG_##ST, &stepper##ST.stored.stealthChop_enabled, refresh_stepping_mode_##ST)
247
+
248
+  #if AXIS_HAS_STEALTHCHOP(X)
249
+    void refresh_stepping_mode_X()  { stepperX.refresh_stepping_mode();  }
250
+  #endif
251
+  #if AXIS_HAS_STEALTHCHOP(Y)
252
+    void refresh_stepping_mode_Y()  { stepperY.refresh_stepping_mode();  }
253
+  #endif
254
+  #if AXIS_HAS_STEALTHCHOP(Z)
255
+    void refresh_stepping_mode_Z()  { stepperZ.refresh_stepping_mode();  }
256
+  #endif
257
+  #if AXIS_HAS_STEALTHCHOP(X2)
258
+    void refresh_stepping_mode_X2() { stepperX2.refresh_stepping_mode(); }
259
+  #endif
260
+  #if AXIS_HAS_STEALTHCHOP(Y2)
261
+    void refresh_stepping_mode_Y2() { stepperY2.refresh_stepping_mode(); }
262
+  #endif
263
+  #if AXIS_HAS_STEALTHCHOP(Z2)
264
+    void refresh_stepping_mode_Z2() { stepperZ2.refresh_stepping_mode(); }
265
+  #endif
266
+  #if AXIS_HAS_STEALTHCHOP(Z3)
267
+    void refresh_stepping_mode_Z3() { stepperZ3.refresh_stepping_mode(); }
268
+  #endif
269
+  #if AXIS_HAS_STEALTHCHOP(E0)
270
+    void refresh_stepping_mode_E0() { stepperE0.refresh_stepping_mode(); }
271
+  #endif
272
+  #if AXIS_HAS_STEALTHCHOP(E1)
273
+    void refresh_stepping_mode_E1() { stepperE1.refresh_stepping_mode(); }
274
+  #endif
275
+  #if AXIS_HAS_STEALTHCHOP(E2)
276
+    void refresh_stepping_mode_E2() { stepperE2.refresh_stepping_mode(); }
277
+  #endif
278
+  #if AXIS_HAS_STEALTHCHOP(E3)
279
+    void refresh_stepping_mode_E3() { stepperE3.refresh_stepping_mode(); }
280
+  #endif
281
+  #if AXIS_HAS_STEALTHCHOP(E4)
282
+    void refresh_stepping_mode_E4() { stepperE4.refresh_stepping_mode(); }
283
+  #endif
284
+  #if AXIS_HAS_STEALTHCHOP(E5)
285
+    void refresh_stepping_mode_E5() { stepperE5.refresh_stepping_mode(); }
286
+  #endif
287
+
288
+  void menu_tmc_step_mode() {
289
+    START_MENU();
290
+    STATIC_ITEM(MSG_TMC_STEALTH_ENABLED);
291
+    MENU_BACK(MSG_TMC_DRIVERS);
292
+    #if AXIS_HAS_STEALTHCHOP(X)
293
+      TMC_EDIT_STEP_MODE(X);
294
+    #endif
295
+    #if AXIS_HAS_STEALTHCHOP(Y)
296
+      TMC_EDIT_STEP_MODE(Y);
297
+    #endif
298
+    #if AXIS_HAS_STEALTHCHOP(Z)
299
+      TMC_EDIT_STEP_MODE(Z);
300
+    #endif
301
+    #if AXIS_HAS_STEALTHCHOP(X2)
302
+      TMC_EDIT_STEP_MODE(X2);
303
+    #endif
304
+    #if AXIS_HAS_STEALTHCHOP(Y2)
305
+      TMC_EDIT_STEP_MODE(Y2);
306
+    #endif
307
+    #if AXIS_HAS_STEALTHCHOP(Z2)
308
+      TMC_EDIT_STEP_MODE(Z2);
309
+    #endif
310
+    #if AXIS_HAS_STEALTHCHOP(Z3)
311
+      TMC_EDIT_STEP_MODE(Z3);
312
+    #endif
313
+    #if AXIS_HAS_STEALTHCHOP(E0)
314
+      TMC_EDIT_STEP_MODE(E0);
315
+    #endif
316
+    #if AXIS_HAS_STEALTHCHOP(E1)
317
+      TMC_EDIT_STEP_MODE(E1);
318
+    #endif
319
+    #if AXIS_HAS_STEALTHCHOP(E2)
320
+      TMC_EDIT_STEP_MODE(E2);
321
+    #endif
322
+    #if AXIS_HAS_STEALTHCHOP(E3)
323
+      TMC_EDIT_STEP_MODE(E3);
324
+    #endif
325
+    #if AXIS_HAS_STEALTHCHOP(E4)
326
+      TMC_EDIT_STEP_MODE(E4);
327
+    #endif
328
+    #if AXIS_HAS_STEALTHCHOP(E5)
329
+      TMC_EDIT_STEP_MODE(E5);
330
+    #endif
331
+    END_MENU();
332
+  }
333
+
334
+#endif
335
+
336
+void menu_tmc() {
337
+  START_MENU();
338
+  MENU_BACK(MSG_CONTROL);
339
+  MENU_ITEM(submenu, MSG_TMC_CURRENT, menu_tmc_current);
340
+  #if ENABLED(HYBRID_THRESHOLD)
341
+    MENU_ITEM(submenu, MSG_TMC_HYBRID_THRS, menu_tmc_hybrid_thrs);
342
+  #endif
343
+  #if ENABLED(SENSORLESS_HOMING)
344
+    MENU_ITEM(submenu, MSG_TMC_HOMING_THRS, menu_tmc_homing_thrs);
345
+  #endif
346
+  #if STEALTHCHOP_ENABLED
347
+    MENU_ITEM(submenu, MSG_TMC_STEPPING_MODE, menu_tmc_step_mode);
348
+  #endif
349
+  END_MENU();
350
+}
351
+
352
+#endif // HAS_TRINAMIC

+ 8
- 0
Marlin/src/lcd/ultralcd.cpp View File

85
   #include "../libs/buzzer.h"
85
   #include "../libs/buzzer.h"
86
 #endif
86
 #endif
87
 
87
 
88
+#if HAS_TRINAMIC
89
+  #include "../feature/tmc_util.h"
90
+#endif
91
+
88
 #if HAS_ENCODER_ACTION
92
 #if HAS_ENCODER_ACTION
89
   volatile uint8_t MarlinUI::buttons;
93
   volatile uint8_t MarlinUI::buttons;
90
   #if HAS_SLOW_BUTTONS
94
   #if HAS_SLOW_BUTTONS
255
   #if HAS_ENCODER_ACTION
259
   #if HAS_ENCODER_ACTION
256
     encoderDiff = 0;
260
     encoderDiff = 0;
257
   #endif
261
   #endif
262
+
263
+  #if HAS_TRINAMIC
264
+    init_tmc_section();
265
+  #endif
258
 }
266
 }
259
 
267
 
260
 bool MarlinUI::get_blink() {
268
 bool MarlinUI::get_blink() {

+ 210
- 1
Marlin/src/module/configuration_store.cpp View File

37
  */
37
  */
38
 
38
 
39
 // Change EEPROM version if the structure changes
39
 // Change EEPROM version if the structure changes
40
-#define EEPROM_VERSION "V63"
40
+#define EEPROM_VERSION "V64"
41
 #define EEPROM_OFFSET 100
41
 #define EEPROM_OFFSET 100
42
 
42
 
43
 // Check the integrity of data offsets.
43
 // Check the integrity of data offsets.
48
 
48
 
49
 #if ADD_PORT_ARG
49
 #if ADD_PORT_ARG
50
   #define PORTARG_SOLO     const int8_t port
50
   #define PORTARG_SOLO     const int8_t port
51
+  #define PORTARG_BEFORE   const int8_t port,
51
   #define PORTARG_AFTER   ,const int8_t port
52
   #define PORTARG_AFTER   ,const int8_t port
52
   #define PORTVAR_SOLO     port
53
   #define PORTVAR_SOLO     port
54
+  #define PORTVAR_BEFORE   port,
53
 #else
55
 #else
54
   #define PORTARG_SOLO
56
   #define PORTARG_SOLO
57
+  #define PORTARG_BEFORE
55
   #define PORTARG_AFTER
58
   #define PORTARG_AFTER
56
   #define PORTVAR_SOLO
59
   #define PORTVAR_SOLO
60
+  #define PORTVAR_BEFORE
57
 #endif
61
 #endif
58
 
62
 
59
 #include "endstops.h"
63
 #include "endstops.h"
112
 typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
116
 typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
113
 typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_hybrid_threshold_t;
117
 typedef struct { uint32_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_hybrid_threshold_t;
114
 typedef struct {  int16_t X, Y, Z;                                         } tmc_sgt_t;
118
 typedef struct {  int16_t X, Y, Z;                                         } tmc_sgt_t;
119
+typedef struct {     bool X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stealth_enabled_t;
115
 
120
 
116
 // Limit an index to an array size
121
 // Limit an index to an array size
117
 #define ALIM(I,ARR) MIN(I, COUNT(ARR) - 1)
122
 #define ALIM(I,ARR) MIN(I, COUNT(ARR) - 1)
256
   tmc_stepper_current_t tmc_stepper_current;            // M906 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
261
   tmc_stepper_current_t tmc_stepper_current;            // M906 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
257
   tmc_hybrid_threshold_t tmc_hybrid_threshold;          // M913 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
262
   tmc_hybrid_threshold_t tmc_hybrid_threshold;          // M913 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
258
   tmc_sgt_t tmc_sgt;                                    // M914 X Y Z
263
   tmc_sgt_t tmc_sgt;                                    // M914 X Y Z
264
+  tmc_stealth_enabled_t tmc_stealth_enabled;            // M569 X Y Z X2 Y2 Z2 Z3 E0 E1 E2 E3 E4 E5
259
 
265
 
260
   //
266
   //
261
   // LIN_ADVANCE
267
   // LIN_ADVANCE
975
     }
981
     }
976
 
982
 
977
     //
983
     //
984
+    // TMC stepping mode
985
+    //
986
+    {
987
+      _FIELD_TEST(tmc_stealth_enabled);
988
+
989
+      tmc_stealth_enabled_t tmc_stealth_enabled = { false, false, false, false, false, false, false, false, false, false, false, false, false };
990
+
991
+      #if HAS_STEALTHCHOP
992
+        #if AXIS_HAS_STEALTHCHOP(X)
993
+          tmc_stealth_enabled.X = stepperX.get_stealthChop_status();
994
+        #endif
995
+        #if AXIS_HAS_STEALTHCHOP(Y)
996
+          tmc_stealth_enabled.Y = stepperY.get_stealthChop_status();
997
+        #endif
998
+        #if AXIS_HAS_STEALTHCHOP(Z)
999
+          tmc_stealth_enabled.Z = stepperZ.get_stealthChop_status();
1000
+        #endif
1001
+        #if AXIS_HAS_STEALTHCHOP(X2)
1002
+          tmc_stealth_enabled.X2 = stepperX2.get_stealthChop_status();
1003
+        #endif
1004
+        #if AXIS_HAS_STEALTHCHOP(Y2)
1005
+          tmc_stealth_enabled.Y2 = stepperY2.get_stealthChop_status();
1006
+        #endif
1007
+        #if AXIS_HAS_STEALTHCHOP(Z2)
1008
+          tmc_stealth_enabled.Z2 = stepperZ2.get_stealthChop_status();
1009
+        #endif
1010
+        #if AXIS_HAS_STEALTHCHOP(Z3)
1011
+          tmc_stealth_enabled.Z3 = stepperZ3.get_stealthChop_status();
1012
+        #endif
1013
+        #if MAX_EXTRUDERS
1014
+          #if AXIS_HAS_STEALTHCHOP(E0)
1015
+            tmc_stealth_enabled.E0 = stepperE0.get_stealthChop_status();
1016
+          #endif
1017
+          #if MAX_EXTRUDERS > 1
1018
+            #if AXIS_HAS_STEALTHCHOP(E1)
1019
+              tmc_stealth_enabled.E1 = stepperE1.get_stealthChop_status();
1020
+            #endif
1021
+            #if MAX_EXTRUDERS > 2
1022
+              #if AXIS_HAS_STEALTHCHOP(E2)
1023
+                tmc_stealth_enabled.E2 = stepperE2.get_stealthChop_status();
1024
+              #endif
1025
+              #if MAX_EXTRUDERS > 3
1026
+                #if AXIS_HAS_STEALTHCHOP(E3)
1027
+                  tmc_stealth_enabled.E3 = stepperE3.get_stealthChop_status();
1028
+                #endif
1029
+                #if MAX_EXTRUDERS > 4
1030
+                  #if AXIS_HAS_STEALTHCHOP(E4)
1031
+                    tmc_stealth_enabled.E4 = stepperE4.get_stealthChop_status();
1032
+                  #endif
1033
+                  #if MAX_EXTRUDERS > 5
1034
+                    #if AXIS_HAS_STEALTHCHOP(E5)
1035
+                      tmc_stealth_enabled.E5 = stepperE5.get_stealthChop_status();
1036
+                    #endif
1037
+                  #endif // MAX_EXTRUDERS > 5
1038
+                #endif // MAX_EXTRUDERS > 4
1039
+              #endif // MAX_EXTRUDERS > 3
1040
+            #endif // MAX_EXTRUDERS > 2
1041
+          #endif // MAX_EXTRUDERS > 1
1042
+        #endif // MAX_EXTRUDERS
1043
+      #endif
1044
+      EEPROM_WRITE(tmc_stealth_enabled);
1045
+    }
1046
+
1047
+    //
978
     // Linear Advance
1048
     // Linear Advance
979
     //
1049
     //
980
     {
1050
     {
1630
         #endif
1700
         #endif
1631
       }
1701
       }
1632
 
1702
 
1703
+      // TMC stepping mode
1704
+      {
1705
+        _FIELD_TEST(tmc_stealth_enabled);
1706
+
1707
+        tmc_stealth_enabled_t tmc_stealth_enabled;
1708
+        EEPROM_READ(tmc_stealth_enabled);
1709
+
1710
+        #if HAS_TRINAMIC
1711
+
1712
+          #define SET_STEPPING_MODE(ST) stepper##ST.stored.stealthChop_enabled = tmc_stealth_enabled.ST; stepper##ST.refresh_stepping_mode();
1713
+          if (!validating) {
1714
+            #if AXIS_HAS_STEALTHCHOP(X)
1715
+              SET_STEPPING_MODE(X);
1716
+            #endif
1717
+            #if AXIS_HAS_STEALTHCHOP(Y)
1718
+              SET_STEPPING_MODE(Y);
1719
+            #endif
1720
+            #if AXIS_HAS_STEALTHCHOP(Z)
1721
+              SET_STEPPING_MODE(Z);
1722
+            #endif
1723
+            #if AXIS_HAS_STEALTHCHOP(X2)
1724
+              SET_STEPPING_MODE(X2);
1725
+            #endif
1726
+            #if AXIS_HAS_STEALTHCHOP(Y2)
1727
+              SET_STEPPING_MODE(Y2);
1728
+            #endif
1729
+            #if AXIS_HAS_STEALTHCHOP(Z2)
1730
+              SET_STEPPING_MODE(Z2);
1731
+            #endif
1732
+            #if AXIS_HAS_STEALTHCHOP(Z3)
1733
+              SET_STEPPING_MODE(Z3);
1734
+            #endif
1735
+            #if AXIS_HAS_STEALTHCHOP(E0)
1736
+              SET_STEPPING_MODE(E0);
1737
+            #endif
1738
+            #if AXIS_HAS_STEALTHCHOP(E1)
1739
+              SET_STEPPING_MODE(E1);
1740
+            #endif
1741
+            #if AXIS_HAS_STEALTHCHOP(E2)
1742
+              SET_STEPPING_MODE(E2);
1743
+            #endif
1744
+            #if AXIS_HAS_STEALTHCHOP(E3)
1745
+              SET_STEPPING_MODE(E3);
1746
+            #endif
1747
+            #if AXIS_HAS_STEALTHCHOP(E4)
1748
+              SET_STEPPING_MODE(E4);
1749
+            #endif
1750
+            #if AXIS_HAS_STEALTHCHOP(E5)
1751
+              SET_STEPPING_MODE(E5);
1752
+            #endif
1753
+          }
1754
+        #endif
1755
+      }
1756
+
1633
       //
1757
       //
1634
       // Linear Advance
1758
       // Linear Advance
1635
       //
1759
       //
2200
 
2324
 
2201
   #if HAS_TRINAMIC
2325
   #if HAS_TRINAMIC
2202
     void say_M906(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, "  M906"); }
2326
     void say_M906(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, "  M906"); }
2327
+    #if HAS_STEALTHCHOP
2328
+      void say_M569(PORTARG_BEFORE const char * const etc=NULL) {
2329
+        SERIAL_ECHOPGM_P(port, "  M569 S1");
2330
+        if (etc) {
2331
+          SERIAL_CHAR_P(port, ' ');
2332
+          serialprintPGM_P(port, etc);
2333
+          SERIAL_EOL_P(port);
2334
+        }
2335
+      }
2336
+    #endif
2203
     #if ENABLED(HYBRID_THRESHOLD)
2337
     #if ENABLED(HYBRID_THRESHOLD)
2204
       void say_M913(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, "  M913"); }
2338
       void say_M913(PORTARG_SOLO) { SERIAL_ECHOPGM_P(port, "  M913"); }
2205
     #endif
2339
     #endif
2895
 
3029
 
2896
       #endif // USE_SENSORLESS
3030
       #endif // USE_SENSORLESS
2897
 
3031
 
3032
+      /**
3033
+       * TMC stepping mode
3034
+       */
3035
+      #if HAS_STEALTHCHOP
3036
+        CONFIG_ECHO_HEADING("Driver stepping mode:");
3037
+        CONFIG_ECHO_START();
3038
+        #if AXIS_HAS_STEALTHCHOP(X)
3039
+          const bool chop_x = stepperX.get_stealthChop_status();
3040
+        #else
3041
+          constexpr bool chop_x = false;
3042
+        #endif
3043
+        #if AXIS_HAS_STEALTHCHOP(Y)
3044
+          const bool chop_y = stepperY.get_stealthChop_status();
3045
+        #else
3046
+          constexpr bool chop_y = false;
3047
+        #endif
3048
+        #if AXIS_HAS_STEALTHCHOP(Z)
3049
+          const bool chop_z = stepperZ.get_stealthChop_status();
3050
+        #else
3051
+          constexpr bool chop_z = false;
3052
+        #endif
3053
+
3054
+        if (chop_x || chop_y || chop_z) say_M569(PORTVAR_SOLO);
3055
+        if (chop_x) SERIAL_ECHOPGM_P(port, " X");
3056
+        if (chop_y) SERIAL_ECHOPGM_P(port, " Y");
3057
+        if (chop_z) SERIAL_ECHOPGM_P(port, " Z");
3058
+        if (chop_x || chop_y || chop_z) SERIAL_EOL_P(port);
3059
+
3060
+        #if AXIS_HAS_STEALTHCHOP(X2)
3061
+          const bool chop_x2 = stepperX2.get_stealthChop_status();
3062
+        #else
3063
+          constexpr bool chop_x2 = false;
3064
+        #endif
3065
+        #if AXIS_HAS_STEALTHCHOP(Y2)
3066
+          const bool chop_y2 = stepperY2.get_stealthChop_status();
3067
+        #else
3068
+          constexpr bool chop_y2 = false;
3069
+        #endif
3070
+        #if AXIS_HAS_STEALTHCHOP(Z2)
3071
+          const bool chop_z2 = stepperZ2.get_stealthChop_status();
3072
+        #else
3073
+          constexpr bool chop_z2 = false;
3074
+        #endif
3075
+
3076
+        if (chop_x2 || chop_y2 || chop_z2) say_M569(PORTVAR_BEFORE PSTR("I1"));
3077
+        if (chop_x2) SERIAL_ECHOPGM_P(port, " X");
3078
+        if (chop_y2) SERIAL_ECHOPGM_P(port, " Y");
3079
+        if (chop_z2) SERIAL_ECHOPGM_P(port, " Z");
3080
+        if (chop_x2 || chop_y2 || chop_z2) SERIAL_EOL_P(port);
3081
+
3082
+        #if AXIS_HAS_STEALTHCHOP(Z3)
3083
+          if (stepperZ3.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("I2 Z")); }
3084
+        #endif
3085
+
3086
+        #if AXIS_HAS_STEALTHCHOP(E0)
3087
+          if (stepperE0.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("T0 E")); }
3088
+        #endif
3089
+        #if AXIS_HAS_STEALTHCHOP(E1)
3090
+          if (stepperE1.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("T1 E")); }
3091
+        #endif
3092
+        #if AXIS_HAS_STEALTHCHOP(E2)
3093
+          if (stepperE2.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("T2 E")); }
3094
+        #endif
3095
+        #if AXIS_HAS_STEALTHCHOP(E3)
3096
+          if (stepperE3.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("T3 E")); }
3097
+        #endif
3098
+        #if AXIS_HAS_STEALTHCHOP(E4)
3099
+          if (stepperE4.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("T4 E")); }
3100
+        #endif
3101
+        #if AXIS_HAS_STEALTHCHOP(E5)
3102
+          if (stepperE5.get_stealthChop_status()) { say_M569(PORTVAR_BEFORE PSTR("T5 E")); }
3103
+        #endif
3104
+
3105
+      #endif // HAS_STEALTHCHOP
3106
+
2898
     #endif // HAS_TRINAMIC
3107
     #endif // HAS_TRINAMIC
2899
 
3108
 
2900
     /**
3109
     /**

+ 11
- 15
Marlin/src/module/stepper_indirection.cpp View File

205
   void tmc_init(TMCMarlin<TMC2130Stepper, AXIS_LETTER, DRIVER_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm, const bool stealth) {
205
   void tmc_init(TMCMarlin<TMC2130Stepper, AXIS_LETTER, DRIVER_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm, const bool stealth) {
206
     st.begin();
206
     st.begin();
207
 
207
 
208
-    static constexpr int8_t timings[] = CHOPPER_TIMING; // Default 4, -2, 1
209
-
210
     CHOPCONF_t chopconf{0};
208
     CHOPCONF_t chopconf{0};
211
     chopconf.tbl = 1;
209
     chopconf.tbl = 1;
212
-    chopconf.toff = timings[0];
210
+    chopconf.toff = chopper_timing.toff;
213
     chopconf.intpol = INTERPOLATE;
211
     chopconf.intpol = INTERPOLATE;
214
-    chopconf.hend = timings[1] + 3;
215
-    chopconf.hstrt = timings[2] - 1;
212
+    chopconf.hend = chopper_timing.hstrt + 3;
213
+    chopconf.hstrt = chopper_timing.hend - 1;
216
     st.CHOPCONF(chopconf.sr);
214
     st.CHOPCONF(chopconf.sr);
217
 
215
 
218
     st.rms_current(mA, HOLD_MULTIPLIER);
216
     st.rms_current(mA, HOLD_MULTIPLIER);
221
     st.TPOWERDOWN(128); // ~2s until driver lowers to hold current
219
     st.TPOWERDOWN(128); // ~2s until driver lowers to hold current
222
 
220
 
223
     st.en_pwm_mode(stealth);
221
     st.en_pwm_mode(stealth);
222
+    st.stored.stealthChop_enabled = stealth;
224
 
223
 
225
     PWMCONF_t pwmconf{0};
224
     PWMCONF_t pwmconf{0};
226
     pwmconf.pwm_freq = 0b01; // f_pwm = 2/683 f_clk
225
     pwmconf.pwm_freq = 0b01; // f_pwm = 2/683 f_clk
442
 
441
 
443
   template<char AXIS_LETTER, char DRIVER_ID>
442
   template<char AXIS_LETTER, char DRIVER_ID>
444
   void tmc_init(TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm, const bool stealth) {
443
   void tmc_init(TMCMarlin<TMC2208Stepper, AXIS_LETTER, DRIVER_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t thrs, const float spmm, const bool stealth) {
445
-    static constexpr int8_t timings[] = CHOPPER_TIMING; // Default 4, -2, 1
446
-
447
     TMC2208_n::GCONF_t gconf{0};
444
     TMC2208_n::GCONF_t gconf{0};
448
     gconf.pdn_disable = true; // Use UART
445
     gconf.pdn_disable = true; // Use UART
449
     gconf.mstep_reg_select = true; // Select microsteps with UART
446
     gconf.mstep_reg_select = true; // Select microsteps with UART
450
     gconf.i_scale_analog = false;
447
     gconf.i_scale_analog = false;
451
     gconf.en_spreadcycle = !stealth;
448
     gconf.en_spreadcycle = !stealth;
452
     st.GCONF(gconf.sr);
449
     st.GCONF(gconf.sr);
450
+    st.stored.stealthChop_enabled = stealth;
453
 
451
 
454
     TMC2208_n::CHOPCONF_t chopconf{0};
452
     TMC2208_n::CHOPCONF_t chopconf{0};
455
     chopconf.tbl = 0b01; // blank_time = 24
453
     chopconf.tbl = 0b01; // blank_time = 24
456
-    chopconf.toff = timings[0];
454
+    chopconf.toff = chopper_timing.toff;
457
     chopconf.intpol = INTERPOLATE;
455
     chopconf.intpol = INTERPOLATE;
458
-    chopconf.hend = timings[1] + 3;
459
-    chopconf.hstrt = timings[2] - 1;
456
+    chopconf.hend = chopper_timing.hstrt + 3;
457
+    chopconf.hstrt = chopper_timing.hend - 1;
460
     st.CHOPCONF(chopconf.sr);
458
     st.CHOPCONF(chopconf.sr);
461
 
459
 
462
     st.rms_current(mA, HOLD_MULTIPLIER);
460
     st.rms_current(mA, HOLD_MULTIPLIER);
545
   void tmc_init(TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const float, const bool) {
543
   void tmc_init(TMCMarlin<TMC2660Stepper, AXIS_LETTER, DRIVER_ID> &st, const uint16_t mA, const uint16_t microsteps, const uint32_t, const float, const bool) {
546
     st.begin();
544
     st.begin();
547
 
545
 
548
-    static constexpr int8_t timings[] = CHOPPER_TIMING; // Default 4, -2, 1
549
-
550
     TMC2660_n::CHOPCONF_t chopconf{0};
546
     TMC2660_n::CHOPCONF_t chopconf{0};
551
     chopconf.tbl = 1;
547
     chopconf.tbl = 1;
552
-    chopconf.toff = timings[0];
553
-    chopconf.hend = timings[1] + 3;
554
-    chopconf.hstrt = timings[2] - 1;
548
+    chopconf.toff = chopper_timing.toff;
549
+    chopconf.hend = chopper_timing.hstrt + 3;
550
+    chopconf.hstrt = chopper_timing.hend - 1;
555
     st.CHOPCONF(chopconf.sr);
551
     st.CHOPCONF(chopconf.sr);
556
 
552
 
557
     st.rms_current(mA);
553
     st.rms_current(mA);

+ 34
- 26
Marlin/src/module/stepper_indirection.h View File

66
   #define _TMC_CLASS(MODEL, L) __TMC_CLASS(MODEL, L)
66
   #define _TMC_CLASS(MODEL, L) __TMC_CLASS(MODEL, L)
67
   #define TMC_CLASS(ST) _TMC_CLASS(ST##_DRIVER_TYPE, TMC_##ST##_LABEL)
67
   #define TMC_CLASS(ST) _TMC_CLASS(ST##_DRIVER_TYPE, TMC_##ST##_LABEL)
68
 
68
 
69
+  typedef struct {
70
+    uint8_t toff;
71
+    int8_t hstrt;
72
+    uint8_t hend;
73
+  } chopper_timing_t;
74
+
75
+  static constexpr chopper_timing_t chopper_timing = CHOPPER_TIMING;
76
+
69
   #if HAS_DRIVER(TMC2208)
77
   #if HAS_DRIVER(TMC2208)
70
     void tmc2208_serial_begin();
78
     void tmc2208_serial_begin();
71
   #endif
79
   #endif
99
     #define X_ENABLE_INIT NOOP
107
     #define X_ENABLE_INIT NOOP
100
     #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
108
     #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
101
     #define X_ENABLE_READ stepperX.isEnabled()
109
     #define X_ENABLE_READ stepperX.isEnabled()
102
-  #elif AXIS_DRIVER_TYPE(X, TMC2660)
110
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X)
103
     #define X_ENABLE_INIT NOOP
111
     #define X_ENABLE_INIT NOOP
104
-    #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? stepperX.savedToff() : 0)
112
+    #define X_ENABLE_WRITE(STATE) stepperX.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0)
105
     #define X_ENABLE_READ stepperX.isEnabled()
113
     #define X_ENABLE_READ stepperX.isEnabled()
106
   #else
114
   #else
107
     #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
115
     #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
134
     #define Y_ENABLE_INIT NOOP
142
     #define Y_ENABLE_INIT NOOP
135
     #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
143
     #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
136
     #define Y_ENABLE_READ stepperY.isEnabled()
144
     #define Y_ENABLE_READ stepperY.isEnabled()
137
-  #elif AXIS_DRIVER_TYPE(Y, TMC2660)
145
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y)
138
     #define Y_ENABLE_INIT NOOP
146
     #define Y_ENABLE_INIT NOOP
139
-    #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? stepperY.savedToff() : 0)
147
+    #define Y_ENABLE_WRITE(STATE) stepperY.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0)
140
     #define Y_ENABLE_READ stepperY.isEnabled()
148
     #define Y_ENABLE_READ stepperY.isEnabled()
141
   #else
149
   #else
142
     #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
150
     #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
169
     #define Z_ENABLE_INIT NOOP
177
     #define Z_ENABLE_INIT NOOP
170
     #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
178
     #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
171
     #define Z_ENABLE_READ stepperZ.isEnabled()
179
     #define Z_ENABLE_READ stepperZ.isEnabled()
172
-  #elif AXIS_DRIVER_TYPE(Z, TMC2660)
180
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z)
173
     #define Z_ENABLE_INIT NOOP
181
     #define Z_ENABLE_INIT NOOP
174
-    #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? stepperZ.savedToff() : 0)
182
+    #define Z_ENABLE_WRITE(STATE) stepperZ.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0)
175
     #define Z_ENABLE_READ stepperZ.isEnabled()
183
     #define Z_ENABLE_READ stepperZ.isEnabled()
176
   #else
184
   #else
177
     #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
185
     #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
205
       #define X2_ENABLE_INIT NOOP
213
       #define X2_ENABLE_INIT NOOP
206
       #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
214
       #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
207
       #define X2_ENABLE_READ stepperX2.isEnabled()
215
       #define X2_ENABLE_READ stepperX2.isEnabled()
208
-    #elif AXIS_DRIVER_TYPE(X2, TMC2660)
216
+    #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(X2)
209
       #define X2_ENABLE_INIT NOOP
217
       #define X2_ENABLE_INIT NOOP
210
-      #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? stepperX2.savedToff() : 0)
218
+      #define X2_ENABLE_WRITE(STATE) stepperX2.toff((STATE)==X_ENABLE_ON ? chopper_timing.toff : 0)
211
       #define X2_ENABLE_READ stepperX2.isEnabled()
219
       #define X2_ENABLE_READ stepperX2.isEnabled()
212
     #else
220
     #else
213
       #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
221
       #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
242
       #define Y2_ENABLE_INIT NOOP
250
       #define Y2_ENABLE_INIT NOOP
243
       #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
251
       #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
244
       #define Y2_ENABLE_READ stepperY2.isEnabled()
252
       #define Y2_ENABLE_READ stepperY2.isEnabled()
245
-    #elif AXIS_DRIVER_TYPE(Y2, TMC2660)
253
+    #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Y2)
246
       #define Y2_ENABLE_INIT NOOP
254
       #define Y2_ENABLE_INIT NOOP
247
-      #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? stepperY2.savedToff() : 0)
255
+      #define Y2_ENABLE_WRITE(STATE) stepperY2.toff((STATE)==Y_ENABLE_ON ? chopper_timing.toff : 0)
248
       #define Y2_ENABLE_READ stepperY2.isEnabled()
256
       #define Y2_ENABLE_READ stepperY2.isEnabled()
249
     #else
257
     #else
250
       #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
258
       #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
279
       #define Z2_ENABLE_INIT NOOP
287
       #define Z2_ENABLE_INIT NOOP
280
       #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
288
       #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
281
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
289
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
282
-    #elif AXIS_DRIVER_TYPE(Z2, TMC2660)
290
+    #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z2)
283
       #define Z2_ENABLE_INIT NOOP
291
       #define Z2_ENABLE_INIT NOOP
284
-      #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? stepperZ2.savedToff() : 0)
292
+      #define Z2_ENABLE_WRITE(STATE) stepperZ2.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0)
285
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
293
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
286
     #else
294
     #else
287
       #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
295
       #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
316
       #define Z3_ENABLE_INIT NOOP
324
       #define Z3_ENABLE_INIT NOOP
317
       #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE)
325
       #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE)
318
       #define Z3_ENABLE_READ stepperZ3.isEnabled()
326
       #define Z3_ENABLE_READ stepperZ3.isEnabled()
319
-    #elif AXIS_DRIVER_TYPE(Z3, TMC2660)
327
+    #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(Z3)
320
       #define Z3_ENABLE_INIT NOOP
328
       #define Z3_ENABLE_INIT NOOP
321
-      #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? stepperZ3.savedToff() : 0)
329
+      #define Z3_ENABLE_WRITE(STATE) stepperZ3.toff((STATE)==Z_ENABLE_ON ? chopper_timing.toff : 0)
322
       #define Z3_ENABLE_READ stepperZ3.isEnabled()
330
       #define Z3_ENABLE_READ stepperZ3.isEnabled()
323
     #else
331
     #else
324
       #define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN)
332
       #define Z3_ENABLE_INIT SET_OUTPUT(Z3_ENABLE_PIN)
352
     #define E0_ENABLE_INIT NOOP
360
     #define E0_ENABLE_INIT NOOP
353
     #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
361
     #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
354
     #define E0_ENABLE_READ stepperE0.isEnabled()
362
     #define E0_ENABLE_READ stepperE0.isEnabled()
355
-  #elif AXIS_DRIVER_TYPE(E0, TMC2660)
363
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E0)
356
     #define E0_ENABLE_INIT NOOP
364
     #define E0_ENABLE_INIT NOOP
357
-    #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? stepperE0.savedToff() : 0)
365
+    #define E0_ENABLE_WRITE(STATE) stepperE0.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0)
358
     #define E0_ENABLE_READ stepperE0.isEnabled()
366
     #define E0_ENABLE_READ stepperE0.isEnabled()
359
   #else
367
   #else
360
     #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
368
     #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
387
     #define E1_ENABLE_INIT NOOP
395
     #define E1_ENABLE_INIT NOOP
388
     #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
396
     #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
389
     #define E1_ENABLE_READ stepperE1.isEnabled()
397
     #define E1_ENABLE_READ stepperE1.isEnabled()
390
-  #elif AXIS_DRIVER_TYPE(E1, TMC2660)
398
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E1)
391
     #define E1_ENABLE_INIT NOOP
399
     #define E1_ENABLE_INIT NOOP
392
-    #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? stepperE1.savedToff() : 0)
400
+    #define E1_ENABLE_WRITE(STATE) stepperE1.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0)
393
     #define E1_ENABLE_READ stepperE1.isEnabled()
401
     #define E1_ENABLE_READ stepperE1.isEnabled()
394
   #else
402
   #else
395
     #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
403
     #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
422
     #define E2_ENABLE_INIT NOOP
430
     #define E2_ENABLE_INIT NOOP
423
     #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
431
     #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
424
     #define E2_ENABLE_READ stepperE2.isEnabled()
432
     #define E2_ENABLE_READ stepperE2.isEnabled()
425
-  #elif AXIS_DRIVER_TYPE(E2, TMC2660)
433
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E2)
426
     #define E2_ENABLE_INIT NOOP
434
     #define E2_ENABLE_INIT NOOP
427
-    #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? stepperE2.savedToff() : 0)
435
+    #define E2_ENABLE_WRITE(STATE) stepperE2.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0)
428
     #define E2_ENABLE_READ stepperE2.isEnabled()
436
     #define E2_ENABLE_READ stepperE2.isEnabled()
429
   #else
437
   #else
430
     #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
438
     #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
457
     #define E3_ENABLE_INIT NOOP
465
     #define E3_ENABLE_INIT NOOP
458
     #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
466
     #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
459
     #define E3_ENABLE_READ stepperE3.isEnabled()
467
     #define E3_ENABLE_READ stepperE3.isEnabled()
460
-  #elif AXIS_DRIVER_TYPE(E3, TMC2660)
468
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E3)
461
     #define E3_ENABLE_INIT NOOP
469
     #define E3_ENABLE_INIT NOOP
462
-    #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? stepperE3.savedToff() : 0)
470
+    #define E3_ENABLE_WRITE(STATE) stepperE3.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0)
463
     #define E3_ENABLE_READ stepperE3.isEnabled()
471
     #define E3_ENABLE_READ stepperE3.isEnabled()
464
   #else
472
   #else
465
     #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
473
     #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
492
     #define E4_ENABLE_INIT NOOP
500
     #define E4_ENABLE_INIT NOOP
493
     #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE)
501
     #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE)
494
     #define E4_ENABLE_READ stepperE4.isEnabled()
502
     #define E4_ENABLE_READ stepperE4.isEnabled()
495
-  #elif AXIS_DRIVER_TYPE(E4, TMC2660)
503
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E4)
496
     #define E4_ENABLE_INIT NOOP
504
     #define E4_ENABLE_INIT NOOP
497
-    #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? stepperE4.savedToff() : 0)
505
+    #define E4_ENABLE_WRITE(STATE) stepperE4.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0)
498
     #define E4_ENABLE_READ stepperE4.isEnabled()
506
     #define E4_ENABLE_READ stepperE4.isEnabled()
499
   #else
507
   #else
500
     #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN)
508
     #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN)
527
     #define E5_ENABLE_INIT NOOP
535
     #define E5_ENABLE_INIT NOOP
528
     #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE)
536
     #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE)
529
     #define E5_ENABLE_READ stepperE5.isEnabled()
537
     #define E5_ENABLE_READ stepperE5.isEnabled()
530
-  #elif AXIS_DRIVER_TYPE(E5, TMC2660)
538
+  #elif ENABLED(SOFTWARE_DRIVER_ENABLE) && AXIS_IS_TMC(E5)
531
     #define E5_ENABLE_INIT NOOP
539
     #define E5_ENABLE_INIT NOOP
532
-    #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? stepperE5.savedToff() : 0)
540
+    #define E5_ENABLE_WRITE(STATE) stepperE5.toff((STATE)==E_ENABLE_ON ? chopper_timing.toff : 0)
533
     #define E5_ENABLE_READ stepperE5.isEnabled()
541
     #define E5_ENABLE_READ stepperE5.isEnabled()
534
   #else
542
   #else
535
     #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN)
543
     #define E5_ENABLE_INIT SET_OUTPUT(E5_ENABLE_PIN)

Loading…
Cancel
Save