Browse Source

Simplify stepper driver per-axis selection

teemuatlut 6 years ago
parent
commit
fbcdf5eaeb

+ 23
- 0
Marlin/Configuration.h View File

551
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
551
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
552
 #define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.
552
 #define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.
553
 
553
 
554
+/**
555
+ * Specify Stepper Driver types
556
+ * The options are used to determine driver pulse timings as well as more advanced functionality.
557
+ * Stepper timing options can be overridden in Configuration_adv.h
558
+ *
559
+ * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
560
+ *          TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE,
561
+ *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
562
+ *          TMC5130, TMC5130_STANDALONE
563
+ * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE']
564
+ */
565
+#define X_DRIVER_TYPE  A4988
566
+#define Y_DRIVER_TYPE  A4988
567
+#define Z_DRIVER_TYPE  A4988
568
+#define X2_DRIVER_TYPE A4988
569
+#define Y2_DRIVER_TYPE A4988
570
+#define Z2_DRIVER_TYPE A4988
571
+#define E0_DRIVER_TYPE A4988
572
+#define E1_DRIVER_TYPE A4988
573
+#define E2_DRIVER_TYPE A4988
574
+#define E3_DRIVER_TYPE A4988
575
+#define E4_DRIVER_TYPE A4988
576
+
554
 // Enable this feature if all enabled endstop pins are interrupt-capable.
577
 // Enable this feature if all enabled endstop pins are interrupt-capable.
555
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
578
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
556
 //#define ENDSTOP_INTERRUPTS_FEATURE
579
 //#define ENDSTOP_INTERRUPTS_FEATURE

+ 37
- 88
Marlin/Configuration_adv.h View File

837
 
837
 
838
 /**
838
 /**
839
  * Minimum delay after setting the stepper DIR (in ns)
839
  * Minimum delay after setting the stepper DIR (in ns)
840
- *    0 : No delay (Expect at least 10µS since one Stepper ISR must transpire)
841
- *   20 : Minimum for TMC2xxx drivers
842
- *  200 : Minimum for A4988 drivers
843
- *  500 : Minimum for LV8729 drivers (guess, no info in datasheet)
844
- *  650 : Minimum for DRV8825 drivers
845
- * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet)
846
- *15000 : Minimum for TB6560 drivers (guess, no info in datasheet)
840
+ *     0 : No delay (Expect at least 10µS since one Stepper ISR must transpire)
841
+ *    20 : Minimum for TMC2xxx drivers
842
+ *   200 : Minimum for A4988 drivers
843
+ *   500 : Minimum for LV8729 drivers (guess, no info in datasheet)
844
+ *   650 : Minimum for DRV8825 drivers
845
+ *  1500 : Minimum for TB6600 drivers (guess, no info in datasheet)
846
+ * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet)
847
+ *
848
+ * Override the default value based on the driver type set in Configuration.h.
847
  */
849
  */
848
-#define MINIMUM_STEPPER_DIR_DELAY 0
850
+//#define MINIMUM_STEPPER_DIR_DELAY 650
849
 
851
 
850
 /**
852
 /**
851
  * Minimum stepper driver pulse width (in µs)
853
  * Minimum stepper driver pulse width (in µs)
855
  *   2 : Minimum for DRV8825 stepper drivers
857
  *   2 : Minimum for DRV8825 stepper drivers
856
  *   3 : Minimum for TB6600 stepper drivers
858
  *   3 : Minimum for TB6600 stepper drivers
857
  *  30 : Minimum for TB6560 stepper drivers
859
  *  30 : Minimum for TB6560 stepper drivers
860
+ *
861
+ * Override the default value based on the driver type set in Configuration.h.
858
  */
862
  */
859
-#define MINIMUM_STEPPER_PULSE 2
863
+//#define MINIMUM_STEPPER_PULSE 2
860
 
864
 
861
 /**
865
 /**
862
  * Maximum stepping rate (in Hz) the stepper driver allows
866
  * Maximum stepping rate (in Hz) the stepper driver allows
867
  *  150000 : Maximum for TB6600 stepper driver
871
  *  150000 : Maximum for TB6600 stepper driver
868
  *  130000 : Maximum for LV8729 stepper driver
872
  *  130000 : Maximum for LV8729 stepper driver
869
  *   15000 : Maximum for TB6560 stepper driver
873
  *   15000 : Maximum for TB6560 stepper driver
874
+ *
875
+ * Override the default value based on the driver type set in Configuration.h.
870
  */
876
  */
871
-#define MAXIMUM_STEPPER_RATE 250000
877
+//#define MAXIMUM_STEPPER_RATE 250000
872
 
878
 
873
 // @section temperature
879
 // @section temperature
874
 
880
 
1036
 // @section tmc
1042
 // @section tmc
1037
 
1043
 
1038
 /**
1044
 /**
1039
- * Enable this section if you have TMC26X motor drivers.
1040
- * You will need to import the TMC26XStepper library into the Arduino IDE for this
1041
- * (https://github.com/trinamic/TMC26XStepper.git)
1045
+ * TMC26X Stepper Driver options
1046
+ *
1047
+ * The TMC26XStepper library is required for this stepper driver.
1048
+ * https://github.com/trinamic/TMC26XStepper
1042
  */
1049
  */
1043
-//#define HAVE_TMC26X
1044
-#if ENABLED(HAVE_TMC26X)  // Choose your axes here. This is mandatory!
1045
-  //#define X_IS_TMC26X
1046
-  //#define X2_IS_TMC26X
1047
-  //#define Y_IS_TMC26X
1048
-  //#define Y2_IS_TMC26X
1049
-  //#define Z_IS_TMC26X
1050
-  //#define Z2_IS_TMC26X
1051
-  //#define E0_IS_TMC26X
1052
-  //#define E1_IS_TMC26X
1053
-  //#define E2_IS_TMC26X
1054
-  //#define E3_IS_TMC26X
1055
-  //#define E4_IS_TMC26X
1050
+#if HAS_DRIVER(TMC26X)
1056
 
1051
 
1057
   #define X_MAX_CURRENT     1000 // in mA
1052
   #define X_MAX_CURRENT     1000 // in mA
1058
   #define X_SENSE_RESISTOR    91 // in mOhms
1053
   #define X_SENSE_RESISTOR    91 // in mOhms
1098
   #define E4_SENSE_RESISTOR   91
1093
   #define E4_SENSE_RESISTOR   91
1099
   #define E4_MICROSTEPS       16
1094
   #define E4_MICROSTEPS       16
1100
 
1095
 
1101
-#endif
1096
+#endif // TMC26X
1102
 
1097
 
1103
 // @section tmc_smart
1098
 // @section tmc_smart
1104
 
1099
 
1105
 /**
1100
 /**
1106
- * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
1107
- *
1108
- * You'll also need the TMC2130Stepper Arduino library
1109
- * (https://github.com/teemuatlut/TMC2130Stepper).
1110
- *
1111
  * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to
1101
  * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to
1112
  * the hardware SPI interface on your board and define the required CS pins
1102
  * the hardware SPI interface on your board and define the required CS pins
1113
  * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
1103
  * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
1114
  * You may also use software SPI if you wish to use general purpose IO pins.
1104
  * You may also use software SPI if you wish to use general purpose IO pins.
1115
- */
1116
-//#define HAVE_TMC2130
1117
-#if ENABLED(HAVE_TMC2130)  // Choose your axes here. This is mandatory!
1118
-  //#define X_IS_TMC2130
1119
-  //#define X2_IS_TMC2130
1120
-  //#define Y_IS_TMC2130
1121
-  //#define Y2_IS_TMC2130
1122
-  //#define Z_IS_TMC2130
1123
-  //#define Z2_IS_TMC2130
1124
-  //#define E0_IS_TMC2130
1125
-  //#define E1_IS_TMC2130
1126
-  //#define E2_IS_TMC2130
1127
-  //#define E3_IS_TMC2130
1128
-  //#define E4_IS_TMC2130
1129
-#endif
1130
-
1131
-/**
1132
- * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
1133
- * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor.
1105
+ *
1106
+ * The TMC2130Stepper library is required for this stepper driver.
1107
+ * https://github.com/teemuatlut/TMC2130Stepper
1108
+ *
1109
+ * To use TMC2208 stepper UART-configurable stepper drivers
1110
+ * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor.
1134
  * To use the reading capabilities, also connect #_SERIAL_RX_PIN
1111
  * To use the reading capabilities, also connect #_SERIAL_RX_PIN
1135
  * to PDN_UART without a resistor.
1112
  * to PDN_UART without a resistor.
1136
  * The drivers can also be used with hardware serial.
1113
  * The drivers can also be used with hardware serial.
1137
  *
1114
  *
1138
- * You'll also need the TMC2208Stepper Arduino library
1139
- * (https://github.com/teemuatlut/TMC2208Stepper).
1115
+ * The TMC2208Stepper library is required for this stepper driver.
1116
+ * https://github.com/teemuatlut/TMC2208Stepper
1140
  */
1117
  */
1141
-//#define HAVE_TMC2208
1142
-#if ENABLED(HAVE_TMC2208)  // Choose your axes here. This is mandatory!
1143
-  //#define X_IS_TMC2208
1144
-  //#define X2_IS_TMC2208
1145
-  //#define Y_IS_TMC2208
1146
-  //#define Y2_IS_TMC2208
1147
-  //#define Z_IS_TMC2208
1148
-  //#define Z2_IS_TMC2208
1149
-  //#define E0_IS_TMC2208
1150
-  //#define E1_IS_TMC2208
1151
-  //#define E2_IS_TMC2208
1152
-  //#define E3_IS_TMC2208
1153
-  //#define E4_IS_TMC2208
1154
-#endif
1155
-
1156
-#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
1118
+#if HAS_TRINAMIC
1157
 
1119
 
1158
   #define R_SENSE           0.11  // R_sense resistor for SilentStepStick2130
1120
   #define R_SENSE           0.11  // R_sense resistor for SilentStepStick2130
1159
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
1121
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
1308
 // @section L6470
1270
 // @section L6470
1309
 
1271
 
1310
 /**
1272
 /**
1311
- * Enable this section if you have L6470 motor drivers.
1312
- * You need to import the L6470 library into the Arduino IDE for this.
1313
- * (https://github.com/ameyer/Arduino-L6470)
1273
+ * L6470 Stepper Driver options
1274
+ *
1275
+ * The Arduino-L6470 library is required for this stepper driver.
1276
+ * https://github.com/ameyer/Arduino-L6470
1314
  */
1277
  */
1315
-
1316
-//#define HAVE_L6470DRIVER
1317
-#if ENABLED(HAVE_L6470DRIVER)
1318
-
1319
-  //#define X_IS_L6470
1320
-  //#define X2_IS_L6470
1321
-  //#define Y_IS_L6470
1322
-  //#define Y2_IS_L6470
1323
-  //#define Z_IS_L6470
1324
-  //#define Z2_IS_L6470
1325
-  //#define E0_IS_L6470
1326
-  //#define E1_IS_L6470
1327
-  //#define E2_IS_L6470
1328
-  //#define E3_IS_L6470
1329
-  //#define E4_IS_L6470
1278
+#if HAS_DRIVER(L6470)
1330
 
1279
 
1331
   #define X_MICROSTEPS      16 // number of microsteps
1280
   #define X_MICROSTEPS      16 // number of microsteps
1332
   #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1281
   #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1372
   #define E4_OVERCURRENT  2000
1321
   #define E4_OVERCURRENT  2000
1373
   #define E4_STALLCURRENT 1500
1322
   #define E4_STALLCURRENT 1500
1374
 
1323
 
1375
-#endif
1324
+#endif // L6470
1376
 
1325
 
1377
 /**
1326
 /**
1378
  * TWI/I2C BUS
1327
  * TWI/I2C BUS

+ 1
- 1
Marlin/src/HAL/HAL_AVR/SanityCheck.h View File

99
 /**
99
 /**
100
  * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
100
  * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
101
  */
101
  */
102
-#if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
102
+#if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
103
        defined(X_HARDWARE_SERIAL ) \
103
        defined(X_HARDWARE_SERIAL ) \
104
     || defined(X2_HARDWARE_SERIAL) \
104
     || defined(X2_HARDWARE_SERIAL) \
105
     || defined(Y_HARDWARE_SERIAL ) \
105
     || defined(Y_HARDWARE_SERIAL ) \

+ 1
- 1
Marlin/src/HAL/HAL_DUE/SanityCheck.h View File

41
  */
41
  */
42
 #define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN))
42
 #define _IS_HW_SPI(P) (defined(TMC_SW_##P) && (TMC_SW_##P == MOSI_PIN || TMC_SW_##P == MISO_PIN || TMC_SW_##P == SCK_PIN))
43
 
43
 
44
-#if ENABLED(SDSUPPORT) && ENABLED(HAVE_TMC2130)
44
+#if ENABLED(SDSUPPORT) && HAS_DRIVER(TMC2130)
45
   #if ENABLED(TMC_USE_SW_SPI)
45
   #if ENABLED(TMC_USE_SW_SPI)
46
     #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
46
     #if DISABLED(DUE_SOFTWARE_SPI) && (_IS_HW_SPI(MOSI) || _IS_HW_SPI(MISO) || _IS_HW_SPI(SCK))
47
       #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."
47
       #error "DUE hardware SPI is required but is incompatible with TMC2130 software SPI. Either disable TMC_USE_SW_SPI or use separate pins for the two SPIs."

+ 1
- 1
Marlin/src/HAL/HAL_LPC1768/SanityCheck.h View File

66
   #endif
66
   #endif
67
 #endif // SPINDLE_LASER_ENABLE
67
 #endif // SPINDLE_LASER_ENABLE
68
 
68
 
69
-#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && ENABLED(HAVE_TMC2130) && DISABLED(TMC_USE_SW_SPI) \
69
+#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER) && HAS_DRIVER(TMC2130) && DISABLED(TMC_USE_SW_SPI) \
70
     && (MB(RAMPS_14_RE_ARM_EFB) \
70
     && (MB(RAMPS_14_RE_ARM_EFB) \
71
     ||  MB(RAMPS_14_RE_ARM_EEB) \
71
     ||  MB(RAMPS_14_RE_ARM_EEB) \
72
     ||  MB(RAMPS_14_RE_ARM_EFF) \
72
     ||  MB(RAMPS_14_RE_ARM_EFF) \

+ 2
- 2
Marlin/src/Marlin.cpp View File

712
   SERIAL_PROTOCOLLNPGM("start");
712
   SERIAL_PROTOCOLLNPGM("start");
713
   SERIAL_ECHO_START();
713
   SERIAL_ECHO_START();
714
 
714
 
715
-  #if ENABLED(HAVE_TMC2130)
715
+  #if HAS_DRIVER(TMC2130)
716
     tmc_init_cs_pins();
716
     tmc_init_cs_pins();
717
   #endif
717
   #endif
718
-  #if ENABLED(HAVE_TMC2208)
718
+  #if HAS_DRIVER(TMC2208)
719
     tmc2208_serial_begin();
719
     tmc2208_serial_begin();
720
   #endif
720
   #endif
721
 
721
 

+ 23
- 0
Marlin/src/config/default/Configuration.h View File

551
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
551
 #define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
552
 #define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.
552
 #define Z_MIN_PROBE_ENDSTOP_INVERTING false // set to true to invert the logic of the probe.
553
 
553
 
554
+/**
555
+ * Specify Stepper Driver types
556
+ * The options are used to determine driver pulse timings as well as more advanced functionality.
557
+ * Stepper timing options can be overridden in Configuration_adv.h
558
+ *
559
+ * Options: A4988, DRV8825, LV8729, L6470, TB6560, TB6600, TMC2100,
560
+ *          TMC2130, TMC2130_STANDALONE, TMC2208, TMC2208_STANDALONE,
561
+ *          TMC26X,  TMC26X_STANDALONE,  TMC2660, TMC2660_STANDALONE,
562
+ *          TMC5130, TMC5130_STANDALONE
563
+ * :['A4988', 'DRV8825', 'LV8729', 'L6470', 'TB6560', 'TB6600', 'TMC2100', 'TMC2130', 'TMC2130_STANDALONE', 'TMC2208', 'TMC2208_STANDALONE', 'TMC26X', 'TMC26X_STANDALONE', 'TMC2660', 'TMC2660_STANDALONE', 'TMC5130', 'TMC5130_STANDALONE']
564
+ */
565
+#define X_DRIVER_TYPE  A4988
566
+#define Y_DRIVER_TYPE  A4988
567
+#define Z_DRIVER_TYPE  A4988
568
+#define X2_DRIVER_TYPE A4988
569
+#define Y2_DRIVER_TYPE A4988
570
+#define Z2_DRIVER_TYPE A4988
571
+#define E0_DRIVER_TYPE A4988
572
+#define E1_DRIVER_TYPE A4988
573
+#define E2_DRIVER_TYPE A4988
574
+#define E3_DRIVER_TYPE A4988
575
+#define E4_DRIVER_TYPE A4988
576
+
554
 // Enable this feature if all enabled endstop pins are interrupt-capable.
577
 // Enable this feature if all enabled endstop pins are interrupt-capable.
555
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
578
 // This will remove the need to poll the interrupt pins, saving many CPU cycles.
556
 //#define ENDSTOP_INTERRUPTS_FEATURE
579
 //#define ENDSTOP_INTERRUPTS_FEATURE

+ 37
- 88
Marlin/src/config/default/Configuration_adv.h View File

837
 
837
 
838
 /**
838
 /**
839
  * Minimum delay after setting the stepper DIR (in ns)
839
  * Minimum delay after setting the stepper DIR (in ns)
840
- *    0 : No delay (Expect at least 10µS since one Stepper ISR must transpire)
841
- *   20 : Minimum for TMC2xxx drivers
842
- *  200 : Minimum for A4988 drivers
843
- *  500 : Minimum for LV8729 drivers (guess, no info in datasheet)
844
- *  650 : Minimum for DRV8825 drivers
845
- * 1500 : Minimum for TB6600 drivers (guess, no info in datasheet)
846
- *15000 : Minimum for TB6560 drivers (guess, no info in datasheet)
840
+ *     0 : No delay (Expect at least 10µS since one Stepper ISR must transpire)
841
+ *    20 : Minimum for TMC2xxx drivers
842
+ *   200 : Minimum for A4988 drivers
843
+ *   500 : Minimum for LV8729 drivers (guess, no info in datasheet)
844
+ *   650 : Minimum for DRV8825 drivers
845
+ *  1500 : Minimum for TB6600 drivers (guess, no info in datasheet)
846
+ * 15000 : Minimum for TB6560 drivers (guess, no info in datasheet)
847
+ *
848
+ * Override the default value based on the driver type set in Configuration.h.
847
  */
849
  */
848
-#define MINIMUM_STEPPER_DIR_DELAY 0
850
+//#define MINIMUM_STEPPER_DIR_DELAY 650
849
 
851
 
850
 /**
852
 /**
851
  * Minimum stepper driver pulse width (in µs)
853
  * Minimum stepper driver pulse width (in µs)
855
  *   2 : Minimum for DRV8825 stepper drivers
857
  *   2 : Minimum for DRV8825 stepper drivers
856
  *   3 : Minimum for TB6600 stepper drivers
858
  *   3 : Minimum for TB6600 stepper drivers
857
  *  30 : Minimum for TB6560 stepper drivers
859
  *  30 : Minimum for TB6560 stepper drivers
860
+ *
861
+ * Override the default value based on the driver type set in Configuration.h.
858
  */
862
  */
859
-#define MINIMUM_STEPPER_PULSE 2
863
+//#define MINIMUM_STEPPER_PULSE 2
860
 
864
 
861
 /**
865
 /**
862
  * Maximum stepping rate (in Hz) the stepper driver allows
866
  * Maximum stepping rate (in Hz) the stepper driver allows
867
  *  150000 : Maximum for TB6600 stepper driver
871
  *  150000 : Maximum for TB6600 stepper driver
868
  *  130000 : Maximum for LV8729 stepper driver
872
  *  130000 : Maximum for LV8729 stepper driver
869
  *   15000 : Maximum for TB6560 stepper driver
873
  *   15000 : Maximum for TB6560 stepper driver
874
+ *
875
+ * Override the default value based on the driver type set in Configuration.h.
870
  */
876
  */
871
-#define MAXIMUM_STEPPER_RATE 250000
877
+//#define MAXIMUM_STEPPER_RATE 250000
872
 
878
 
873
 // @section temperature
879
 // @section temperature
874
 
880
 
1036
 // @section tmc
1042
 // @section tmc
1037
 
1043
 
1038
 /**
1044
 /**
1039
- * Enable this section if you have TMC26X motor drivers.
1040
- * You will need to import the TMC26XStepper library into the Arduino IDE for this
1041
- * (https://github.com/trinamic/TMC26XStepper.git)
1045
+ * TMC26X Stepper Driver options
1046
+ *
1047
+ * The TMC26XStepper library is required for this stepper driver.
1048
+ * https://github.com/trinamic/TMC26XStepper
1042
  */
1049
  */
1043
-//#define HAVE_TMC26X
1044
-#if ENABLED(HAVE_TMC26X)  // Choose your axes here. This is mandatory!
1045
-  //#define X_IS_TMC26X
1046
-  //#define X2_IS_TMC26X
1047
-  //#define Y_IS_TMC26X
1048
-  //#define Y2_IS_TMC26X
1049
-  //#define Z_IS_TMC26X
1050
-  //#define Z2_IS_TMC26X
1051
-  //#define E0_IS_TMC26X
1052
-  //#define E1_IS_TMC26X
1053
-  //#define E2_IS_TMC26X
1054
-  //#define E3_IS_TMC26X
1055
-  //#define E4_IS_TMC26X
1050
+#if HAS_DRIVER(TMC26X)
1056
 
1051
 
1057
   #define X_MAX_CURRENT     1000 // in mA
1052
   #define X_MAX_CURRENT     1000 // in mA
1058
   #define X_SENSE_RESISTOR    91 // in mOhms
1053
   #define X_SENSE_RESISTOR    91 // in mOhms
1098
   #define E4_SENSE_RESISTOR   91
1093
   #define E4_SENSE_RESISTOR   91
1099
   #define E4_MICROSTEPS       16
1094
   #define E4_MICROSTEPS       16
1100
 
1095
 
1101
-#endif
1096
+#endif // TMC26X
1102
 
1097
 
1103
 // @section tmc_smart
1098
 // @section tmc_smart
1104
 
1099
 
1105
 /**
1100
 /**
1106
- * Enable this for SilentStepStick Trinamic TMC2130 SPI-configurable stepper drivers.
1107
- *
1108
- * You'll also need the TMC2130Stepper Arduino library
1109
- * (https://github.com/teemuatlut/TMC2130Stepper).
1110
- *
1111
  * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to
1101
  * To use TMC2130 stepper drivers in SPI mode connect your SPI pins to
1112
  * the hardware SPI interface on your board and define the required CS pins
1102
  * the hardware SPI interface on your board and define the required CS pins
1113
  * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
1103
  * in your `pins_MYBOARD.h` file. (e.g., RAMPS 1.4 uses AUX3 pins `X_CS_PIN 53`, `Y_CS_PIN 49`, etc.).
1114
  * You may also use software SPI if you wish to use general purpose IO pins.
1104
  * You may also use software SPI if you wish to use general purpose IO pins.
1115
- */
1116
-//#define HAVE_TMC2130
1117
-#if ENABLED(HAVE_TMC2130)  // Choose your axes here. This is mandatory!
1118
-  //#define X_IS_TMC2130
1119
-  //#define X2_IS_TMC2130
1120
-  //#define Y_IS_TMC2130
1121
-  //#define Y2_IS_TMC2130
1122
-  //#define Z_IS_TMC2130
1123
-  //#define Z2_IS_TMC2130
1124
-  //#define E0_IS_TMC2130
1125
-  //#define E1_IS_TMC2130
1126
-  //#define E2_IS_TMC2130
1127
-  //#define E3_IS_TMC2130
1128
-  //#define E4_IS_TMC2130
1129
-#endif
1130
-
1131
-/**
1132
- * Enable this for SilentStepStick Trinamic TMC2208 UART-configurable stepper drivers.
1133
- * Connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor.
1105
+ *
1106
+ * The TMC2130Stepper library is required for this stepper driver.
1107
+ * https://github.com/teemuatlut/TMC2130Stepper
1108
+ *
1109
+ * To use TMC2208 stepper UART-configurable stepper drivers
1110
+ * connect #_SERIAL_TX_PIN to the driver side PDN_UART pin with a 1K resistor.
1134
  * To use the reading capabilities, also connect #_SERIAL_RX_PIN
1111
  * To use the reading capabilities, also connect #_SERIAL_RX_PIN
1135
  * to PDN_UART without a resistor.
1112
  * to PDN_UART without a resistor.
1136
  * The drivers can also be used with hardware serial.
1113
  * The drivers can also be used with hardware serial.
1137
  *
1114
  *
1138
- * You'll also need the TMC2208Stepper Arduino library
1139
- * (https://github.com/teemuatlut/TMC2208Stepper).
1115
+ * The TMC2208Stepper library is required for this stepper driver.
1116
+ * https://github.com/teemuatlut/TMC2208Stepper
1140
  */
1117
  */
1141
-//#define HAVE_TMC2208
1142
-#if ENABLED(HAVE_TMC2208)  // Choose your axes here. This is mandatory!
1143
-  //#define X_IS_TMC2208
1144
-  //#define X2_IS_TMC2208
1145
-  //#define Y_IS_TMC2208
1146
-  //#define Y2_IS_TMC2208
1147
-  //#define Z_IS_TMC2208
1148
-  //#define Z2_IS_TMC2208
1149
-  //#define E0_IS_TMC2208
1150
-  //#define E1_IS_TMC2208
1151
-  //#define E2_IS_TMC2208
1152
-  //#define E3_IS_TMC2208
1153
-  //#define E4_IS_TMC2208
1154
-#endif
1155
-
1156
-#if ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208)
1118
+#if HAS_TRINAMIC
1157
 
1119
 
1158
   #define R_SENSE           0.11  // R_sense resistor for SilentStepStick2130
1120
   #define R_SENSE           0.11  // R_sense resistor for SilentStepStick2130
1159
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
1121
   #define HOLD_MULTIPLIER    0.5  // Scales down the holding current from run current
1308
 // @section L6470
1270
 // @section L6470
1309
 
1271
 
1310
 /**
1272
 /**
1311
- * Enable this section if you have L6470 motor drivers.
1312
- * You need to import the L6470 library into the Arduino IDE for this.
1313
- * (https://github.com/ameyer/Arduino-L6470)
1273
+ * L6470 Stepper Driver options
1274
+ *
1275
+ * The Arduino-L6470 library is required for this stepper driver.
1276
+ * https://github.com/ameyer/Arduino-L6470
1314
  */
1277
  */
1315
-
1316
-//#define HAVE_L6470DRIVER
1317
-#if ENABLED(HAVE_L6470DRIVER)
1318
-
1319
-  //#define X_IS_L6470
1320
-  //#define X2_IS_L6470
1321
-  //#define Y_IS_L6470
1322
-  //#define Y2_IS_L6470
1323
-  //#define Z_IS_L6470
1324
-  //#define Z2_IS_L6470
1325
-  //#define E0_IS_L6470
1326
-  //#define E1_IS_L6470
1327
-  //#define E2_IS_L6470
1328
-  //#define E3_IS_L6470
1329
-  //#define E4_IS_L6470
1278
+#if HAS_DRIVER(L6470)
1330
 
1279
 
1331
   #define X_MICROSTEPS      16 // number of microsteps
1280
   #define X_MICROSTEPS      16 // number of microsteps
1332
   #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1281
   #define X_OVERCURRENT   2000 // maxc current in mA. If the current goes over this value, the driver will switch off
1372
   #define E4_OVERCURRENT  2000
1321
   #define E4_OVERCURRENT  2000
1373
   #define E4_STALLCURRENT 1500
1322
   #define E4_STALLCURRENT 1500
1374
 
1323
 
1375
-#endif
1324
+#endif // L6470
1376
 
1325
 
1377
 /**
1326
 /**
1378
  * TWI/I2C BUS
1327
  * TWI/I2C BUS

+ 57
- 0
Marlin/src/core/drivers.h 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
+#pragma once
23
+
24
+#define A4988               0x001
25
+#define DRV8825             0x002
26
+#define LV8729              0x003
27
+#define L6470               0x104
28
+#define TB6560              0x005
29
+#define TB6600              0x006
30
+#define TMC2100             0x007
31
+#define TMC2130             0x108
32
+#define TMC2130_STANDALONE  0x008
33
+#define TMC2208             0x109
34
+#define TMC2208_STANDALONE  0x009
35
+#define TMC26X              0x10A
36
+#define TMC26X_STANDALONE   0x00A
37
+#define TMC2660             0x10B
38
+#define TMC2660_STANDALONE  0x00B
39
+
40
+#define AXIS_DRIVER_TYPE(A, T) ( defined(A##_DRIVER_TYPE) && (A##_DRIVER_TYPE == T) )
41
+
42
+#define HAS_DRIVER(T)  (AXIS_DRIVER_TYPE( X,T) || AXIS_DRIVER_TYPE(X2,T) || \
43
+                        AXIS_DRIVER_TYPE( Y,T) || AXIS_DRIVER_TYPE(Y2,T) || \
44
+                        AXIS_DRIVER_TYPE( Z,T) || AXIS_DRIVER_TYPE(Z2,T) || \
45
+                        AXIS_DRIVER_TYPE(E0,T) || \
46
+                        AXIS_DRIVER_TYPE(E1,T) || \
47
+                        AXIS_DRIVER_TYPE(E2,T) || \
48
+                        AXIS_DRIVER_TYPE(E3,T) || \
49
+                        AXIS_DRIVER_TYPE(E4,T) )
50
+
51
+// Test for supported TMC drivers that require advanced configuration
52
+// Does not match standalone configurations
53
+#define HAS_TRINAMIC ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2660) )
54
+
55
+#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A, TMC2130) || \
56
+                         AXIS_DRIVER_TYPE(A, TMC2208) || \
57
+                         AXIS_DRIVER_TYPE(A, TMC2660) )

+ 3
- 3
Marlin/src/core/macros.h View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
-#ifndef MACROS_H
24
-#define MACROS_H
23
+#ifndef _CORE_MACROS_H_
24
+#define _CORE_MACROS_H_
25
 
25
 
26
 #define NUM_AXIS 4
26
 #define NUM_AXIS 4
27
 #define ABCE 4
27
 #define ABCE 4
270
 #define FMOD(x, y)  fmodf(x, y)
270
 #define FMOD(x, y)  fmodf(x, y)
271
 #define HYPOT(x,y)  SQRT(HYPOT2(x,y))
271
 #define HYPOT(x,y)  SQRT(HYPOT2(x,y))
272
 
272
 
273
-#endif //__MACROS_H
273
+#endif // _CORE_MACROS_H_

+ 46
- 46
Marlin/src/feature/tmc_util.cpp View File

52
     bool is_ot;
52
     bool is_ot;
53
     bool is_error;
53
     bool is_error;
54
   };
54
   };
55
-  #if ENABLED(HAVE_TMC2130)
55
+  #if HAS_DRIVER(TMC2130)
56
     static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); }
56
     static uint32_t get_pwm_scale(TMC2130Stepper &st) { return st.PWM_SCALE(); }
57
     static uint8_t get_status_response(TMC2130Stepper &st) { return st.status_response & 0xF; }
57
     static uint8_t get_status_response(TMC2130Stepper &st) { return st.status_response & 0xF; }
58
     static TMC_driver_data get_driver_data(TMC2130Stepper &st) {
58
     static TMC_driver_data get_driver_data(TMC2130Stepper &st) {
70
       return data;
70
       return data;
71
     }
71
     }
72
   #endif
72
   #endif
73
-  #if ENABLED(HAVE_TMC2208)
73
+  #if HAS_DRIVER(TMC2208)
74
     static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); }
74
     static uint32_t get_pwm_scale(TMC2208Stepper &st) { return st.pwm_scale_sum(); }
75
     static uint8_t get_status_response(TMC2208Stepper &st) {
75
     static uint8_t get_status_response(TMC2208Stepper &st) {
76
       uint32_t drv_status = st.DRV_STATUS();
76
       uint32_t drv_status = st.DRV_STATUS();
159
     }
159
     }
160
   }
160
   }
161
 
161
 
162
-  #define HAS_HW_COMMS(ST) ENABLED(ST##_IS_TMC2130)|| (ENABLED(ST##_IS_TMC2208) && defined(ST##_HARDWARE_SERIAL))
162
+  #define HAS_HW_COMMS(ST) AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && defined(ST##_HARDWARE_SERIAL))
163
 
163
 
164
   void monitor_tmc_driver() {
164
   void monitor_tmc_driver() {
165
     static millis_t next_cOT = 0;
165
     static millis_t next_cOT = 0;
166
     if (ELAPSED(millis(), next_cOT)) {
166
     if (ELAPSED(millis(), next_cOT)) {
167
       next_cOT = millis() + 500;
167
       next_cOT = millis() + 500;
168
-      #if HAS_HW_COMMS(X) || ENABLED(IS_TRAMS)
168
+      #if HAS_HW_COMMS(X)
169
         static uint8_t x_otpw_cnt = 0;
169
         static uint8_t x_otpw_cnt = 0;
170
         monitor_tmc_driver(stepperX, TMC_X, x_otpw_cnt);
170
         monitor_tmc_driver(stepperX, TMC_X, x_otpw_cnt);
171
       #endif
171
       #endif
172
-      #if HAS_HW_COMMS(Y) || ENABLED(IS_TRAMS)
172
+      #if HAS_HW_COMMS(Y)
173
         static uint8_t y_otpw_cnt = 0;
173
         static uint8_t y_otpw_cnt = 0;
174
         monitor_tmc_driver(stepperY, TMC_Y, y_otpw_cnt);
174
         monitor_tmc_driver(stepperY, TMC_Y, y_otpw_cnt);
175
       #endif
175
       #endif
176
-      #if HAS_HW_COMMS(Z) || ENABLED(IS_TRAMS)
176
+      #if HAS_HW_COMMS(Z)
177
         static uint8_t z_otpw_cnt = 0;
177
         static uint8_t z_otpw_cnt = 0;
178
         monitor_tmc_driver(stepperZ, TMC_Z, z_otpw_cnt);
178
         monitor_tmc_driver(stepperZ, TMC_Z, z_otpw_cnt);
179
       #endif
179
       #endif
189
         static uint8_t z2_otpw_cnt = 0;
189
         static uint8_t z2_otpw_cnt = 0;
190
         monitor_tmc_driver(stepperZ2, TMC_Z, z2_otpw_cnt);
190
         monitor_tmc_driver(stepperZ2, TMC_Z, z2_otpw_cnt);
191
       #endif
191
       #endif
192
-      #if HAS_HW_COMMS(E0) || ENABLED(IS_TRAMS)
192
+      #if HAS_HW_COMMS(E0)
193
         static uint8_t e0_otpw_cnt = 0;
193
         static uint8_t e0_otpw_cnt = 0;
194
         monitor_tmc_driver(stepperE0, TMC_E0, e0_otpw_cnt);
194
         monitor_tmc_driver(stepperE0, TMC_E0, e0_otpw_cnt);
195
       #endif
195
       #endif
311
     SERIAL_EOL();
311
     SERIAL_EOL();
312
   }
312
   }
313
 
313
 
314
-  #if ENABLED(HAVE_TMC2130)
314
+  #if HAS_DRIVER(TMC2130)
315
     static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) {
315
     static void tmc_status(TMC2130Stepper &st, const TMC_debug_enum i) {
316
       switch (i) {
316
       switch (i) {
317
         case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break;
317
         case TMC_PWM_SCALE: SERIAL_PRINT(st.PWM_SCALE(), DEC); break;
331
     }
331
     }
332
   #endif
332
   #endif
333
 
333
 
334
-  #if ENABLED(HAVE_TMC2208)
334
+  #if HAS_DRIVER(TMC2208)
335
     static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) {
335
     static void tmc_status(TMC2208Stepper &st, const TMC_debug_enum i) {
336
       switch (i) {
336
       switch (i) {
337
         case TMC_TSTEP: { uint32_t data = 0; st.TSTEP(&data); SERIAL_PROTOCOL(data); break; }
337
         case TMC_TSTEP: { uint32_t data = 0; st.TSTEP(&data); SERIAL_PROTOCOL(data); break; }
420
   }
420
   }
421
 
421
 
422
   static void tmc_debug_loop(const TMC_debug_enum i) {
422
   static void tmc_debug_loop(const TMC_debug_enum i) {
423
-    #if X_IS_TRINAMIC
423
+    #if AXIS_IS_TMC(X)
424
       tmc_status(stepperX, TMC_X, i, planner.axis_steps_per_mm[X_AXIS]);
424
       tmc_status(stepperX, TMC_X, i, planner.axis_steps_per_mm[X_AXIS]);
425
     #endif
425
     #endif
426
-    #if X2_IS_TRINAMIC
426
+    #if AXIS_IS_TMC(X2)
427
       tmc_status(stepperX2, TMC_X2, i, planner.axis_steps_per_mm[X_AXIS]);
427
       tmc_status(stepperX2, TMC_X2, i, planner.axis_steps_per_mm[X_AXIS]);
428
     #endif
428
     #endif
429
 
429
 
430
-    #if Y_IS_TRINAMIC
430
+    #if AXIS_IS_TMC(Y)
431
       tmc_status(stepperY, TMC_Y, i, planner.axis_steps_per_mm[Y_AXIS]);
431
       tmc_status(stepperY, TMC_Y, i, planner.axis_steps_per_mm[Y_AXIS]);
432
     #endif
432
     #endif
433
-    #if Y2_IS_TRINAMIC
433
+    #if AXIS_IS_TMC(Y2)
434
       tmc_status(stepperY2, TMC_Y2, i, planner.axis_steps_per_mm[Y_AXIS]);
434
       tmc_status(stepperY2, TMC_Y2, i, planner.axis_steps_per_mm[Y_AXIS]);
435
     #endif
435
     #endif
436
 
436
 
437
-    #if Z_IS_TRINAMIC
437
+    #if AXIS_IS_TMC(Z)
438
       tmc_status(stepperZ, TMC_Z, i, planner.axis_steps_per_mm[Z_AXIS]);
438
       tmc_status(stepperZ, TMC_Z, i, planner.axis_steps_per_mm[Z_AXIS]);
439
     #endif
439
     #endif
440
-    #if Z2_IS_TRINAMIC
440
+    #if AXIS_IS_TMC(Z2)
441
       tmc_status(stepperZ2, TMC_Z2, i, planner.axis_steps_per_mm[Z_AXIS]);
441
       tmc_status(stepperZ2, TMC_Z2, i, planner.axis_steps_per_mm[Z_AXIS]);
442
     #endif
442
     #endif
443
 
443
 
444
-    #if E0_IS_TRINAMIC
444
+    #if AXIS_IS_TMC(E0)
445
       tmc_status(stepperE0, TMC_E0, i, planner.axis_steps_per_mm[E_AXIS]);
445
       tmc_status(stepperE0, TMC_E0, i, planner.axis_steps_per_mm[E_AXIS]);
446
     #endif
446
     #endif
447
-    #if E1_IS_TRINAMIC
447
+    #if AXIS_IS_TMC(E1)
448
       tmc_status(stepperE1, TMC_E1, i, planner.axis_steps_per_mm[E_AXIS
448
       tmc_status(stepperE1, TMC_E1, i, planner.axis_steps_per_mm[E_AXIS
449
         #if ENABLED(DISTINCT_E_FACTORS)
449
         #if ENABLED(DISTINCT_E_FACTORS)
450
           + 1
450
           + 1
451
         #endif
451
         #endif
452
       ]);
452
       ]);
453
     #endif
453
     #endif
454
-    #if E2_IS_TRINAMIC
454
+    #if AXIS_IS_TMC(E2)
455
       tmc_status(stepperE2, TMC_E2, i, planner.axis_steps_per_mm[E_AXIS
455
       tmc_status(stepperE2, TMC_E2, i, planner.axis_steps_per_mm[E_AXIS
456
         #if ENABLED(DISTINCT_E_FACTORS)
456
         #if ENABLED(DISTINCT_E_FACTORS)
457
           + 2
457
           + 2
458
         #endif
458
         #endif
459
       ]);
459
       ]);
460
     #endif
460
     #endif
461
-    #if E3_IS_TRINAMIC
461
+    #if AXIS_IS_TMC(E3)
462
       tmc_status(stepperE3, TMC_E3, i, planner.axis_steps_per_mm[E_AXIS
462
       tmc_status(stepperE3, TMC_E3, i, planner.axis_steps_per_mm[E_AXIS
463
         #if ENABLED(DISTINCT_E_FACTORS)
463
         #if ENABLED(DISTINCT_E_FACTORS)
464
           + 3
464
           + 3
465
         #endif
465
         #endif
466
       ]);
466
       ]);
467
     #endif
467
     #endif
468
-    #if E4_IS_TRINAMIC
468
+    #if AXIS_IS_TMC(E4)
469
       tmc_status(stepperE4, TMC_E4, i, planner.axis_steps_per_mm[E_AXIS
469
       tmc_status(stepperE4, TMC_E4, i, planner.axis_steps_per_mm[E_AXIS
470
         #if ENABLED(DISTINCT_E_FACTORS)
470
         #if ENABLED(DISTINCT_E_FACTORS)
471
           + 4
471
           + 4
477
   }
477
   }
478
 
478
 
479
   static void drv_status_loop(const TMC_drv_status_enum i) {
479
   static void drv_status_loop(const TMC_drv_status_enum i) {
480
-    #if X_IS_TRINAMIC
480
+    #if AXIS_IS_TMC(X)
481
       tmc_parse_drv_status(stepperX, TMC_X, i);
481
       tmc_parse_drv_status(stepperX, TMC_X, i);
482
     #endif
482
     #endif
483
-    #if X2_IS_TRINAMIC
483
+    #if AXIS_IS_TMC(X2)
484
       tmc_parse_drv_status(stepperX2, TMC_X2, i);
484
       tmc_parse_drv_status(stepperX2, TMC_X2, i);
485
     #endif
485
     #endif
486
 
486
 
487
-    #if Y_IS_TRINAMIC
487
+    #if AXIS_IS_TMC(Y)
488
       tmc_parse_drv_status(stepperY, TMC_Y, i);
488
       tmc_parse_drv_status(stepperY, TMC_Y, i);
489
     #endif
489
     #endif
490
-    #if Y2_IS_TRINAMIC
490
+    #if AXIS_IS_TMC(Y2)
491
       tmc_parse_drv_status(stepperY2, TMC_Y2, i);
491
       tmc_parse_drv_status(stepperY2, TMC_Y2, i);
492
     #endif
492
     #endif
493
 
493
 
494
-    #if Z_IS_TRINAMIC
494
+    #if AXIS_IS_TMC(Z)
495
       tmc_parse_drv_status(stepperZ, TMC_Z, i);
495
       tmc_parse_drv_status(stepperZ, TMC_Z, i);
496
     #endif
496
     #endif
497
-    #if Z2_IS_TRINAMIC
497
+    #if AXIS_IS_TMC(Z2)
498
       tmc_parse_drv_status(stepperZ2, TMC_Z2, i);
498
       tmc_parse_drv_status(stepperZ2, TMC_Z2, i);
499
     #endif
499
     #endif
500
 
500
 
501
-    #if E0_IS_TRINAMIC
501
+    #if AXIS_IS_TMC(E0)
502
       tmc_parse_drv_status(stepperE0, TMC_E0, i);
502
       tmc_parse_drv_status(stepperE0, TMC_E0, i);
503
     #endif
503
     #endif
504
-    #if E1_IS_TRINAMIC
504
+    #if AXIS_IS_TMC(E1)
505
       tmc_parse_drv_status(stepperE1, TMC_E1, i);
505
       tmc_parse_drv_status(stepperE1, TMC_E1, i);
506
     #endif
506
     #endif
507
-    #if E2_IS_TRINAMIC
507
+    #if AXIS_IS_TMC(E2)
508
       tmc_parse_drv_status(stepperE2, TMC_E2, i);
508
       tmc_parse_drv_status(stepperE2, TMC_E2, i);
509
     #endif
509
     #endif
510
-    #if E3_IS_TRINAMIC
510
+    #if AXIS_IS_TMC(E3)
511
       tmc_parse_drv_status(stepperE3, TMC_E3, i);
511
       tmc_parse_drv_status(stepperE3, TMC_E3, i);
512
     #endif
512
     #endif
513
-    #if E4_IS_TRINAMIC
513
+    #if AXIS_IS_TMC(E4)
514
       tmc_parse_drv_status(stepperE4, TMC_E4, i);
514
       tmc_parse_drv_status(stepperE4, TMC_E4, i);
515
     #endif
515
     #endif
516
 
516
 
553
     TMC_REPORT("Stallguard thrs",    TMC_SGT);
553
     TMC_REPORT("Stallguard thrs",    TMC_SGT);
554
 
554
 
555
     DRV_REPORT("DRVSTATUS",          TMC_DRV_CODES);
555
     DRV_REPORT("DRVSTATUS",          TMC_DRV_CODES);
556
-    #if ENABLED(HAVE_TMC2130)
556
+    #if HAS_DRIVER(TMC2130)
557
       DRV_REPORT("stallguard\t",     TMC_STALLGUARD);
557
       DRV_REPORT("stallguard\t",     TMC_STALLGUARD);
558
       DRV_REPORT("sg_result\t",      TMC_SG_RESULT);
558
       DRV_REPORT("sg_result\t",      TMC_SG_RESULT);
559
       DRV_REPORT("fsactive\t",       TMC_FSACTIVE);
559
       DRV_REPORT("fsactive\t",       TMC_FSACTIVE);
565
     DRV_REPORT("s2ga\t",             TMC_S2GA);
565
     DRV_REPORT("s2ga\t",             TMC_S2GA);
566
     DRV_REPORT("otpw\t",             TMC_DRV_OTPW);
566
     DRV_REPORT("otpw\t",             TMC_DRV_OTPW);
567
     DRV_REPORT("ot\t",               TMC_OT);
567
     DRV_REPORT("ot\t",               TMC_OT);
568
-    #if ENABLED(HAVE_TMC2208)
568
+    #if HAS_DRIVER(TMC2208)
569
       DRV_REPORT("157C\t",           TMC_T157);
569
       DRV_REPORT("157C\t",           TMC_T157);
570
       DRV_REPORT("150C\t",           TMC_T150);
570
       DRV_REPORT("150C\t",           TMC_T150);
571
       DRV_REPORT("143C\t",           TMC_T143);
571
       DRV_REPORT("143C\t",           TMC_T143);
591
 
591
 
592
 #endif // SENSORLESS_HOMING
592
 #endif // SENSORLESS_HOMING
593
 
593
 
594
-#if ENABLED(HAVE_TMC2130)
594
+#if HAS_DRIVER(TMC2130)
595
   #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH)
595
   #define SET_CS_PIN(st) OUT_WRITE(st##_CS_PIN, HIGH)
596
   void tmc_init_cs_pins() {
596
   void tmc_init_cs_pins() {
597
-    #if ENABLED(X_IS_TMC2130)
597
+    #if AXIS_DRIVER_TYPE(X, TMC2130)
598
       SET_CS_PIN(X);
598
       SET_CS_PIN(X);
599
     #endif
599
     #endif
600
-    #if ENABLED(Y_IS_TMC2130)
600
+    #if AXIS_DRIVER_TYPE(Y, TMC2130)
601
       SET_CS_PIN(Y);
601
       SET_CS_PIN(Y);
602
     #endif
602
     #endif
603
-    #if ENABLED(Z_IS_TMC2130)
603
+    #if AXIS_DRIVER_TYPE(Z, TMC2130)
604
       SET_CS_PIN(Z);
604
       SET_CS_PIN(Z);
605
     #endif
605
     #endif
606
-    #if ENABLED(X2_IS_TMC2130)
606
+    #if AXIS_DRIVER_TYPE(X2, TMC2130)
607
       SET_CS_PIN(X2);
607
       SET_CS_PIN(X2);
608
     #endif
608
     #endif
609
-    #if ENABLED(Y2_IS_TMC2130)
609
+    #if AXIS_DRIVER_TYPE(Y2, TMC2130)
610
       SET_CS_PIN(Y2);
610
       SET_CS_PIN(Y2);
611
     #endif
611
     #endif
612
-    #if ENABLED(Z2_IS_TMC2130)
612
+    #if AXIS_DRIVER_TYPE(Z2, TMC2130)
613
       SET_CS_PIN(Z2);
613
       SET_CS_PIN(Z2);
614
     #endif
614
     #endif
615
-    #if ENABLED(E0_IS_TMC2130)
615
+    #if AXIS_DRIVER_TYPE(E0, TMC2130)
616
       SET_CS_PIN(E0);
616
       SET_CS_PIN(E0);
617
     #endif
617
     #endif
618
-    #if ENABLED(E1_IS_TMC2130)
618
+    #if AXIS_DRIVER_TYPE(E1, TMC2130)
619
       SET_CS_PIN(E1);
619
       SET_CS_PIN(E1);
620
     #endif
620
     #endif
621
-    #if ENABLED(E2_IS_TMC2130)
621
+    #if AXIS_DRIVER_TYPE(E2, TMC2130)
622
       SET_CS_PIN(E2);
622
       SET_CS_PIN(E2);
623
     #endif
623
     #endif
624
-    #if ENABLED(E3_IS_TMC2130)
624
+    #if AXIS_DRIVER_TYPE(E3, TMC2130)
625
       SET_CS_PIN(E3);
625
       SET_CS_PIN(E3);
626
     #endif
626
     #endif
627
-    #if ENABLED(E4_IS_TMC2130)
627
+    #if AXIS_DRIVER_TYPE(E4, TMC2130)
628
       SET_CS_PIN(E4);
628
       SET_CS_PIN(E4);
629
     #endif
629
     #endif
630
   }
630
   }
631
-#endif // HAVE_TMC2130
631
+#endif // TMC2130
632
 
632
 
633
 #endif // HAS_TRINAMIC
633
 #endif // HAS_TRINAMIC

+ 3
- 3
Marlin/src/feature/tmc_util.h View File

25
 
25
 
26
 #include "../inc/MarlinConfigPre.h"
26
 #include "../inc/MarlinConfigPre.h"
27
 
27
 
28
-#if ENABLED(HAVE_TMC2130)
28
+#if HAS_DRIVER(TMC2130)
29
   #include <TMC2130Stepper.h>
29
   #include <TMC2130Stepper.h>
30
 #endif
30
 #endif
31
 
31
 
32
-#if ENABLED(HAVE_TMC2208)
32
+#if HAS_DRIVER(TMC2208)
33
   #include <TMC2208Stepper.h>
33
   #include <TMC2208Stepper.h>
34
 #endif
34
 #endif
35
 
35
 
100
   void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable=true);
100
   void tmc_sensorless_homing(TMC2130Stepper &st, const bool enable=true);
101
 #endif
101
 #endif
102
 
102
 
103
-#if ENABLED(HAVE_TMC2130)
103
+#if HAS_DRIVER(TMC2130)
104
   void tmc_init_cs_pins();
104
   void tmc_init_cs_pins();
105
 #endif
105
 #endif
106
 
106
 

+ 22
- 22
Marlin/src/gcode/feature/trinamic/M906.cpp View File

42
     report = false;
42
     report = false;
43
     switch (i) {
43
     switch (i) {
44
       case X_AXIS:
44
       case X_AXIS:
45
-        #if X_IS_TRINAMIC
45
+        #if AXIS_IS_TMC(X)
46
           if (index == 0) TMC_SET_CURRENT(X);
46
           if (index == 0) TMC_SET_CURRENT(X);
47
         #endif
47
         #endif
48
-        #if X2_IS_TRINAMIC
48
+        #if AXIS_IS_TMC(X2)
49
           if (index == 1) TMC_SET_CURRENT(X2);
49
           if (index == 1) TMC_SET_CURRENT(X2);
50
         #endif
50
         #endif
51
         break;
51
         break;
52
       case Y_AXIS:
52
       case Y_AXIS:
53
-        #if Y_IS_TRINAMIC
53
+        #if AXIS_IS_TMC(Y)
54
           if (index == 0) TMC_SET_CURRENT(Y);
54
           if (index == 0) TMC_SET_CURRENT(Y);
55
         #endif
55
         #endif
56
-        #if Y2_IS_TRINAMIC
56
+        #if AXIS_IS_TMC(Y2)
57
           if (index == 1) TMC_SET_CURRENT(Y2);
57
           if (index == 1) TMC_SET_CURRENT(Y2);
58
         #endif
58
         #endif
59
         break;
59
         break;
60
       case Z_AXIS:
60
       case Z_AXIS:
61
-        #if Z_IS_TRINAMIC
61
+        #if AXIS_IS_TMC(Z)
62
           if (index == 0) TMC_SET_CURRENT(Z);
62
           if (index == 0) TMC_SET_CURRENT(Z);
63
         #endif
63
         #endif
64
-        #if Z2_IS_TRINAMIC
64
+        #if AXIS_IS_TMC(Z2)
65
           if (index == 1) TMC_SET_CURRENT(Z2);
65
           if (index == 1) TMC_SET_CURRENT(Z2);
66
         #endif
66
         #endif
67
         break;
67
         break;
68
       case E_AXIS: {
68
       case E_AXIS: {
69
         if (get_target_extruder_from_command()) return;
69
         if (get_target_extruder_from_command()) return;
70
         switch (target_extruder) {
70
         switch (target_extruder) {
71
-          #if E0_IS_TRINAMIC
71
+          #if AXIS_IS_TMC(E0)
72
             case 0: TMC_SET_CURRENT(E0); break;
72
             case 0: TMC_SET_CURRENT(E0); break;
73
           #endif
73
           #endif
74
-          #if E1_IS_TRINAMIC
74
+          #if AXIS_IS_TMC(E1)
75
             case 1: TMC_SET_CURRENT(E1); break;
75
             case 1: TMC_SET_CURRENT(E1); break;
76
           #endif
76
           #endif
77
-          #if E2_IS_TRINAMIC
77
+          #if AXIS_IS_TMC(E2)
78
             case 2: TMC_SET_CURRENT(E2); break;
78
             case 2: TMC_SET_CURRENT(E2); break;
79
           #endif
79
           #endif
80
-          #if E3_IS_TRINAMIC
80
+          #if AXIS_IS_TMC(E3)
81
             case 3: TMC_SET_CURRENT(E3); break;
81
             case 3: TMC_SET_CURRENT(E3); break;
82
           #endif
82
           #endif
83
-          #if E4_IS_TRINAMIC
83
+          #if AXIS_IS_TMC(E4)
84
             case 4: TMC_SET_CURRENT(E4); break;
84
             case 4: TMC_SET_CURRENT(E4); break;
85
           #endif
85
           #endif
86
         }
86
         }
89
   }
89
   }
90
 
90
 
91
   if (report) {
91
   if (report) {
92
-    #if X_IS_TRINAMIC
92
+    #if AXIS_IS_TMC(X)
93
       TMC_SAY_CURRENT(X);
93
       TMC_SAY_CURRENT(X);
94
     #endif
94
     #endif
95
-    #if X2_IS_TRINAMIC
95
+    #if AXIS_IS_TMC(X2)
96
       TMC_SAY_CURRENT(X2);
96
       TMC_SAY_CURRENT(X2);
97
     #endif
97
     #endif
98
-    #if Y_IS_TRINAMIC
98
+    #if AXIS_IS_TMC(Y)
99
       TMC_SAY_CURRENT(Y);
99
       TMC_SAY_CURRENT(Y);
100
     #endif
100
     #endif
101
-    #if Y2_IS_TRINAMIC
101
+    #if AXIS_IS_TMC(Y2)
102
       TMC_SAY_CURRENT(Y2);
102
       TMC_SAY_CURRENT(Y2);
103
     #endif
103
     #endif
104
-    #if Z_IS_TRINAMIC
104
+    #if AXIS_IS_TMC(Z)
105
       TMC_SAY_CURRENT(Z);
105
       TMC_SAY_CURRENT(Z);
106
     #endif
106
     #endif
107
-    #if Z2_IS_TRINAMIC
107
+    #if AXIS_IS_TMC(Z2)
108
       TMC_SAY_CURRENT(Z2);
108
       TMC_SAY_CURRENT(Z2);
109
     #endif
109
     #endif
110
-    #if E0_IS_TRINAMIC
110
+    #if AXIS_IS_TMC(E0)
111
       TMC_SAY_CURRENT(E0);
111
       TMC_SAY_CURRENT(E0);
112
     #endif
112
     #endif
113
-    #if E1_IS_TRINAMIC
113
+    #if AXIS_IS_TMC(E1)
114
       TMC_SAY_CURRENT(E1);
114
       TMC_SAY_CURRENT(E1);
115
     #endif
115
     #endif
116
-    #if E2_IS_TRINAMIC
116
+    #if AXIS_IS_TMC(E2)
117
       TMC_SAY_CURRENT(E2);
117
       TMC_SAY_CURRENT(E2);
118
     #endif
118
     #endif
119
-    #if E3_IS_TRINAMIC
119
+    #if AXIS_IS_TMC(E3)
120
       TMC_SAY_CURRENT(E3);
120
       TMC_SAY_CURRENT(E3);
121
     #endif
121
     #endif
122
-    #if E4_IS_TRINAMIC
122
+    #if AXIS_IS_TMC(E4)
123
       TMC_SAY_CURRENT(E4);
123
       TMC_SAY_CURRENT(E4);
124
     #endif
124
     #endif
125
   }
125
   }

+ 51
- 55
Marlin/src/gcode/feature/trinamic/M911-M915.cpp View File

30
 #include "../../../module/planner.h"
30
 #include "../../../module/planner.h"
31
 #include "../../queue.h"
31
 #include "../../queue.h"
32
 
32
 
33
-#define M91x_USE(A) (ENABLED(A##_IS_TMC2130) || (ENABLED(A##_IS_TMC2208) && PIN_EXISTS(A##_SERIAL_RX)))
33
+#define M91x_USE(ST) (AXIS_DRIVER_TYPE(ST, TMC2130) || (AXIS_DRIVER_TYPE(ST, TMC2208) && PIN_EXISTS(ST##_SERIAL_RX)))
34
 #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
34
 #define M91x_USE_E(N) (E_STEPPERS > N && M91x_USE(E##N))
35
-#define M91x_USE_X  (ENABLED(IS_TRAMS) || M91x_USE(X))
36
-#define M91x_USE_Y  (ENABLED(IS_TRAMS) || M91x_USE(Y))
37
-#define M91x_USE_Z  (ENABLED(IS_TRAMS) || M91x_USE(Z))
38
-#define M91x_USE_E0 (ENABLED(IS_TRAMS) || M91x_USE_E(0))
39
 
35
 
40
 /**
36
 /**
41
  * M911: Report TMC stepper driver overtemperature pre-warn flag
37
  * M911: Report TMC stepper driver overtemperature pre-warn flag
42
  *       This flag is held by the library, persisting until cleared by M912
38
  *       This flag is held by the library, persisting until cleared by M912
43
  */
39
  */
44
 void GcodeSuite::M911() {
40
 void GcodeSuite::M911() {
45
-  #if M91x_USE_X
41
+  #if M91x_USE(X)
46
     tmc_report_otpw(stepperX, TMC_X);
42
     tmc_report_otpw(stepperX, TMC_X);
47
   #endif
43
   #endif
48
   #if M91x_USE(X2)
44
   #if M91x_USE(X2)
49
     tmc_report_otpw(stepperX2, TMC_X2);
45
     tmc_report_otpw(stepperX2, TMC_X2);
50
   #endif
46
   #endif
51
-  #if M91x_USE_Y
47
+  #if M91x_USE(Y)
52
     tmc_report_otpw(stepperY, TMC_Y);
48
     tmc_report_otpw(stepperY, TMC_Y);
53
   #endif
49
   #endif
54
   #if M91x_USE(Y2)
50
   #if M91x_USE(Y2)
55
     tmc_report_otpw(stepperY2, TMC_Y2);
51
     tmc_report_otpw(stepperY2, TMC_Y2);
56
   #endif
52
   #endif
57
-  #if M91x_USE_Z
53
+  #if M91x_USE(Z)
58
     tmc_report_otpw(stepperZ, TMC_Z);
54
     tmc_report_otpw(stepperZ, TMC_Z);
59
   #endif
55
   #endif
60
   #if M91x_USE(Z2)
56
   #if M91x_USE(Z2)
61
     tmc_report_otpw(stepperZ2, TMC_Z2);
57
     tmc_report_otpw(stepperZ2, TMC_Z2);
62
   #endif
58
   #endif
63
-  #if M91x_USE_E0
59
+  #if M91x_USE_E(0)
64
     tmc_report_otpw(stepperE0, TMC_E0);
60
     tmc_report_otpw(stepperE0, TMC_E0);
65
   #endif
61
   #endif
66
   #if M91x_USE_E(1)
62
   #if M91x_USE_E(1)
96
                hasE = parser.seen(axis_codes[E_AXIS]),
92
                hasE = parser.seen(axis_codes[E_AXIS]),
97
                hasNone = !hasX && !hasY && !hasZ && !hasE;
93
                hasNone = !hasX && !hasY && !hasZ && !hasE;
98
 
94
 
99
-    #if M91x_USE_X || M91x_USE(X2)
95
+    #if M91x_USE(X) || M91x_USE(X2)
100
       const uint8_t xval = parser.byteval(axis_codes[X_AXIS], 10);
96
       const uint8_t xval = parser.byteval(axis_codes[X_AXIS], 10);
101
-      #if M91x_USE_X
97
+      #if M91x_USE(X)
102
         if (hasNone || xval == 1 || (hasX && xval == 10)) tmc_clear_otpw(stepperX, TMC_X);
98
         if (hasNone || xval == 1 || (hasX && xval == 10)) tmc_clear_otpw(stepperX, TMC_X);
103
       #endif
99
       #endif
104
       #if M91x_USE(X2)
100
       #if M91x_USE(X2)
106
       #endif
102
       #endif
107
     #endif
103
     #endif
108
 
104
 
109
-    #if M91x_USE_Y || M91x_USE(Y2)
105
+    #if M91x_USE(Y) || M91x_USE(Y2)
110
       const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10);
106
       const uint8_t yval = parser.byteval(axis_codes[Y_AXIS], 10);
111
-      #if M91x_USE_Y
107
+      #if M91x_USE(Y)
112
         if (hasNone || yval == 1 || (hasY && yval == 10)) tmc_clear_otpw(stepperY, TMC_Y);
108
         if (hasNone || yval == 1 || (hasY && yval == 10)) tmc_clear_otpw(stepperY, TMC_Y);
113
       #endif
109
       #endif
114
       #if M91x_USE(Y2)
110
       #if M91x_USE(Y2)
116
       #endif
112
       #endif
117
     #endif
113
     #endif
118
 
114
 
119
-    #if M91x_USE_Z || M91x_USE(Z2)
115
+    #if M91x_USE(Z) || M91x_USE(Z2)
120
       const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10);
116
       const uint8_t zval = parser.byteval(axis_codes[Z_AXIS], 10);
121
-      #if M91x_USE_Z
117
+      #if M91x_USE(Z)
122
         if (hasNone || zval == 1 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ, TMC_Z);
118
         if (hasNone || zval == 1 || (hasZ && zval == 10)) tmc_clear_otpw(stepperZ, TMC_Z);
123
       #endif
119
       #endif
124
       #if M91x_USE(Z2)
120
       #if M91x_USE(Z2)
126
       #endif
122
       #endif
127
     #endif
123
     #endif
128
 
124
 
129
-    #if M91x_USE_E0 || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4)
125
+    #if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4)
130
       const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10);
126
       const uint8_t eval = parser.byteval(axis_codes[E_AXIS], 10);
131
-      #if M91x_USE_E0
127
+      #if M91x_USE_E(0)
132
         if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0);
128
         if (hasNone || eval == 0 || (hasE && eval == 10)) tmc_clear_otpw(stepperE0, TMC_E0);
133
       #endif
129
       #endif
134
       #if M91x_USE_E(1)
130
       #if M91x_USE_E(1)
162
       report = false;
158
       report = false;
163
       switch (i) {
159
       switch (i) {
164
         case X_AXIS:
160
         case X_AXIS:
165
-          #if X_IS_TRINAMIC
161
+          #if AXIS_HAS_STEALTHCHOP(X)
166
             if (index < 2) TMC_SET_PWMTHRS(X,X);
162
             if (index < 2) TMC_SET_PWMTHRS(X,X);
167
           #endif
163
           #endif
168
-          #if X2_IS_TRINAMIC
164
+          #if AXIS_HAS_STEALTHCHOP(X2)
169
             if (!(index & 1)) TMC_SET_PWMTHRS(X,X2);
165
             if (!(index & 1)) TMC_SET_PWMTHRS(X,X2);
170
           #endif
166
           #endif
171
           break;
167
           break;
172
         case Y_AXIS:
168
         case Y_AXIS:
173
-          #if Y_IS_TRINAMIC
169
+          #if AXIS_HAS_STEALTHCHOP(Y)
174
             if (index < 2) TMC_SET_PWMTHRS(Y,Y);
170
             if (index < 2) TMC_SET_PWMTHRS(Y,Y);
175
           #endif
171
           #endif
176
-          #if Y2_IS_TRINAMIC
172
+          #if AXIS_HAS_STEALTHCHOP(Y2)
177
             if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2);
173
             if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2);
178
           #endif
174
           #endif
179
           break;
175
           break;
180
         case Z_AXIS:
176
         case Z_AXIS:
181
-          #if Z_IS_TRINAMIC
177
+          #if AXIS_HAS_STEALTHCHOP(Z)
182
             if (index < 2) TMC_SET_PWMTHRS(Z,Z);
178
             if (index < 2) TMC_SET_PWMTHRS(Z,Z);
183
           #endif
179
           #endif
184
-          #if Z2_IS_TRINAMIC
180
+          #if AXIS_HAS_STEALTHCHOP(Z2)
185
             if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2);
181
             if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2);
186
           #endif
182
           #endif
187
           break;
183
           break;
188
         case E_AXIS: {
184
         case E_AXIS: {
189
           if (get_target_extruder_from_command()) return;
185
           if (get_target_extruder_from_command()) return;
190
           switch (target_extruder) {
186
           switch (target_extruder) {
191
-            #if E0_IS_TRINAMIC
187
+            #if AXIS_HAS_STEALTHCHOP(E0)
192
               case 0: TMC_SET_PWMTHRS_E(0); break;
188
               case 0: TMC_SET_PWMTHRS_E(0); break;
193
             #endif
189
             #endif
194
-            #if E_STEPPERS > 1 && E1_IS_TRINAMIC
190
+            #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
195
               case 1: TMC_SET_PWMTHRS_E(1); break;
191
               case 1: TMC_SET_PWMTHRS_E(1); break;
196
             #endif
192
             #endif
197
-            #if E_STEPPERS > 2 && E2_IS_TRINAMIC
193
+            #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
198
               case 2: TMC_SET_PWMTHRS_E(2); break;
194
               case 2: TMC_SET_PWMTHRS_E(2); break;
199
             #endif
195
             #endif
200
-            #if E_STEPPERS > 3 && E3_IS_TRINAMIC
196
+            #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
201
               case 3: TMC_SET_PWMTHRS_E(3); break;
197
               case 3: TMC_SET_PWMTHRS_E(3); break;
202
             #endif
198
             #endif
203
-            #if E_STEPPERS > 4 && E4_IS_TRINAMIC
199
+            #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
204
               case 4: TMC_SET_PWMTHRS_E(4); break;
200
               case 4: TMC_SET_PWMTHRS_E(4); break;
205
             #endif
201
             #endif
206
           }
202
           }
209
     }
205
     }
210
 
206
 
211
     if (report) {
207
     if (report) {
212
-      #if X_IS_TRINAMIC
208
+      #if AXIS_HAS_STEALTHCHOP(X)
213
         TMC_SAY_PWMTHRS(X,X);
209
         TMC_SAY_PWMTHRS(X,X);
214
       #endif
210
       #endif
215
-      #if X2_IS_TRINAMIC
211
+      #if AXIS_HAS_STEALTHCHOP(X2)
216
         TMC_SAY_PWMTHRS(X,X2);
212
         TMC_SAY_PWMTHRS(X,X2);
217
       #endif
213
       #endif
218
-      #if Y_IS_TRINAMIC
214
+      #if AXIS_HAS_STEALTHCHOP(Y)
219
         TMC_SAY_PWMTHRS(Y,Y);
215
         TMC_SAY_PWMTHRS(Y,Y);
220
       #endif
216
       #endif
221
-      #if Y2_IS_TRINAMIC
217
+      #if AXIS_HAS_STEALTHCHOP(Y2)
222
         TMC_SAY_PWMTHRS(Y,Y2);
218
         TMC_SAY_PWMTHRS(Y,Y2);
223
       #endif
219
       #endif
224
-      #if Z_IS_TRINAMIC
220
+      #if AXIS_HAS_STEALTHCHOP(Z)
225
         TMC_SAY_PWMTHRS(Z,Z);
221
         TMC_SAY_PWMTHRS(Z,Z);
226
       #endif
222
       #endif
227
-      #if Z2_IS_TRINAMIC
223
+      #if AXIS_HAS_STEALTHCHOP(Z2)
228
         TMC_SAY_PWMTHRS(Z,Z2);
224
         TMC_SAY_PWMTHRS(Z,Z2);
229
       #endif
225
       #endif
230
-      #if E0_IS_TRINAMIC
226
+      #if AXIS_HAS_STEALTHCHOP(E0)
231
         TMC_SAY_PWMTHRS_E(0);
227
         TMC_SAY_PWMTHRS_E(0);
232
       #endif
228
       #endif
233
-      #if E_STEPPERS > 1 && E1_IS_TRINAMIC
229
+      #if E_STEPPERS > 1 && AXIS_HAS_STEALTHCHOP(E1)
234
         TMC_SAY_PWMTHRS_E(1);
230
         TMC_SAY_PWMTHRS_E(1);
235
       #endif
231
       #endif
236
-      #if E_STEPPERS > 2 && E2_IS_TRINAMIC
232
+      #if E_STEPPERS > 2 && AXIS_HAS_STEALTHCHOP(E2)
237
         TMC_SAY_PWMTHRS_E(2);
233
         TMC_SAY_PWMTHRS_E(2);
238
       #endif
234
       #endif
239
-      #if E_STEPPERS > 3 && E3_IS_TRINAMIC
235
+      #if E_STEPPERS > 3 && AXIS_HAS_STEALTHCHOP(E3)
240
         TMC_SAY_PWMTHRS_E(3);
236
         TMC_SAY_PWMTHRS_E(3);
241
       #endif
237
       #endif
242
-      #if E_STEPPERS > 4 && E4_IS_TRINAMIC
238
+      #if E_STEPPERS > 4 && AXIS_HAS_STEALTHCHOP(E4)
243
         TMC_SAY_PWMTHRS_E(4);
239
         TMC_SAY_PWMTHRS_E(4);
244
       #endif
240
       #endif
245
     }
241
     }
262
       switch (i) {
258
       switch (i) {
263
         #if X_SENSORLESS
259
         #if X_SENSORLESS
264
           case X_AXIS:
260
           case X_AXIS:
265
-            #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
261
+            #if AXIS_HAS_STALLGUARD(X)
266
               if (index < 2) TMC_SET_SGT(X);
262
               if (index < 2) TMC_SET_SGT(X);
267
             #endif
263
             #endif
268
-            #if ENABLED(X2_IS_TMC2130)
264
+            #if AXIS_HAS_STALLGUARD(X2)
269
               if (!(index & 1)) TMC_SET_SGT(X2);
265
               if (!(index & 1)) TMC_SET_SGT(X2);
270
             #endif
266
             #endif
271
             break;
267
             break;
272
         #endif
268
         #endif
273
         #if Y_SENSORLESS
269
         #if Y_SENSORLESS
274
           case Y_AXIS:
270
           case Y_AXIS:
275
-            #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
271
+            #if AXIS_HAS_STALLGUARD(Y)
276
               if (index < 2) TMC_SET_SGT(Y);
272
               if (index < 2) TMC_SET_SGT(Y);
277
             #endif
273
             #endif
278
-            #if ENABLED(Y2_IS_TMC2130)
274
+            #if AXIS_HAS_STALLGUARD(Y2)
279
               if (!(index & 1)) TMC_SET_SGT(Y2);
275
               if (!(index & 1)) TMC_SET_SGT(Y2);
280
             #endif
276
             #endif
281
             break;
277
             break;
282
         #endif
278
         #endif
283
         #if Z_SENSORLESS
279
         #if Z_SENSORLESS
284
           case Z_AXIS:
280
           case Z_AXIS:
285
-            #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
281
+            #if AXIS_HAS_STALLGUARD(Z)
286
               if (index < 2) TMC_SET_SGT(Z);
282
               if (index < 2) TMC_SET_SGT(Z);
287
             #endif
283
             #endif
288
-            #if ENABLED(Z2_IS_TMC2130)
284
+            #if AXIS_HAS_STALLGUARD(Z2)
289
               if (!(index & 1)) TMC_SET_SGT(Z2);
285
               if (!(index & 1)) TMC_SET_SGT(Z2);
290
             #endif
286
             #endif
291
             break;
287
             break;
295
 
291
 
296
     if (report) {
292
     if (report) {
297
       #if X_SENSORLESS
293
       #if X_SENSORLESS
298
-        #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
294
+        #if AXIS_HAS_STALLGUARD(X)
299
           TMC_SAY_SGT(X);
295
           TMC_SAY_SGT(X);
300
         #endif
296
         #endif
301
-        #if ENABLED(X2_IS_TMC2130)
297
+        #if AXIS_HAS_STALLGUARD(X2)
302
           TMC_SAY_SGT(X2);
298
           TMC_SAY_SGT(X2);
303
         #endif
299
         #endif
304
       #endif
300
       #endif
305
       #if Y_SENSORLESS
301
       #if Y_SENSORLESS
306
-        #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
302
+        #if AXIS_HAS_STALLGUARD(Y)
307
           TMC_SAY_SGT(Y);
303
           TMC_SAY_SGT(Y);
308
         #endif
304
         #endif
309
-        #if ENABLED(Y2_IS_TMC2130)
305
+        #if AXIS_HAS_STALLGUARD(Y2)
310
           TMC_SAY_SGT(Y2);
306
           TMC_SAY_SGT(Y2);
311
         #endif
307
         #endif
312
       #endif
308
       #endif
313
       #if Z_SENSORLESS
309
       #if Z_SENSORLESS
314
-        #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
310
+        #if AXIS_HAS_STALLGUARD(Z)
315
           TMC_SAY_SGT(Z);
311
           TMC_SAY_SGT(Z);
316
         #endif
312
         #endif
317
-        #if ENABLED(Z2_IS_TMC2130)
313
+        #if AXIS_HAS_STALLGUARD(Z2)
318
           TMC_SAY_SGT(Z2);
314
           TMC_SAY_SGT(Z2);
319
         #endif
315
         #endif
320
       #endif
316
       #endif
335
       return;
331
       return;
336
     }
332
     }
337
 
333
 
338
-    #if Z_IS_TRINAMIC
334
+    #if AXIS_IS_TMC(Z)
339
       const uint16_t Z_current_1 = stepperZ.getCurrent();
335
       const uint16_t Z_current_1 = stepperZ.getCurrent();
340
       stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
336
       stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
341
     #endif
337
     #endif
342
-    #if Z2_IS_TRINAMIC
338
+    #if AXIS_IS_TMC(Z2)
343
       const uint16_t Z2_current_1 = stepperZ2.getCurrent();
339
       const uint16_t Z2_current_1 = stepperZ2.getCurrent();
344
       stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
340
       stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
345
     #endif
341
     #endif
350
 
346
 
351
     do_blocking_move_to_z(Z_MAX_POS+_z);
347
     do_blocking_move_to_z(Z_MAX_POS+_z);
352
 
348
 
353
-    #if Z_IS_TRINAMIC
349
+    #if AXIS_IS_TMC(Z)
354
       stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER);
350
       stepperZ.setCurrent(Z_current_1, R_SENSE, HOLD_MULTIPLIER);
355
     #endif
351
     #endif
356
-    #if Z2_IS_TRINAMIC
352
+    #if AXIS_IS_TMC(Z2)
357
       stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER);
353
       stepperZ2.setCurrent(Z2_current_1, R_SENSE, HOLD_MULTIPLIER);
358
     #endif
354
     #endif
359
 
355
 

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

132
  * M119 - Report endstops status.
132
  * M119 - Report endstops status.
133
  * M120 - Enable endstops detection.
133
  * M120 - Enable endstops detection.
134
  * M121 - Disable endstops detection.
134
  * M121 - Disable endstops detection.
135
- * M122 - Debug stepper (Requires HAVE_TMC2130 or HAVE_TMC2208)
135
+ * M122 - Debug stepper (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
136
  * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
136
  * M125 - Save current position and move to filament change position. (Requires PARK_HEAD_ON_PAUSE)
137
  * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
137
  * M126 - Solenoid Air Valve Open. (Requires BARICUDA)
138
  * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
138
  * M127 - Solenoid Air Valve Closed. (Requires BARICUDA)
219
  * M868 - Report or set position encoder module error correction threshold.
219
  * M868 - Report or set position encoder module error correction threshold.
220
  * M869 - Report position encoder module error.
220
  * M869 - Report position encoder module error.
221
  * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
221
  * M900 - Get or Set Linear Advance K-factor. (Requires LIN_ADVANCE)
222
- * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires HAVE_TMC2130 or HAVE_TMC2208)
222
+ * M906 - Set or get motor current in milliamps using axis codes X, Y, Z, E. Report values if no axis codes given. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
223
  * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
223
  * M907 - Set digital trimpot motor current using axis codes. (Requires a board with digital trimpots)
224
  * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN)
224
  * M908 - Control digital trimpot directly. (Requires DAC_STEPPER_CURRENT or DIGIPOTSS_PIN)
225
  * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT)
225
  * M909 - Print digipot/DAC current value. (Requires DAC_STEPPER_CURRENT)
226
  * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
226
  * M910 - Commit digipot/DAC value to external EEPROM via I2C. (Requires DAC_STEPPER_CURRENT)
227
- * M911 - Report stepper driver overtemperature pre-warn condition. (Requires HAVE_TMC2130 or HAVE_TMC2208)
228
- * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires HAVE_TMC2130 or HAVE_TMC2208)
227
+ * M911 - Report stepper driver overtemperature pre-warn condition. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
228
+ * M912 - Clear stepper driver overtemperature pre-warn condition flag. (Requires at least one _DRIVER_TYPE defined as TMC2130/TMC2208/TMC2660)
229
  * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
229
  * M913 - Set HYBRID_THRESHOLD speed. (Requires HYBRID_THRESHOLD)
230
  * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING)
230
  * M914 - Set SENSORLESS_HOMING sensitivity. (Requires SENSORLESS_HOMING)
231
  *
231
  *

+ 64
- 15
Marlin/src/inc/Conditionals_post.h View File

427
 #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
427
 #define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1)
428
 
428
 
429
 /**
429
 /**
430
+ * Driver Timings
431
+ * NOTE: Driver timing order is longest-to-shortest duration.
432
+ *       Preserve this ordering when adding new drivers.
433
+ */
434
+#ifndef MINIMUM_STEPPER_DIR_DELAY
435
+  #if HAS_DRIVER(TB6560)
436
+    #define MINIMUM_STEPPER_DIR_DELAY 15000
437
+  #elif HAS_DRIVER(TB6600)
438
+    #define MINIMUM_STEPPER_DIR_DELAY 1500
439
+  #elif HAS_DRIVER(DRV8825)
440
+    #define MINIMUM_STEPPER_DIR_DELAY 650
441
+  #elif HAS_DRIVER(LV8729)
442
+    #define MINIMUM_STEPPER_DIR_DELAY 500
443
+  #elif HAS_DRIVER(A4988)
444
+    #define MINIMUM_STEPPER_DIR_DELAY 200
445
+  #elif HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE)
446
+    #define MINIMUM_STEPPER_DIR_DELAY 20
447
+  #else
448
+    #define MINIMUM_STEPPER_DIR_DELAY 0   // Expect at least 10µS since one Stepper ISR must transpire
449
+  #endif
450
+#endif
451
+
452
+#ifndef MINIMUM_STEPPER_PULSE
453
+  #if HAS_DRIVER(TB6560)
454
+    #define MINIMUM_STEPPER_PULSE 30
455
+  #elif HAS_DRIVER(TB6600)
456
+    #define MINIMUM_STEPPER_PULSE 3
457
+  #elif HAS_DRIVER(DRV8825)
458
+    #define MINIMUM_STEPPER_PULSE 2
459
+  #elif HAS_DRIVER(A4988) || HAS_DRIVER(LV8729)
460
+    #define MINIMUM_STEPPER_PULSE 1
461
+  #elif HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE)
462
+    #define MINIMUM_STEPPER_PULSE 0
463
+  #else
464
+    #define MINIMUM_STEPPER_PULSE 2
465
+  #endif
466
+#endif
467
+
468
+#ifndef MAXIMUM_STEPPER_RATE
469
+  #if HAS_DRIVER(TB6560)
470
+    #define MAXIMUM_STEPPER_RATE 15000
471
+  #elif HAS_DRIVER(LV8729)
472
+    #define MAXIMUM_STEPPER_RATE 130000
473
+  #elif HAS_DRIVER(TB6600)
474
+    #define MAXIMUM_STEPPER_RATE 150000
475
+  #elif HAS_DRIVER(DRV8825)
476
+    #define MAXIMUM_STEPPER_RATE 250000
477
+  #elif HAS_TRINAMIC || HAS_DRIVER(TMC2130_STANDALONE) || HAS_DRIVER(TMC2208_STANDALONE) || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE)
478
+    #define MAXIMUM_STEPPER_RATE 400000
479
+  #elif HAS_DRIVER(A4988)
480
+    #define MAXIMUM_STEPPER_RATE 500000
481
+  #else
482
+    #define MAXIMUM_STEPPER_RATE 250000
483
+  #endif
484
+#endif
485
+
486
+/**
430
  * X_DUAL_ENDSTOPS endstop reassignment
487
  * X_DUAL_ENDSTOPS endstop reassignment
431
  */
488
  */
432
 #if ENABLED(X_DUAL_ENDSTOPS)
489
 #if ENABLED(X_DUAL_ENDSTOPS)
711
 #define HAS_SOLENOID_4    (PIN_EXISTS(SOL4))
768
 #define HAS_SOLENOID_4    (PIN_EXISTS(SOL4))
712
 
769
 
713
 // Trinamic Stepper Drivers
770
 // Trinamic Stepper Drivers
714
-#define HAS_TRINAMIC (ENABLED(HAVE_TMC2130) || ENABLED(HAVE_TMC2208) || ENABLED(IS_TRAMS))
715
-#define  X_IS_TRINAMIC (ENABLED( X_IS_TMC2130) || ENABLED( X_IS_TMC2208) || ENABLED(IS_TRAMS))
716
-#define X2_IS_TRINAMIC (ENABLED(X2_IS_TMC2130) || ENABLED(X2_IS_TMC2208))
717
-#define  Y_IS_TRINAMIC (ENABLED( Y_IS_TMC2130) || ENABLED( Y_IS_TMC2208) || ENABLED(IS_TRAMS))
718
-#define Y2_IS_TRINAMIC (ENABLED(Y2_IS_TMC2130) || ENABLED(Y2_IS_TMC2208))
719
-#define  Z_IS_TRINAMIC (ENABLED( Z_IS_TMC2130) || ENABLED( Z_IS_TMC2208) || ENABLED(IS_TRAMS))
720
-#define Z2_IS_TRINAMIC (ENABLED(Z2_IS_TMC2130) || ENABLED(Z2_IS_TMC2208))
721
-#define E0_IS_TRINAMIC (ENABLED(E0_IS_TMC2130) || ENABLED(E0_IS_TMC2208) || ENABLED(IS_TRAMS))
722
-#define E1_IS_TRINAMIC (ENABLED(E1_IS_TMC2130) || ENABLED(E1_IS_TMC2208))
723
-#define E2_IS_TRINAMIC (ENABLED(E2_IS_TMC2130) || ENABLED(E2_IS_TMC2208))
724
-#define E3_IS_TRINAMIC (ENABLED(E3_IS_TMC2130) || ENABLED(E3_IS_TMC2208))
725
-#define E4_IS_TRINAMIC (ENABLED(E4_IS_TMC2130) || ENABLED(E4_IS_TMC2208))
771
+#define HAS_STEALTHCHOP (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208))
772
+#define HAS_STALLGUARD  (HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2660))
773
+#define AXIS_HAS_STEALTHCHOP(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2208) )
774
+#define AXIS_HAS_STALLGUARD(ST) ( AXIS_DRIVER_TYPE(ST, TMC2130) || AXIS_DRIVER_TYPE(ST, TMC2660) )
726
 
775
 
727
 #if ENABLED(SENSORLESS_HOMING)
776
 #if ENABLED(SENSORLESS_HOMING)
728
   // Disable Z axis sensorless homing if a probe is used to home the Z axis
777
   // Disable Z axis sensorless homing if a probe is used to home the Z axis
729
   #if HOMING_Z_WITH_PROBE
778
   #if HOMING_Z_WITH_PROBE
730
     #undef Z_HOMING_SENSITIVITY
779
     #undef Z_HOMING_SENSITIVITY
731
   #endif
780
   #endif
732
-  #define X_SENSORLESS (ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY))
733
-  #define Y_SENSORLESS (ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY))
734
-  #define Z_SENSORLESS (ENABLED(Z_IS_TMC2130) && defined(Z_HOMING_SENSITIVITY))
781
+  #define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_HOMING_SENSITIVITY))
782
+  #define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_HOMING_SENSITIVITY))
783
+  #define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_HOMING_SENSITIVITY))
735
 #endif
784
 #endif
736
 
785
 
737
 // Endstops and bed probe
786
 // Endstops and bed probe

+ 1
- 0
Marlin/src/inc/MarlinConfigPre.h View File

29
 #include "../core/types.h"
29
 #include "../core/types.h"
30
 #include "Version.h"
30
 #include "Version.h"
31
 #include "../../Configuration.h"
31
 #include "../../Configuration.h"
32
+#include "../core/drivers.h"
32
 #include "Conditionals_LCD.h"
33
 #include "Conditionals_LCD.h"
33
 #include "../../Configuration_adv.h"
34
 #include "../../Configuration_adv.h"
34
 #include "Conditionals_adv.h"
35
 #include "Conditionals_adv.h"

+ 87
- 226
Marlin/src/inc/SanityCheck.h View File

265
 #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
265
 #elif defined(MEASURED_LOWER_LIMIT) || defined(MEASURED_UPPER_LIMIT)
266
   #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration."
266
   #error "MEASURED_(UPPER|LOWER)_LIMIT is now FILWIDTH_ERROR_MARGIN. Please update your configuration."
267
 #elif defined(HAVE_TMCDRIVER)
267
 #elif defined(HAVE_TMCDRIVER)
268
-  #error "HAVE_TMCDRIVER is now HAVE_TMC26X. Please update your Configuration_adv.h."
268
+  #error "HAVE_TMCDRIVER is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
269
+#elif defined(HAVE_TMC26X)
270
+  #error "HAVE_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
271
+#elif defined(HAVE_TMC2130)
272
+  #error "HAVE_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
273
+#elif defined(HAVE_L6470DRIVER)
274
+  #error "HAVE_L6470DRIVER is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
269
 #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \
275
 #elif defined(X_IS_TMC) || defined(X2_IS_TMC) || defined(Y_IS_TMC) || defined(Y2_IS_TMC) || defined(Z_IS_TMC) || defined(Z2_IS_TMC) \
270
    || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC)
276
    || defined(E0_IS_TMC) || defined(E1_IS_TMC) || defined(E2_IS_TMC) || defined(E3_IS_TMC) || defined(E4_IS_TMC)
271
-  #error "[AXIS]_IS_TMC is now [AXIS]_IS_TMC26X. Please update your Configuration_adv.h."
277
+  #error "[AXIS]_IS_TMC is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
278
+#elif defined(X_IS_TMC26X) || defined(X2_IS_TMC26X) || defined(Y_IS_TMC26X) || defined(Y2_IS_TMC26X) || defined(Z_IS_TMC26X) || defined(Z2_IS_TMC26X) \
279
+   || defined(E0_IS_TMC26X) || defined(E1_IS_TMC26X) || defined(E2_IS_TMC26X) || defined(E3_IS_TMC26X) || defined(E4_IS_TMC26X)
280
+  #error "[AXIS]_IS_TMC26X is now [AXIS]_DRIVER_TYPE TMC26X. Please update your Configuration.h."
281
+#elif defined(X_IS_TMC2130) || defined(X2_IS_TMC2130) || defined(Y_IS_TMC2130) || defined(Y2_IS_TMC2130) || defined(Z_IS_TMC2130) || defined(Z2_IS_TMC2130) \
282
+   || defined(E0_IS_TMC2130) || defined(E1_IS_TMC2130) || defined(E2_IS_TMC2130) || defined(E3_IS_TMC2130) || defined(E4_IS_TMC2130)
283
+  #error "[AXIS]_IS_TMC2130 is now [AXIS]_DRIVER_TYPE TMC2130. Please update your Configuration.h."
284
+#elif defined(X_IS_TMC2208) || defined(X2_IS_TMC2208) || defined(Y_IS_TMC2208) || defined(Y2_IS_TMC2208) || defined(Z_IS_TMC2208) || defined(Z2_IS_TMC2208) \
285
+   || defined(E0_IS_TMC2208) || defined(E1_IS_TMC2208) || defined(E2_IS_TMC2208) || defined(E3_IS_TMC2208) || defined(E4_IS_TMC2208)
286
+  #error "[AXIS]_IS_TMC2208 is now [AXIS]_DRIVER_TYPE TMC2208. Please update your Configuration.h."
287
+#elif defined(X_IS_L6470) || defined(X2_IS_L6470) || defined(Y_IS_L6470) || defined(Y2_IS_L6470) || defined(Z_IS_L6470) || defined(Z2_IS_L6470) \
288
+   || defined(E0_IS_L6470) || defined(E1_IS_L6470) || defined(E2_IS_L6470) || defined(E3_IS_L6470) || defined(E4_IS_L6470)
289
+  #error "[AXIS]_IS_L6470 is now [AXIS]_DRIVER_TYPE L6470. Please update your Configuration.h."
272
 #elif defined(AUTOMATIC_CURRENT_CONTROL)
290
 #elif defined(AUTOMATIC_CURRENT_CONTROL)
273
   #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
291
   #error "AUTOMATIC_CURRENT_CONTROL is now MONITOR_DRIVER_STATUS. Please update your configuration."
274
 #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
292
 #elif defined(FILAMENT_CHANGE_LOAD_LENGTH)
974
  */
992
  */
975
 #if ENABLED(Z_SAFE_HOMING)
993
 #if ENABLED(Z_SAFE_HOMING)
976
   #if HAS_BED_PROBE
994
   #if HAS_BED_PROBE
977
-    static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X),
978
-      "Z_SAFE_HOMING_X_POINT is outside the probe region.");
979
-    static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y),
980
-      "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
995
+    static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, MIN_PROBE_X, MAX_PROBE_X), "Z_SAFE_HOMING_X_POINT is outside the probe region.");
996
+    static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, MIN_PROBE_Y, MAX_PROBE_Y), "Z_SAFE_HOMING_Y_POINT is outside the probe region.");
981
   #else
997
   #else
982
-    static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS),
983
-      "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle.");
984
-    static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS),
985
-      "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
998
+    static_assert(WITHIN(Z_SAFE_HOMING_X_POINT, X_MIN_POS, X_MAX_POS), "Z_SAFE_HOMING_X_POINT can't be reached by the nozzle.");
999
+    static_assert(WITHIN(Z_SAFE_HOMING_Y_POINT, Y_MIN_POS, Y_MAX_POS), "Z_SAFE_HOMING_Y_POINT can't be reached by the nozzle.");
986
   #endif
1000
   #endif
987
 #endif // Z_SAFE_HOMING
1001
 #endif // Z_SAFE_HOMING
988
 
1002
 
1458
 #endif
1472
 #endif
1459
 
1473
 
1460
 /**
1474
 /**
1461
- * Make sure HAVE_TMC26X is warranted
1475
+ * Check existing CS pins against enabled TMC SPI drivers.
1462
  */
1476
  */
1463
-#if ENABLED(HAVE_TMC26X) && !( \
1464
-         ENABLED(  X_IS_TMC26X ) \
1465
-      || ENABLED( X2_IS_TMC26X ) \
1466
-      || ENABLED(  Y_IS_TMC26X ) \
1467
-      || ENABLED( Y2_IS_TMC26X ) \
1468
-      || ENABLED(  Z_IS_TMC26X ) \
1469
-      || ENABLED( Z2_IS_TMC26X ) \
1470
-      || ENABLED( E0_IS_TMC26X ) \
1471
-      || ENABLED( E1_IS_TMC26X ) \
1472
-      || ENABLED( E2_IS_TMC26X ) \
1473
-      || ENABLED( E3_IS_TMC26X ) \
1474
-      || ENABLED( E4_IS_TMC26X ) \
1475
-  )
1476
-  #error "HAVE_TMC26X requires at least one TMC26X stepper to be set."
1477
-#endif
1478
-
1479
-/**
1480
- * Make sure HAVE_TMC2130 is warranted
1481
- */
1482
-#if ENABLED(HAVE_TMC2130)
1483
-  #if !( ENABLED(  X_IS_TMC2130 ) \
1484
-      || ENABLED( X2_IS_TMC2130 ) \
1485
-      || ENABLED(  Y_IS_TMC2130 ) \
1486
-      || ENABLED( Y2_IS_TMC2130 ) \
1487
-      || ENABLED(  Z_IS_TMC2130 ) \
1488
-      || ENABLED( Z2_IS_TMC2130 ) \
1489
-      || ENABLED( E0_IS_TMC2130 ) \
1490
-      || ENABLED( E1_IS_TMC2130 ) \
1491
-      || ENABLED( E2_IS_TMC2130 ) \
1492
-      || ENABLED( E3_IS_TMC2130 ) \
1493
-      || ENABLED( E4_IS_TMC2130 ) )
1494
-    #error "HAVE_TMC2130 requires at least one TMC2130 stepper to be set."
1495
-  #elif ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1496
-    #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1497
-  #endif
1498
-
1499
-  #if ENABLED(X_IS_TMC2130) && !PIN_EXISTS(X_CS)
1500
-    #error "X_CS_PIN is required for X_IS_TMC2130. Define X_CS_PIN in Configuration_adv.h."
1501
-  #elif ENABLED(X2_IS_TMC2130) && !PIN_EXISTS(X2_CS)
1502
-    #error "X2_CS_PIN is required for X2_IS_TMC2130. Define X2_CS_PIN in Configuration_adv.h."
1503
-  #elif ENABLED(Y_IS_TMC2130) && !PIN_EXISTS(Y_CS)
1504
-    #error "Y_CS_PIN is required for Y_IS_TMC2130. Define Y_CS_PIN in Configuration_adv.h."
1505
-  #elif ENABLED(Y2_IS_TMC2130) && !PIN_EXISTS(Y2_CS)
1506
-    #error "Y2_CS_PIN is required for Y2_IS_TMC2130. Define Y2_CS_PIN in Configuration_adv.h."
1507
-  #elif ENABLED(Z_IS_TMC2130) && !PIN_EXISTS(Z_CS)
1508
-    #error "Z_CS_PIN is required for Z_IS_TMC2130. Define Z_CS_PIN in Configuration_adv.h."
1509
-  #elif ENABLED(Z2_IS_TMC2130) && !PIN_EXISTS(Z2_CS)
1510
-    #error "Z2_CS_PIN is required for Z2_IS_TMC2130. Define Z2_CS_PIN in Configuration_adv.h."
1511
-  #elif ENABLED(E0_IS_TMC2130) && !PIN_EXISTS(E0_CS)
1512
-    #error "E0_CS_PIN is required for E0_IS_TMC2130. Define E0_CS_PIN in Configuration_adv.h."
1513
-  #elif ENABLED(E1_IS_TMC2130) && !PIN_EXISTS(E1_CS)
1514
-    #error "E1_CS_PIN is required for E1_IS_TMC2130. Define E1_CS_PIN in Configuration_adv.h."
1515
-  #elif ENABLED(E2_IS_TMC2130) && !PIN_EXISTS(E2_CS)
1516
-    #error "E2_CS_PIN is required for E2_IS_TMC2130. Define E2_CS_PIN in Configuration_adv.h."
1517
-  #elif ENABLED(E3_IS_TMC2130) && !PIN_EXISTS(E3_CS)
1518
-    #error "E3_CS_PIN is required for E3_IS_TMC2130. Define E3_CS_PIN in Configuration_adv.h."
1519
-  #elif ENABLED(E4_IS_TMC2130) && !PIN_EXISTS(E4_CS)
1520
-    #error "E4_CS_PIN is required for E4_IS_TMC2130. Define E4_CS_PIN in Configuration_adv.h."
1521
-  #endif
1522
-
1523
-  #if ENABLED(SENSORLESS_HOMING)
1524
-    // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
1525
-    // is necessary in order to reset the stallGuard indication between the initial movement of all three
1526
-    // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
1527
-    // clearing the stallGuard activated status is found.
1528
-    #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP)
1529
-      #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP."
1530
-    #elif X_SENSORLESS && X_HOME_DIR == -1 && (DISABLED(X_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMIN))
1531
-      #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
1532
-    #elif X_SENSORLESS && X_HOME_DIR ==  1 && (DISABLED(X_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMAX))
1533
-      #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX."
1534
-    #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (DISABLED(Y_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMIN))
1535
-      #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN."
1536
-    #elif Y_SENSORLESS && Y_HOME_DIR ==  1 && (DISABLED(Y_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMAX))
1537
-      #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX."
1538
-    #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (DISABLED(Z_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMIN))
1539
-      #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN."
1540
-    #elif Z_SENSORLESS && Z_HOME_DIR ==  1 && (DISABLED(Z_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMAX))
1541
-      #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX."
1542
-    #elif ENABLED(ENDSTOP_NOISE_FILTER)
1543
-      #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER."
1544
-    #endif
1545
-  #endif
1546
-
1547
-  // Sensorless homing is required for both combined steppers in an H-bot
1548
-  #if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
1549
-    #error "CoreXY requires both X and Y to use sensorless homing if either does."
1550
-  #elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
1551
-    #error "CoreXZ requires both X and Z to use sensorless homing if either does."
1552
-  #elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
1553
-    #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
1554
-  #endif
1555
-
1556
-#elif ENABLED(SENSORLESS_HOMING)
1557
-
1558
-  #error "SENSORLESS_HOMING requires TMC2130 stepper drivers."
1559
-
1560
-#endif
1561
-
1562
-/**
1563
- * Make sure HAVE_TMC2208 is warranted
1564
- */
1565
-#if ENABLED(HAVE_TMC2208) && !( \
1566
-       ENABLED(  X_IS_TMC2208 ) \
1567
-    || ENABLED( X2_IS_TMC2208 ) \
1568
-    || ENABLED(  Y_IS_TMC2208 ) \
1569
-    || ENABLED( Y2_IS_TMC2208 ) \
1570
-    || ENABLED(  Z_IS_TMC2208 ) \
1571
-    || ENABLED( Z2_IS_TMC2208 ) \
1572
-    || ENABLED( E0_IS_TMC2208 ) \
1573
-    || ENABLED( E1_IS_TMC2208 ) \
1574
-    || ENABLED( E2_IS_TMC2208 ) \
1575
-    || ENABLED( E3_IS_TMC2208 ) )
1576
-  #error "HAVE_TMC2208 requires at least one TMC2208 stepper to be set."
1477
+#if AXIS_DRIVER_TYPE(X, TMC2130) && !PIN_EXISTS(X_CS)
1478
+  #error "X_CS_PIN is required for TMC2130. Define X_CS_PIN in Configuration_adv.h."
1479
+#elif AXIS_DRIVER_TYPE(X2, TMC2130) && !PIN_EXISTS(X2_CS)
1480
+  #error "X2_CS_PIN is required for X2. Define X2_CS_PIN in Configuration_adv.h."
1481
+#elif AXIS_DRIVER_TYPE(Y, TMC2130) && !PIN_EXISTS(Y_CS)
1482
+  #error "Y_CS_PIN is required for TMC2130. Define Y_CS_PIN in Configuration_adv.h."
1483
+#elif AXIS_DRIVER_TYPE(Y2, TMC2130) && !PIN_EXISTS(Y2_CS)
1484
+  #error "Y2_CS_PIN is required for TMC2130. Define Y2_CS_PIN in Configuration_adv.h."
1485
+#elif AXIS_DRIVER_TYPE(Z, TMC2130) && !PIN_EXISTS(Z_CS)
1486
+  #error "Z_CS_PIN is required for TMC2130. Define Z_CS_PIN in Configuration_adv.h."
1487
+#elif AXIS_DRIVER_TYPE(Z2, TMC2130) && !PIN_EXISTS(Z2_CS)
1488
+  #error "Z2_CS_PIN is required for TMC2130. Define Z2_CS_PIN in Configuration_adv.h."
1489
+#elif AXIS_DRIVER_TYPE(E0, TMC2130) && !PIN_EXISTS(E0_CS)
1490
+  #error "E0_CS_PIN is required for TMC2130. Define E0_CS_PIN in Configuration_adv.h."
1491
+#elif AXIS_DRIVER_TYPE(E1, TMC2130) && !PIN_EXISTS(E1_CS)
1492
+  #error "E1_CS_PIN is required for TMC2130. Define E1_CS_PIN in Configuration_adv.h."
1493
+#elif AXIS_DRIVER_TYPE(E2, TMC2130) && !PIN_EXISTS(E2_CS)
1494
+  #error "E2_CS_PIN is required for TMC2130. Define E2_CS_PIN in Configuration_adv.h."
1495
+#elif AXIS_DRIVER_TYPE(E3, TMC2130) && !PIN_EXISTS(E3_CS)
1496
+  #error "E3_CS_PIN is required for TMC2130. Define E3_CS_PIN in Configuration_adv.h."
1497
+#elif AXIS_DRIVER_TYPE(E4, TMC2130) && !PIN_EXISTS(E4_CS)
1498
+  #error "E4_CS_PIN is required for TMC2130. Define E4_CS_PIN in Configuration_adv.h."
1577
 #endif
1499
 #endif
1578
 
1500
 
1579
 /**
1501
 /**
1580
  * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
1502
  * TMC2208 software UART and ENDSTOP_INTERRUPTS both use pin change interrupts (PCI)
1581
  */
1503
  */
1582
-#if ENABLED(HAVE_TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
1504
+#if HAS_DRIVER(TMC2208) && ENABLED(ENDSTOP_INTERRUPTS_FEATURE) && !( \
1583
        defined(X_HARDWARE_SERIAL ) \
1505
        defined(X_HARDWARE_SERIAL ) \
1584
     || defined(X2_HARDWARE_SERIAL) \
1506
     || defined(X2_HARDWARE_SERIAL) \
1585
     || defined(Y_HARDWARE_SERIAL ) \
1507
     || defined(Y_HARDWARE_SERIAL ) \
1594
   #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
1516
   #error "select hardware UART for TMC2208 to use both TMC2208 and ENDSTOP_INTERRUPTS_FEATURE."
1595
 #endif
1517
 #endif
1596
 
1518
 
1597
-#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1598
-  #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1599
-#endif
1600
-
1601
-#if ENABLED(TMC_Z_CALIBRATION) && !Z_IS_TRINAMIC && !Z2_IS_TRINAMIC
1602
-  #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis"
1519
+#if ENABLED(SENSORLESS_HOMING)
1520
+  // Require STEALTHCHOP for SENSORLESS_HOMING on DELTA as the transition from spreadCycle to stealthChop
1521
+  // is necessary in order to reset the stallGuard indication between the initial movement of all three
1522
+  // towers to +Z and the individual homing of each tower. This restriction can be removed once a means of
1523
+  // clearing the stallGuard activated status is found.
1524
+  #if ENABLED(DELTA) && !ENABLED(STEALTHCHOP)
1525
+    #error "SENSORLESS_HOMING on DELTA currently requires STEALTHCHOP."
1526
+  #elif X_SENSORLESS && X_HOME_DIR == -1 && (DISABLED(X_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMIN))
1527
+    #error "SENSORLESS_HOMING requires X_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMIN when homing to X_MIN."
1528
+  #elif X_SENSORLESS && X_HOME_DIR ==  1 && (DISABLED(X_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_XMAX))
1529
+    #error "SENSORLESS_HOMING requires X_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_XMAX when homing to X_MAX."
1530
+  #elif Y_SENSORLESS && Y_HOME_DIR == -1 && (DISABLED(Y_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMIN))
1531
+    #error "SENSORLESS_HOMING requires Y_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMIN when homing to Y_MIN."
1532
+  #elif Y_SENSORLESS && Y_HOME_DIR ==  1 && (DISABLED(Y_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_YMAX))
1533
+    #error "SENSORLESS_HOMING requires Y_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_YMAX when homing to Y_MAX."
1534
+  #elif Z_SENSORLESS && Z_HOME_DIR == -1 && (DISABLED(Z_MIN_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMIN))
1535
+    #error "SENSORLESS_HOMING requires Z_MIN_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMIN when homing to Z_MIN."
1536
+  #elif Z_SENSORLESS && Z_HOME_DIR ==  1 && (DISABLED(Z_MAX_ENDSTOP_INVERTING) || DISABLED(ENDSTOPPULLUP_ZMAX))
1537
+    #error "SENSORLESS_HOMING requires Z_MAX_ENDSTOP_INVERTING and ENDSTOPPULLUP_ZMAX when homing to Z_MAX."
1538
+  #elif ENABLED(ENDSTOP_NOISE_FILTER)
1539
+    #error "SENSORLESS_HOMING is incompatible with ENDSTOP_NOISE_FILTER."
1540
+  #endif
1603
 #endif
1541
 #endif
1604
 
1542
 
1605
-/**
1606
- * Make sure HAVE_L6470DRIVER is warranted
1607
- */
1608
-#if ENABLED(HAVE_L6470DRIVER) && !( \
1609
-         ENABLED(  X_IS_L6470 ) \
1610
-      || ENABLED( X2_IS_L6470 ) \
1611
-      || ENABLED(  Y_IS_L6470 ) \
1612
-      || ENABLED( Y2_IS_L6470 ) \
1613
-      || ENABLED(  Z_IS_L6470 ) \
1614
-      || ENABLED( Z2_IS_L6470 ) \
1615
-      || ENABLED( E0_IS_L6470 ) \
1616
-      || ENABLED( E1_IS_L6470 ) \
1617
-      || ENABLED( E2_IS_L6470 ) \
1618
-      || ENABLED( E3_IS_L6470 ) \
1619
-      || ENABLED( E4_IS_L6470 ) \
1620
-  )
1621
-  #error "HAVE_L6470DRIVER requires at least one L6470 stepper to be set."
1543
+// Sensorless homing is required for both combined steppers in an H-bot
1544
+#if CORE_IS_XY && X_SENSORLESS != Y_SENSORLESS
1545
+  #error "CoreXY requires both X and Y to use sensorless homing if either does."
1546
+#elif CORE_IS_XZ && X_SENSORLESS != Z_SENSORLESS
1547
+  #error "CoreXZ requires both X and Z to use sensorless homing if either does."
1548
+#elif CORE_IS_YZ && Y_SENSORLESS != Z_SENSORLESS
1549
+  #error "CoreYZ requires both Y and Z to use sensorless homing if either does."
1622
 #endif
1550
 #endif
1623
 
1551
 
1624
-/**
1625
- * Check that each axis has only one driver selected
1626
- */
1627
-#if 1 < 0 \
1628
-  + ENABLED(X_IS_TMC26X) \
1629
-  + ENABLED(X_IS_TMC2130) \
1630
-  + ENABLED(X_IS_TMC2208) \
1631
-  + ENABLED(X_IS_L6470)
1632
-  #error "Please enable only one stepper driver for the X axis."
1633
-#endif
1634
-#if 1 < 0 \
1635
-  + ENABLED(X2_IS_TMC26X) \
1636
-  + ENABLED(X2_IS_TMC2130) \
1637
-  + ENABLED(X2_IS_TMC2208) \
1638
-  + ENABLED(X2_IS_L6470)
1639
-  #error "Please enable only one stepper driver for the X2 axis."
1640
-#endif
1641
-#if 1 < 0 \
1642
-  + ENABLED(Y_IS_TMC26X) \
1643
-  + ENABLED(Y_IS_TMC2130) \
1644
-  + ENABLED(Y_IS_TMC2208) \
1645
-  + ENABLED(Y_IS_L6470)
1646
-  #error "Please enable only one stepper driver for the Y axis."
1647
-#endif
1648
-#if 1 < 0 \
1649
-  + ENABLED(Y2_IS_TMC26X) \
1650
-  + ENABLED(Y2_IS_TMC2130) \
1651
-  + ENABLED(Y2_IS_TMC2208) \
1652
-  + ENABLED(Y2_IS_L6470)
1653
-  #error "Please enable only one stepper driver for the Y2 axis."
1654
-#endif
1655
-#if 1 < 0 \
1656
-  + ENABLED(Z_IS_TMC26X) \
1657
-  + ENABLED(Z_IS_TMC2130) \
1658
-  + ENABLED(Z_IS_TMC2208) \
1659
-  + ENABLED(Z_IS_L6470)
1660
-  #error "Please enable only one stepper driver for the Z axis."
1661
-#endif
1662
-#if 1 < 0 \
1663
-  + ENABLED(Z2_IS_TMC26X) \
1664
-  + ENABLED(Z2_IS_TMC2130) \
1665
-  + ENABLED(Z2_IS_TMC2208) \
1666
-  + ENABLED(Z2_IS_L6470)
1667
-  #error "Please enable only one stepper driver for the Z2 axis."
1668
-#endif
1669
-#if 1 < 0 \
1670
-  + ENABLED(E0_IS_TMC26X) \
1671
-  + ENABLED(E0_IS_TMC2130) \
1672
-  + ENABLED(E0_IS_TMC2208) \
1673
-  + ENABLED(E0_IS_L6470)
1674
-  #error "Please enable only one stepper driver for the E0 axis."
1675
-#endif
1676
-#if 1 < 0 \
1677
-  + ENABLED(E1_IS_TMC26X) \
1678
-  + ENABLED(E1_IS_TMC2130) \
1679
-  + ENABLED(E1_IS_TMC2208) \
1680
-  + ENABLED(E1_IS_L6470)
1681
-  #error "Please enable only one stepper driver for the E1 axis."
1682
-#endif
1683
-#if 1 < 0 \
1684
-  + ENABLED(E2_IS_TMC26X) \
1685
-  + ENABLED(E2_IS_TMC2130) \
1686
-  + ENABLED(E2_IS_TMC2208) \
1687
-  + ENABLED(E2_IS_L6470)
1688
-  #error "Please enable only one stepper driver for the E2 axis."
1552
+#if ENABLED(HYBRID_THRESHOLD) && DISABLED(STEALTHCHOP)
1553
+  #error "Enable STEALTHCHOP to use HYBRID_THRESHOLD."
1689
 #endif
1554
 #endif
1690
-#if 1 < 0 \
1691
-  + ENABLED(E3_IS_TMC26X) \
1692
-  + ENABLED(E3_IS_TMC2130) \
1693
-  + ENABLED(E3_IS_TMC2208) \
1694
-  + ENABLED(E3_IS_L6470)
1695
-  #error "Please enable only one stepper driver for the E3 axis."
1555
+#if ENABLED(TMC_Z_CALIBRATION) && !AXIS_IS_TMC(Z) && !AXIS_IS_TMC(Z2)
1556
+  #error "TMC_Z_CALIBRATION requires at least one TMC driver on Z axis"
1696
 #endif
1557
 #endif
1697
-#if 1 < 0 \
1698
-  + ENABLED(E4_IS_TMC26X) \
1699
-  + ENABLED(E4_IS_TMC2130) \
1700
-  + ENABLED(E4_IS_TMC2208) \
1701
-  + ENABLED(E4_IS_L6470)
1702
-  #error "Please enable only one stepper driver for the E4 axis."
1558
+
1559
+#if ENABLED(SENSORLESS_HOMING) && !HAS_STALLGUARD
1560
+  #error "SENSORLESS_HOMING requires TMC2130 or TMC2660 stepper drivers."
1703
 #endif
1561
 #endif
1562
+#if ENABLED(STEALTHCHOP) && !HAS_STEALTHCHOP
1563
+  #error "STEALTHCHOP requires TMC2130 or TMC2208 stepper drivers."
1564
+ #endif
1704
 
1565
 
1705
 /**
1566
 /**
1706
  * Digipot requirement
1567
  * Digipot requirement

+ 91
- 94
Marlin/src/module/configuration_store.cpp View File

681
 
681
 
682
     uint16_t tmc_stepper_current[TMC_AXES] = {
682
     uint16_t tmc_stepper_current[TMC_AXES] = {
683
       #if HAS_TRINAMIC
683
       #if HAS_TRINAMIC
684
-        #if X_IS_TRINAMIC
684
+        #if AXIS_IS_TMC(X)
685
           stepperX.getCurrent(),
685
           stepperX.getCurrent(),
686
         #else
686
         #else
687
           0,
687
           0,
688
         #endif
688
         #endif
689
-        #if Y_IS_TRINAMIC
689
+        #if AXIS_IS_TMC(Y)
690
           stepperY.getCurrent(),
690
           stepperY.getCurrent(),
691
         #else
691
         #else
692
           0,
692
           0,
693
         #endif
693
         #endif
694
-        #if Z_IS_TRINAMIC
694
+        #if AXIS_IS_TMC(Z)
695
           stepperZ.getCurrent(),
695
           stepperZ.getCurrent(),
696
         #else
696
         #else
697
           0,
697
           0,
698
         #endif
698
         #endif
699
-        #if X2_IS_TRINAMIC
699
+        #if AXIS_IS_TMC(X2)
700
           stepperX2.getCurrent(),
700
           stepperX2.getCurrent(),
701
         #else
701
         #else
702
           0,
702
           0,
703
         #endif
703
         #endif
704
-        #if Y2_IS_TRINAMIC
704
+        #if AXIS_IS_TMC(Y2)
705
           stepperY2.getCurrent(),
705
           stepperY2.getCurrent(),
706
         #else
706
         #else
707
           0,
707
           0,
708
         #endif
708
         #endif
709
-        #if Z2_IS_TRINAMIC
709
+        #if AXIS_IS_TMC(Z2)
710
           stepperZ2.getCurrent(),
710
           stepperZ2.getCurrent(),
711
         #else
711
         #else
712
           0,
712
           0,
713
         #endif
713
         #endif
714
-        #if E0_IS_TRINAMIC
714
+        #if AXIS_IS_TMC(E0)
715
           stepperE0.getCurrent(),
715
           stepperE0.getCurrent(),
716
         #else
716
         #else
717
           0,
717
           0,
718
         #endif
718
         #endif
719
-        #if E1_IS_TRINAMIC
719
+        #if AXIS_IS_TMC(E1)
720
           stepperE1.getCurrent(),
720
           stepperE1.getCurrent(),
721
         #else
721
         #else
722
           0,
722
           0,
723
         #endif
723
         #endif
724
-        #if E2_IS_TRINAMIC
724
+        #if AXIS_IS_TMC(E2)
725
           stepperE2.getCurrent(),
725
           stepperE2.getCurrent(),
726
         #else
726
         #else
727
           0,
727
           0,
728
         #endif
728
         #endif
729
-        #if E3_IS_TRINAMIC
729
+        #if AXIS_IS_TMC(E3)
730
           stepperE3.getCurrent(),
730
           stepperE3.getCurrent(),
731
         #else
731
         #else
732
           0,
732
           0,
733
         #endif
733
         #endif
734
-        #if E4_IS_TRINAMIC
734
+        #if AXIS_IS_TMC(E4)
735
           stepperE4.getCurrent()
735
           stepperE4.getCurrent()
736
         #else
736
         #else
737
           0
737
           0
750
 
750
 
751
     uint32_t tmc_hybrid_threshold[TMC_AXES] = {
751
     uint32_t tmc_hybrid_threshold[TMC_AXES] = {
752
       #if ENABLED(HYBRID_THRESHOLD)
752
       #if ENABLED(HYBRID_THRESHOLD)
753
-        #if X_IS_TRINAMIC
753
+        #if AXIS_HAS_STEALTHCHOP(X)
754
           TMC_GET_PWMTHRS(X, X),
754
           TMC_GET_PWMTHRS(X, X),
755
         #else
755
         #else
756
           X_HYBRID_THRESHOLD,
756
           X_HYBRID_THRESHOLD,
757
         #endif
757
         #endif
758
-        #if Y_IS_TRINAMIC
758
+        #if AXIS_HAS_STEALTHCHOP(Y)
759
           TMC_GET_PWMTHRS(Y, Y),
759
           TMC_GET_PWMTHRS(Y, Y),
760
         #else
760
         #else
761
           Y_HYBRID_THRESHOLD,
761
           Y_HYBRID_THRESHOLD,
762
         #endif
762
         #endif
763
-        #if Z_IS_TRINAMIC
763
+        #if AXIS_HAS_STEALTHCHOP(Z)
764
           TMC_GET_PWMTHRS(Z, Z),
764
           TMC_GET_PWMTHRS(Z, Z),
765
         #else
765
         #else
766
           Z_HYBRID_THRESHOLD,
766
           Z_HYBRID_THRESHOLD,
767
         #endif
767
         #endif
768
-        #if X2_IS_TRINAMIC
768
+        #if AXIS_HAS_STEALTHCHOP(X2)
769
           TMC_GET_PWMTHRS(X, X2),
769
           TMC_GET_PWMTHRS(X, X2),
770
         #else
770
         #else
771
           X2_HYBRID_THRESHOLD,
771
           X2_HYBRID_THRESHOLD,
772
         #endif
772
         #endif
773
-        #if Y2_IS_TRINAMIC
773
+        #if AXIS_HAS_STEALTHCHOP(Y2)
774
           TMC_GET_PWMTHRS(Y, Y2),
774
           TMC_GET_PWMTHRS(Y, Y2),
775
         #else
775
         #else
776
           Y2_HYBRID_THRESHOLD,
776
           Y2_HYBRID_THRESHOLD,
777
         #endif
777
         #endif
778
-        #if Z2_IS_TRINAMIC
778
+        #if AXIS_HAS_STEALTHCHOP(Z2)
779
           TMC_GET_PWMTHRS(Z, Z2),
779
           TMC_GET_PWMTHRS(Z, Z2),
780
         #else
780
         #else
781
           Z2_HYBRID_THRESHOLD,
781
           Z2_HYBRID_THRESHOLD,
782
         #endif
782
         #endif
783
-        #if E0_IS_TRINAMIC
783
+        #if AXIS_HAS_STEALTHCHOP(E0)
784
           TMC_GET_PWMTHRS(E, E0),
784
           TMC_GET_PWMTHRS(E, E0),
785
         #else
785
         #else
786
           E0_HYBRID_THRESHOLD,
786
           E0_HYBRID_THRESHOLD,
787
         #endif
787
         #endif
788
-        #if E1_IS_TRINAMIC
788
+        #if AXIS_HAS_STEALTHCHOP(E1)
789
           TMC_GET_PWMTHRS(E, E1),
789
           TMC_GET_PWMTHRS(E, E1),
790
         #else
790
         #else
791
           E1_HYBRID_THRESHOLD,
791
           E1_HYBRID_THRESHOLD,
792
         #endif
792
         #endif
793
-        #if E2_IS_TRINAMIC
793
+        #if AXIS_HAS_STEALTHCHOP(E2)
794
           TMC_GET_PWMTHRS(E, E2),
794
           TMC_GET_PWMTHRS(E, E2),
795
         #else
795
         #else
796
           E2_HYBRID_THRESHOLD,
796
           E2_HYBRID_THRESHOLD,
797
         #endif
797
         #endif
798
-        #if E3_IS_TRINAMIC
798
+        #if AXIS_HAS_STEALTHCHOP(E3)
799
           TMC_GET_PWMTHRS(E, E3),
799
           TMC_GET_PWMTHRS(E, E3),
800
         #else
800
         #else
801
           E3_HYBRID_THRESHOLD,
801
           E3_HYBRID_THRESHOLD,
802
         #endif
802
         #endif
803
-        #if E4_IS_TRINAMIC
803
+        #if AXIS_HAS_STEALTHCHOP(E4)
804
           TMC_GET_PWMTHRS(E, E4)
804
           TMC_GET_PWMTHRS(E, E4)
805
         #else
805
         #else
806
           E4_HYBRID_THRESHOLD
806
           E4_HYBRID_THRESHOLD
818
     //
818
     //
819
     int16_t tmc_sgt[XYZ] = {
819
     int16_t tmc_sgt[XYZ] = {
820
       #if ENABLED(SENSORLESS_HOMING)
820
       #if ENABLED(SENSORLESS_HOMING)
821
-        #if defined(X_HOMING_SENSITIVITY) && (ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS))
821
+        #if X_SENSORLESS
822
           stepperX.sgt(),
822
           stepperX.sgt(),
823
         #else
823
         #else
824
           0,
824
           0,
825
         #endif
825
         #endif
826
-        #if defined(Y_HOMING_SENSITIVITY) && (ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS))
826
+        #if Y_SENSORLESS
827
           stepperY.sgt(),
827
           stepperY.sgt(),
828
         #else
828
         #else
829
           0,
829
           0,
830
         #endif
830
         #endif
831
-        #if defined(Z_HOMING_SENSITIVITY) && (ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS))
831
+        #if Z_SENSORLESS
832
           stepperZ.sgt()
832
           stepperZ.sgt()
833
         #else
833
         #else
834
           0
834
           0
1311
         uint16_t currents[TMC_AXES];
1311
         uint16_t currents[TMC_AXES];
1312
         EEPROM_READ(currents);
1312
         EEPROM_READ(currents);
1313
         if (!validating) {
1313
         if (!validating) {
1314
-          #if X_IS_TRINAMIC
1314
+          #if AXIS_IS_TMC(X)
1315
             SET_CURR(X);
1315
             SET_CURR(X);
1316
           #endif
1316
           #endif
1317
-          #if Y_IS_TRINAMIC
1317
+          #if AXIS_IS_TMC(Y)
1318
             SET_CURR(Y);
1318
             SET_CURR(Y);
1319
           #endif
1319
           #endif
1320
-          #if Z_IS_TRINAMIC
1320
+          #if AXIS_IS_TMC(Z)
1321
             SET_CURR(Z);
1321
             SET_CURR(Z);
1322
           #endif
1322
           #endif
1323
-          #if X2_IS_TRINAMIC
1323
+          #if AXIS_IS_TMC(X2)
1324
             SET_CURR(X2);
1324
             SET_CURR(X2);
1325
           #endif
1325
           #endif
1326
-          #if Y2_IS_TRINAMIC
1326
+          #if AXIS_IS_TMC(Y2)
1327
             SET_CURR(Y2);
1327
             SET_CURR(Y2);
1328
           #endif
1328
           #endif
1329
-          #if Z2_IS_TRINAMIC
1329
+          #if AXIS_IS_TMC(Z2)
1330
             SET_CURR(Z2);
1330
             SET_CURR(Z2);
1331
           #endif
1331
           #endif
1332
-          #if E0_IS_TRINAMIC
1332
+          #if AXIS_IS_TMC(E0)
1333
             SET_CURR(E0);
1333
             SET_CURR(E0);
1334
           #endif
1334
           #endif
1335
-          #if E1_IS_TRINAMIC
1335
+          #if AXIS_IS_TMC(E1)
1336
             SET_CURR(E1);
1336
             SET_CURR(E1);
1337
           #endif
1337
           #endif
1338
-          #if E2_IS_TRINAMIC
1338
+          #if AXIS_IS_TMC(E2)
1339
             SET_CURR(E2);
1339
             SET_CURR(E2);
1340
           #endif
1340
           #endif
1341
-          #if E3_IS_TRINAMIC
1341
+          #if AXIS_IS_TMC(E3)
1342
             SET_CURR(E3);
1342
             SET_CURR(E3);
1343
           #endif
1343
           #endif
1344
-          #if E4_IS_TRINAMIC
1344
+          #if AXIS_IS_TMC(E4)
1345
             SET_CURR(E4);
1345
             SET_CURR(E4);
1346
           #endif
1346
           #endif
1347
         }
1347
         }
1355
         uint32_t tmc_hybrid_threshold[TMC_AXES];
1355
         uint32_t tmc_hybrid_threshold[TMC_AXES];
1356
         EEPROM_READ(tmc_hybrid_threshold);
1356
         EEPROM_READ(tmc_hybrid_threshold);
1357
         if (!validating) {
1357
         if (!validating) {
1358
-          #if X_IS_TRINAMIC
1358
+          #if AXIS_HAS_STEALTHCHOP(X)
1359
             TMC_SET_PWMTHRS(X, X);
1359
             TMC_SET_PWMTHRS(X, X);
1360
           #endif
1360
           #endif
1361
-          #if Y_IS_TRINAMIC
1361
+          #if AXIS_HAS_STEALTHCHOP(Y)
1362
             TMC_SET_PWMTHRS(Y, Y);
1362
             TMC_SET_PWMTHRS(Y, Y);
1363
           #endif
1363
           #endif
1364
-          #if Z_IS_TRINAMIC
1364
+          #if AXIS_HAS_STEALTHCHOP(Z)
1365
             TMC_SET_PWMTHRS(Z, Z);
1365
             TMC_SET_PWMTHRS(Z, Z);
1366
           #endif
1366
           #endif
1367
-          #if X2_IS_TRINAMIC
1367
+          #if AXIS_HAS_STEALTHCHOP(X2)
1368
             TMC_SET_PWMTHRS(X, X2);
1368
             TMC_SET_PWMTHRS(X, X2);
1369
           #endif
1369
           #endif
1370
-          #if Y2_IS_TRINAMIC
1370
+          #if AXIS_HAS_STEALTHCHOP(Y2)
1371
             TMC_SET_PWMTHRS(Y, Y2);
1371
             TMC_SET_PWMTHRS(Y, Y2);
1372
           #endif
1372
           #endif
1373
-          #if Z2_IS_TRINAMIC
1373
+          #if AXIS_HAS_STEALTHCHOP(Z2)
1374
             TMC_SET_PWMTHRS(Z, Z2);
1374
             TMC_SET_PWMTHRS(Z, Z2);
1375
           #endif
1375
           #endif
1376
-          #if E0_IS_TRINAMIC
1376
+          #if AXIS_HAS_STEALTHCHOP(E0)
1377
             TMC_SET_PWMTHRS(E, E0);
1377
             TMC_SET_PWMTHRS(E, E0);
1378
           #endif
1378
           #endif
1379
-          #if E1_IS_TRINAMIC
1379
+          #if AXIS_HAS_STEALTHCHOP(E1)
1380
             TMC_SET_PWMTHRS(E, E1);
1380
             TMC_SET_PWMTHRS(E, E1);
1381
           #endif
1381
           #endif
1382
-          #if E2_IS_TRINAMIC
1382
+          #if AXIS_HAS_STEALTHCHOP(E2)
1383
             TMC_SET_PWMTHRS(E, E2);
1383
             TMC_SET_PWMTHRS(E, E2);
1384
           #endif
1384
           #endif
1385
-          #if E3_IS_TRINAMIC
1385
+          #if AXIS_HAS_STEALTHCHOP(E3)
1386
             TMC_SET_PWMTHRS(E, E3);
1386
             TMC_SET_PWMTHRS(E, E3);
1387
           #endif
1387
           #endif
1388
-          #if E4_IS_TRINAMIC
1388
+          #if AXIS_HAS_STEALTHCHOP(E4)
1389
             TMC_SET_PWMTHRS(E, E4);
1389
             TMC_SET_PWMTHRS(E, E4);
1390
           #endif
1390
           #endif
1391
         }
1391
         }
1405
       #if ENABLED(SENSORLESS_HOMING)
1405
       #if ENABLED(SENSORLESS_HOMING)
1406
         if (!validating) {
1406
         if (!validating) {
1407
           #ifdef X_HOMING_SENSITIVITY
1407
           #ifdef X_HOMING_SENSITIVITY
1408
-            #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
1408
+            #if AXIS_HAS_STALLGUARD(X)
1409
               stepperX.sgt(tmc_sgt[0]);
1409
               stepperX.sgt(tmc_sgt[0]);
1410
             #endif
1410
             #endif
1411
-            #if ENABLED(X2_IS_TMC2130)
1411
+            #if AXIS_HAS_STALLGUARD(X2)
1412
               stepperX2.sgt(tmc_sgt[0]);
1412
               stepperX2.sgt(tmc_sgt[0]);
1413
             #endif
1413
             #endif
1414
           #endif
1414
           #endif
1415
           #ifdef Y_HOMING_SENSITIVITY
1415
           #ifdef Y_HOMING_SENSITIVITY
1416
-            #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
1416
+            #if AXIS_HAS_STALLGUARD(Y)
1417
               stepperY.sgt(tmc_sgt[1]);
1417
               stepperY.sgt(tmc_sgt[1]);
1418
             #endif
1418
             #endif
1419
-            #if ENABLED(Y2_IS_TMC2130)
1419
+            #if AXIS_HAS_STALLGUARD(Y2)
1420
               stepperY2.sgt(tmc_sgt[1]);
1420
               stepperY2.sgt(tmc_sgt[1]);
1421
             #endif
1421
             #endif
1422
           #endif
1422
           #endif
1423
           #ifdef Z_HOMING_SENSITIVITY
1423
           #ifdef Z_HOMING_SENSITIVITY
1424
-            #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
1424
+            #if AXIS_HAS_STALLGUARD(Z)
1425
               stepperZ.sgt(tmc_sgt[2]);
1425
               stepperZ.sgt(tmc_sgt[2]);
1426
             #endif
1426
             #endif
1427
-            #if ENABLED(Z2_IS_TMC2130)
1427
+            #if AXIS_HAS_STALLGUARD(Z2)
1428
               stepperZ2.sgt(tmc_sgt[2]);
1428
               stepperZ2.sgt(tmc_sgt[2]);
1429
             #endif
1429
             #endif
1430
           #endif
1430
           #endif
2445
     #if HAS_TRINAMIC
2445
     #if HAS_TRINAMIC
2446
 
2446
 
2447
       /**
2447
       /**
2448
-       * TMC2130 / TMC2208 / TRAMS stepper driver current
2448
+       * TMC2130 / TMC2208 stepper driver current
2449
        */
2449
        */
2450
       if (!forReplay) {
2450
       if (!forReplay) {
2451
         CONFIG_ECHO_START;
2451
         CONFIG_ECHO_START;
2452
         SERIAL_ECHOLNPGM_P(port, "Stepper driver current:");
2452
         SERIAL_ECHOLNPGM_P(port, "Stepper driver current:");
2453
       }
2453
       }
2454
       CONFIG_ECHO_START;
2454
       CONFIG_ECHO_START;
2455
-      #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
2455
+      #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
2456
         say_M906(PORTVAR_SOLO);
2456
         say_M906(PORTVAR_SOLO);
2457
       #endif
2457
       #endif
2458
-      #if X_IS_TRINAMIC
2458
+      #if AXIS_IS_TMC(X)
2459
         SERIAL_ECHOPAIR_P(port, " X", stepperX.getCurrent());
2459
         SERIAL_ECHOPAIR_P(port, " X", stepperX.getCurrent());
2460
       #endif
2460
       #endif
2461
-      #if Y_IS_TRINAMIC
2461
+      #if AXIS_IS_TMC(Y)
2462
         SERIAL_ECHOPAIR_P(port, " Y", stepperY.getCurrent());
2462
         SERIAL_ECHOPAIR_P(port, " Y", stepperY.getCurrent());
2463
       #endif
2463
       #endif
2464
-      #if Z_IS_TRINAMIC
2464
+      #if AXIS_IS_TMC(Z)
2465
         SERIAL_ECHOPAIR_P(port, " Z", stepperZ.getCurrent());
2465
         SERIAL_ECHOPAIR_P(port, " Z", stepperZ.getCurrent());
2466
       #endif
2466
       #endif
2467
-      #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
2467
+      #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
2468
         SERIAL_EOL_P(port);
2468
         SERIAL_EOL_P(port);
2469
       #endif
2469
       #endif
2470
-      #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
2470
+      #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
2471
         say_M906(PORTVAR_SOLO);
2471
         say_M906(PORTVAR_SOLO);
2472
         SERIAL_ECHOPGM_P(port, " I1");
2472
         SERIAL_ECHOPGM_P(port, " I1");
2473
       #endif
2473
       #endif
2474
-      #if X2_IS_TRINAMIC
2474
+      #if AXIS_IS_TMC(X2)
2475
         SERIAL_ECHOPAIR_P(port, " X", stepperX2.getCurrent());
2475
         SERIAL_ECHOPAIR_P(port, " X", stepperX2.getCurrent());
2476
       #endif
2476
       #endif
2477
-      #if Y2_IS_TRINAMIC
2477
+      #if AXIS_IS_TMC(Y2)
2478
         SERIAL_ECHOPAIR_P(port, " Y", stepperY2.getCurrent());
2478
         SERIAL_ECHOPAIR_P(port, " Y", stepperY2.getCurrent());
2479
       #endif
2479
       #endif
2480
-      #if Z2_IS_TRINAMIC
2480
+      #if AXIS_IS_TMC(Z2)
2481
         SERIAL_ECHOPAIR_P(port, " Z", stepperZ2.getCurrent());
2481
         SERIAL_ECHOPAIR_P(port, " Z", stepperZ2.getCurrent());
2482
       #endif
2482
       #endif
2483
-      #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
2483
+      #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
2484
         SERIAL_EOL_P(port);
2484
         SERIAL_EOL_P(port);
2485
       #endif
2485
       #endif
2486
-      #if E0_IS_TRINAMIC
2486
+      #if AXIS_IS_TMC(E0)
2487
         say_M906(PORTVAR_SOLO);
2487
         say_M906(PORTVAR_SOLO);
2488
         SERIAL_ECHOLNPAIR_P(port, " T0 E", stepperE0.getCurrent());
2488
         SERIAL_ECHOLNPAIR_P(port, " T0 E", stepperE0.getCurrent());
2489
       #endif
2489
       #endif
2490
-      #if E_STEPPERS > 1 && E1_IS_TRINAMIC
2490
+      #if E_STEPPERS > 1 && AXIS_IS_TMC(E1)
2491
         say_M906(PORTVAR_SOLO);
2491
         say_M906(PORTVAR_SOLO);
2492
         SERIAL_ECHOLNPAIR_P(port, " T1 E", stepperE1.getCurrent());
2492
         SERIAL_ECHOLNPAIR_P(port, " T1 E", stepperE1.getCurrent());
2493
       #endif
2493
       #endif
2494
-      #if E_STEPPERS > 2 && E2_IS_TRINAMIC
2494
+      #if E_STEPPERS > 2 && AXIS_IS_TMC(E2)
2495
         say_M906(PORTVAR_SOLO);
2495
         say_M906(PORTVAR_SOLO);
2496
         SERIAL_ECHOLNPAIR_P(port, " T2 E", stepperE2.getCurrent());
2496
         SERIAL_ECHOLNPAIR_P(port, " T2 E", stepperE2.getCurrent());
2497
       #endif
2497
       #endif
2498
-      #if E_STEPPERS > 3 && E3_IS_TRINAMIC
2498
+      #if E_STEPPERS > 3 && AXIS_IS_TMC(E3)
2499
         say_M906(PORTVAR_SOLO);
2499
         say_M906(PORTVAR_SOLO);
2500
         SERIAL_ECHOLNPAIR_P(port, " T3 E", stepperE3.getCurrent());
2500
         SERIAL_ECHOLNPAIR_P(port, " T3 E", stepperE3.getCurrent());
2501
       #endif
2501
       #endif
2502
-      #if E_STEPPERS > 4 && E4_IS_TRINAMIC
2502
+      #if E_STEPPERS > 4 && AXIS_IS_TMC(E4)
2503
         say_M906(PORTVAR_SOLO);
2503
         say_M906(PORTVAR_SOLO);
2504
         SERIAL_ECHOLNPAIR_P(port, " T4 E", stepperE4.getCurrent());
2504
         SERIAL_ECHOLNPAIR_P(port, " T4 E", stepperE4.getCurrent());
2505
       #endif
2505
       #endif
2514
           SERIAL_ECHOLNPGM_P(port, "Hybrid Threshold:");
2514
           SERIAL_ECHOLNPGM_P(port, "Hybrid Threshold:");
2515
         }
2515
         }
2516
         CONFIG_ECHO_START;
2516
         CONFIG_ECHO_START;
2517
-        #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
2517
+        #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
2518
           say_M913(PORTVAR_SOLO);
2518
           say_M913(PORTVAR_SOLO);
2519
         #endif
2519
         #endif
2520
-        #if X_IS_TRINAMIC
2520
+        #if AXIS_IS_TMC(X)
2521
           SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X));
2521
           SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X));
2522
         #endif
2522
         #endif
2523
-        #if Y_IS_TRINAMIC
2523
+        #if AXIS_IS_TMC(Y)
2524
           SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y));
2524
           SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y));
2525
         #endif
2525
         #endif
2526
-        #if Z_IS_TRINAMIC
2526
+        #if AXIS_IS_TMC(Z)
2527
           SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z));
2527
           SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z));
2528
         #endif
2528
         #endif
2529
-        #if X_IS_TRINAMIC || Y_IS_TRINAMIC || Z_IS_TRINAMIC
2529
+        #if AXIS_IS_TMC(X) || AXIS_IS_TMC(Y) || AXIS_IS_TMC(Z)
2530
           SERIAL_EOL_P(port);
2530
           SERIAL_EOL_P(port);
2531
         #endif
2531
         #endif
2532
-        #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
2532
+        #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
2533
           say_M913(PORTVAR_SOLO);
2533
           say_M913(PORTVAR_SOLO);
2534
           SERIAL_ECHOPGM_P(port, " I1");
2534
           SERIAL_ECHOPGM_P(port, " I1");
2535
         #endif
2535
         #endif
2536
-        #if X2_IS_TRINAMIC
2536
+        #if AXIS_IS_TMC(X2)
2537
           SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X2));
2537
           SERIAL_ECHOPAIR_P(port, " X", TMC_GET_PWMTHRS(X, X2));
2538
         #endif
2538
         #endif
2539
-        #if Y2_IS_TRINAMIC
2539
+        #if AXIS_IS_TMC(Y2)
2540
           SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y2));
2540
           SERIAL_ECHOPAIR_P(port, " Y", TMC_GET_PWMTHRS(Y, Y2));
2541
         #endif
2541
         #endif
2542
-        #if Z2_IS_TRINAMIC
2542
+        #if AXIS_IS_TMC(Z2)
2543
           SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z2));
2543
           SERIAL_ECHOPAIR_P(port, " Z", TMC_GET_PWMTHRS(Z, Z2));
2544
         #endif
2544
         #endif
2545
-        #if X2_IS_TRINAMIC || Y2_IS_TRINAMIC || Z2_IS_TRINAMIC
2545
+        #if AXIS_IS_TMC(X2) || AXIS_IS_TMC(Y2) || AXIS_IS_TMC(Z2)
2546
           SERIAL_EOL_P(port);
2546
           SERIAL_EOL_P(port);
2547
         #endif
2547
         #endif
2548
-        #if E0_IS_TRINAMIC
2548
+        #if AXIS_IS_TMC(E0)
2549
           say_M913(PORTVAR_SOLO);
2549
           say_M913(PORTVAR_SOLO);
2550
           SERIAL_ECHOLNPAIR_P(port, " T0 E", TMC_GET_PWMTHRS(E, E0));
2550
           SERIAL_ECHOLNPAIR_P(port, " T0 E", TMC_GET_PWMTHRS(E, E0));
2551
         #endif
2551
         #endif
2552
-        #if E_STEPPERS > 1 && E1_IS_TRINAMIC
2552
+        #if E_STEPPERS > 1 && AXIS_IS_TMC(E1)
2553
           say_M913(PORTVAR_SOLO);
2553
           say_M913(PORTVAR_SOLO);
2554
           SERIAL_ECHOLNPAIR_P(port, " T1 E", TMC_GET_PWMTHRS(E, E1));
2554
           SERIAL_ECHOLNPAIR_P(port, " T1 E", TMC_GET_PWMTHRS(E, E1));
2555
         #endif
2555
         #endif
2556
-        #if E_STEPPERS > 2 && E2_IS_TRINAMIC
2556
+        #if E_STEPPERS > 2 && AXIS_IS_TMC(E2)
2557
           say_M913(PORTVAR_SOLO);
2557
           say_M913(PORTVAR_SOLO);
2558
           SERIAL_ECHOLNPAIR_P(port, " T2 E", TMC_GET_PWMTHRS(E, E2));
2558
           SERIAL_ECHOLNPAIR_P(port, " T2 E", TMC_GET_PWMTHRS(E, E2));
2559
         #endif
2559
         #endif
2560
-        #if E_STEPPERS > 3 && E3_IS_TRINAMIC
2560
+        #if E_STEPPERS > 3 && AXIS_IS_TMC(E3)
2561
           say_M913(PORTVAR_SOLO);
2561
           say_M913(PORTVAR_SOLO);
2562
           SERIAL_ECHOLNPAIR_P(port, " T3 E", TMC_GET_PWMTHRS(E, E3));
2562
           SERIAL_ECHOLNPAIR_P(port, " T3 E", TMC_GET_PWMTHRS(E, E3));
2563
         #endif
2563
         #endif
2564
-        #if E_STEPPERS > 4 && E4_IS_TRINAMIC
2564
+        #if E_STEPPERS > 4 && AXIS_IS_TMC(E4)
2565
           say_M913(PORTVAR_SOLO);
2565
           say_M913(PORTVAR_SOLO);
2566
           SERIAL_ECHOLNPAIR_P(port, " T4 E", TMC_GET_PWMTHRS(E, E4));
2566
           SERIAL_ECHOLNPAIR_P(port, " T4 E", TMC_GET_PWMTHRS(E, E4));
2567
         #endif
2567
         #endif
2577
           SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:");
2577
           SERIAL_ECHOLNPGM_P(port, "Sensorless homing threshold:");
2578
         }
2578
         }
2579
         CONFIG_ECHO_START;
2579
         CONFIG_ECHO_START;
2580
-        #define HAS_X_SENSORLESS (defined(X_HOMING_SENSITIVITY) && (ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)))
2581
-        #define HAS_Y_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && (ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)))
2582
-        #define HAS_Z_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && (ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)))
2583
-        #if HAS_X_SENSORLESS || HAS_Y_SENSORLESS || HAS_Z_SENSORLESS
2580
+        #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
2584
           say_M914(PORTVAR_SOLO);
2581
           say_M914(PORTVAR_SOLO);
2585
-          #if HAS_X_SENSORLESS
2582
+          #if X_SENSORLESS
2586
             SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt());
2583
             SERIAL_ECHOPAIR_P(port, " X", stepperX.sgt());
2587
           #endif
2584
           #endif
2588
-          #if HAS_Y_SENSORLESS
2585
+          #if Y_SENSORLESS
2589
             SERIAL_ECHOPAIR_P(port, " Y", stepperY.sgt());
2586
             SERIAL_ECHOPAIR_P(port, " Y", stepperY.sgt());
2590
           #endif
2587
           #endif
2591
-          #if HAS_Z_SENSORLESS
2588
+          #if Z_SENSORLESS
2592
             SERIAL_ECHOPAIR_P(port, " Z", stepperZ.sgt());
2589
             SERIAL_ECHOPAIR_P(port, " Z", stepperZ.sgt());
2593
           #endif
2590
           #endif
2594
           SERIAL_EOL_P(port);
2591
           SERIAL_EOL_P(port);
2595
         #endif
2592
         #endif
2596
 
2593
 
2597
-        #define HAS_X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && ENABLED(X2_IS_TMC2130))
2598
-        #define HAS_Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && ENABLED(Y2_IS_TMC2130))
2599
-        #define HAS_Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && ENABLED(Z2_IS_TMC2130))
2594
+        #define HAS_X2_SENSORLESS (defined(X_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2))
2595
+        #define HAS_Y2_SENSORLESS (defined(Y_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2))
2596
+        #define HAS_Z2_SENSORLESS (defined(Z_HOMING_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2))
2600
         #if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS
2597
         #if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS
2601
           say_M914(PORTVAR_SOLO);
2598
           say_M914(PORTVAR_SOLO);
2602
           SERIAL_ECHOPGM_P(port, " I1");
2599
           SERIAL_ECHOPGM_P(port, " I1");

+ 128
- 128
Marlin/src/module/stepper_indirection.cpp View File

38
 //
38
 //
39
 // TMC26X Driver objects and inits
39
 // TMC26X Driver objects and inits
40
 //
40
 //
41
-#if ENABLED(HAVE_TMC26X)
41
+#if HAS_DRIVER(TMC26X)
42
   #include <SPI.h>
42
   #include <SPI.h>
43
 
43
 
44
   #ifdef STM32F7
44
   #ifdef STM32F7
49
 
49
 
50
   #define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR)
50
   #define _TMC26X_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_CS_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR)
51
 
51
 
52
-  #if ENABLED(X_IS_TMC26X)
52
+  #if AXIS_DRIVER_TYPE(X, TMC26X)
53
     _TMC26X_DEFINE(X);
53
     _TMC26X_DEFINE(X);
54
   #endif
54
   #endif
55
-  #if ENABLED(X2_IS_TMC26X)
55
+  #if AXIS_DRIVER_TYPE(X2, TMC26X)
56
     _TMC26X_DEFINE(X2);
56
     _TMC26X_DEFINE(X2);
57
   #endif
57
   #endif
58
-  #if ENABLED(Y_IS_TMC26X)
58
+  #if AXIS_DRIVER_TYPE(Y, TMC26X)
59
     _TMC26X_DEFINE(Y);
59
     _TMC26X_DEFINE(Y);
60
   #endif
60
   #endif
61
-  #if ENABLED(Y2_IS_TMC26X)
61
+  #if AXIS_DRIVER_TYPE(Y2, TMC26X)
62
     _TMC26X_DEFINE(Y2);
62
     _TMC26X_DEFINE(Y2);
63
   #endif
63
   #endif
64
-  #if ENABLED(Z_IS_TMC26X)
64
+  #if AXIS_DRIVER_TYPE(Z, TMC26X)
65
     _TMC26X_DEFINE(Z);
65
     _TMC26X_DEFINE(Z);
66
   #endif
66
   #endif
67
-  #if ENABLED(Z2_IS_TMC26X)
67
+  #if AXIS_DRIVER_TYPE(Z2, TMC26X)
68
     _TMC26X_DEFINE(Z2);
68
     _TMC26X_DEFINE(Z2);
69
   #endif
69
   #endif
70
-  #if ENABLED(E0_IS_TMC26X)
70
+  #if AXIS_DRIVER_TYPE(E0, TMC26X)
71
     _TMC26X_DEFINE(E0);
71
     _TMC26X_DEFINE(E0);
72
   #endif
72
   #endif
73
-  #if ENABLED(E1_IS_TMC26X)
73
+  #if AXIS_DRIVER_TYPE(E1, TMC26X)
74
     _TMC26X_DEFINE(E1);
74
     _TMC26X_DEFINE(E1);
75
   #endif
75
   #endif
76
-  #if ENABLED(E2_IS_TMC26X)
76
+  #if AXIS_DRIVER_TYPE(E2, TMC26X)
77
     _TMC26X_DEFINE(E2);
77
     _TMC26X_DEFINE(E2);
78
   #endif
78
   #endif
79
-  #if ENABLED(E3_IS_TMC26X)
79
+  #if AXIS_DRIVER_TYPE(E3, TMC26X)
80
     _TMC26X_DEFINE(E3);
80
     _TMC26X_DEFINE(E3);
81
   #endif
81
   #endif
82
-  #if ENABLED(E4_IS_TMC26X)
82
+  #if AXIS_DRIVER_TYPE(E4, TMC26X)
83
     _TMC26X_DEFINE(E4);
83
     _TMC26X_DEFINE(E4);
84
   #endif
84
   #endif
85
 
85
 
89
   }while(0)
89
   }while(0)
90
 
90
 
91
   void tmc26x_init_to_defaults() {
91
   void tmc26x_init_to_defaults() {
92
-    #if ENABLED(X_IS_TMC26X)
92
+    #if AXIS_DRIVER_TYPE(X, TMC26X)
93
       _TMC26X_INIT(X);
93
       _TMC26X_INIT(X);
94
     #endif
94
     #endif
95
-    #if ENABLED(X2_IS_TMC26X)
95
+    #if AXIS_DRIVER_TYPE(X2, TMC26X)
96
       _TMC26X_INIT(X2);
96
       _TMC26X_INIT(X2);
97
     #endif
97
     #endif
98
-    #if ENABLED(Y_IS_TMC26X)
98
+    #if AXIS_DRIVER_TYPE(Y, TMC26X)
99
       _TMC26X_INIT(Y);
99
       _TMC26X_INIT(Y);
100
     #endif
100
     #endif
101
-    #if ENABLED(Y2_IS_TMC26X)
101
+    #if AXIS_DRIVER_TYPE(Y2, TMC26X)
102
       _TMC26X_INIT(Y2);
102
       _TMC26X_INIT(Y2);
103
     #endif
103
     #endif
104
-    #if ENABLED(Z_IS_TMC26X)
104
+    #if AXIS_DRIVER_TYPE(Z, TMC26X)
105
       _TMC26X_INIT(Z);
105
       _TMC26X_INIT(Z);
106
     #endif
106
     #endif
107
-    #if ENABLED(Z2_IS_TMC26X)
107
+    #if AXIS_DRIVER_TYPE(Z2, TMC26X)
108
       _TMC26X_INIT(Z2);
108
       _TMC26X_INIT(Z2);
109
     #endif
109
     #endif
110
-    #if ENABLED(E0_IS_TMC26X)
110
+    #if AXIS_DRIVER_TYPE(E0, TMC26X)
111
       _TMC26X_INIT(E0);
111
       _TMC26X_INIT(E0);
112
     #endif
112
     #endif
113
-    #if ENABLED(E1_IS_TMC26X)
113
+    #if AXIS_DRIVER_TYPE(E1, TMC26X)
114
       _TMC26X_INIT(E1);
114
       _TMC26X_INIT(E1);
115
     #endif
115
     #endif
116
-    #if ENABLED(E2_IS_TMC26X)
116
+    #if AXIS_DRIVER_TYPE(E2, TMC26X)
117
       _TMC26X_INIT(E2);
117
       _TMC26X_INIT(E2);
118
     #endif
118
     #endif
119
-    #if ENABLED(E3_IS_TMC26X)
119
+    #if AXIS_DRIVER_TYPE(E3, TMC26X)
120
       _TMC26X_INIT(E3);
120
       _TMC26X_INIT(E3);
121
     #endif
121
     #endif
122
-    #if ENABLED(E4_IS_TMC26X)
122
+    #if AXIS_DRIVER_TYPE(E4, TMC26X)
123
       _TMC26X_INIT(E4);
123
       _TMC26X_INIT(E4);
124
     #endif
124
     #endif
125
   }
125
   }
126
-#endif // HAVE_TMC26X
126
+#endif // TMC26X
127
 
127
 
128
 //
128
 //
129
 // TMC2130 Driver objects and inits
129
 // TMC2130 Driver objects and inits
130
 //
130
 //
131
-#if ENABLED(HAVE_TMC2130)
131
+#if HAS_DRIVER(TMC2130)
132
 
132
 
133
   #include <SPI.h>
133
   #include <SPI.h>
134
   #include <TMC2130Stepper.h>
134
   #include <TMC2130Stepper.h>
146
   #endif
146
   #endif
147
 
147
 
148
   // Stepper objects of TMC2130 steppers used
148
   // Stepper objects of TMC2130 steppers used
149
-  #if ENABLED(X_IS_TMC2130)
149
+  #if AXIS_DRIVER_TYPE(X, TMC2130)
150
     _TMC2130_DEFINE(X);
150
     _TMC2130_DEFINE(X);
151
   #endif
151
   #endif
152
-  #if ENABLED(X2_IS_TMC2130)
152
+  #if AXIS_DRIVER_TYPE(X2, TMC2130)
153
     _TMC2130_DEFINE(X2);
153
     _TMC2130_DEFINE(X2);
154
   #endif
154
   #endif
155
-  #if ENABLED(Y_IS_TMC2130)
155
+  #if AXIS_DRIVER_TYPE(Y, TMC2130)
156
     _TMC2130_DEFINE(Y);
156
     _TMC2130_DEFINE(Y);
157
   #endif
157
   #endif
158
-  #if ENABLED(Y2_IS_TMC2130)
158
+  #if AXIS_DRIVER_TYPE(Y2, TMC2130)
159
     _TMC2130_DEFINE(Y2);
159
     _TMC2130_DEFINE(Y2);
160
   #endif
160
   #endif
161
-  #if ENABLED(Z_IS_TMC2130)
161
+  #if AXIS_DRIVER_TYPE(Z, TMC2130)
162
     _TMC2130_DEFINE(Z);
162
     _TMC2130_DEFINE(Z);
163
   #endif
163
   #endif
164
-  #if ENABLED(Z2_IS_TMC2130)
164
+  #if AXIS_DRIVER_TYPE(Z2, TMC2130)
165
     _TMC2130_DEFINE(Z2);
165
     _TMC2130_DEFINE(Z2);
166
   #endif
166
   #endif
167
-  #if ENABLED(E0_IS_TMC2130)
167
+  #if AXIS_DRIVER_TYPE(E0, TMC2130)
168
     _TMC2130_DEFINE(E0);
168
     _TMC2130_DEFINE(E0);
169
   #endif
169
   #endif
170
-  #if ENABLED(E1_IS_TMC2130)
170
+  #if AXIS_DRIVER_TYPE(E1, TMC2130)
171
     _TMC2130_DEFINE(E1);
171
     _TMC2130_DEFINE(E1);
172
   #endif
172
   #endif
173
-  #if ENABLED(E2_IS_TMC2130)
173
+  #if AXIS_DRIVER_TYPE(E2, TMC2130)
174
     _TMC2130_DEFINE(E2);
174
     _TMC2130_DEFINE(E2);
175
   #endif
175
   #endif
176
-  #if ENABLED(E3_IS_TMC2130)
176
+  #if AXIS_DRIVER_TYPE(E3, TMC2130)
177
     _TMC2130_DEFINE(E3);
177
     _TMC2130_DEFINE(E3);
178
   #endif
178
   #endif
179
-  #if ENABLED(E4_IS_TMC2130)
179
+  #if AXIS_DRIVER_TYPE(E4, TMC2130)
180
     _TMC2130_DEFINE(E4);
180
     _TMC2130_DEFINE(E4);
181
   #endif
181
   #endif
182
 
182
 
213
   #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
213
   #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
214
 
214
 
215
   void tmc2130_init_to_defaults() {
215
   void tmc2130_init_to_defaults() {
216
-    #if ENABLED(X_IS_TMC2130)
216
+    #if AXIS_DRIVER_TYPE(X, TMC2130)
217
       _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]);
217
       _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]);
218
     #endif
218
     #endif
219
-    #if ENABLED(X2_IS_TMC2130)
219
+    #if AXIS_DRIVER_TYPE(X2, TMC2130)
220
       _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
220
       _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
221
     #endif
221
     #endif
222
-    #if ENABLED(Y_IS_TMC2130)
222
+    #if AXIS_DRIVER_TYPE(Y, TMC2130)
223
       _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]);
223
       _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]);
224
     #endif
224
     #endif
225
-    #if ENABLED(Y2_IS_TMC2130)
225
+    #if AXIS_DRIVER_TYPE(Y2, TMC2130)
226
       _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
226
       _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
227
     #endif
227
     #endif
228
-    #if ENABLED(Z_IS_TMC2130)
228
+    #if AXIS_DRIVER_TYPE(Z, TMC2130)
229
       _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]);
229
       _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]);
230
     #endif
230
     #endif
231
-    #if ENABLED(Z2_IS_TMC2130)
231
+    #if AXIS_DRIVER_TYPE(Z2, TMC2130)
232
       _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
232
       _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
233
     #endif
233
     #endif
234
-    #if ENABLED(E0_IS_TMC2130)
234
+    #if AXIS_DRIVER_TYPE(E0, TMC2130)
235
       _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
235
       _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
236
     #endif
236
     #endif
237
-    #if ENABLED(E1_IS_TMC2130)
237
+    #if AXIS_DRIVER_TYPE(E1, TMC2130)
238
       { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
238
       { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
239
     #endif
239
     #endif
240
-    #if ENABLED(E2_IS_TMC2130)
240
+    #if AXIS_DRIVER_TYPE(E2, TMC2130)
241
       { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
241
       { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
242
     #endif
242
     #endif
243
-    #if ENABLED(E3_IS_TMC2130)
243
+    #if AXIS_DRIVER_TYPE(E3, TMC2130)
244
       { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
244
       { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
245
     #endif
245
     #endif
246
-    #if ENABLED(E4_IS_TMC2130)
246
+    #if AXIS_DRIVER_TYPE(E4, TMC2130)
247
       { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
247
       { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
248
     #endif
248
     #endif
249
 
249
 
250
     #if ENABLED(SENSORLESS_HOMING)
250
     #if ENABLED(SENSORLESS_HOMING)
251
       #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY);
251
       #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY);
252
       #if X_SENSORLESS
252
       #if X_SENSORLESS
253
-        #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
253
+        #if AXIS_DRIVER_TYPE(X, TMC2130)
254
           stepperX.sgt(X_HOMING_SENSITIVITY);
254
           stepperX.sgt(X_HOMING_SENSITIVITY);
255
         #endif
255
         #endif
256
-        #if ENABLED(X2_IS_TMC2130)
256
+        #if AXIS_DRIVER_TYPE(X2, TMC2130)
257
           stepperX2.sgt(X_HOMING_SENSITIVITY);
257
           stepperX2.sgt(X_HOMING_SENSITIVITY);
258
         #endif
258
         #endif
259
       #endif
259
       #endif
260
       #if Y_SENSORLESS
260
       #if Y_SENSORLESS
261
-        #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
261
+        #if AXIS_DRIVER_TYPE(Y, TMC2130)
262
           stepperY.sgt(Y_HOMING_SENSITIVITY);
262
           stepperY.sgt(Y_HOMING_SENSITIVITY);
263
         #endif
263
         #endif
264
-        #if ENABLED(Y2_IS_TMC2130)
264
+        #if AXIS_DRIVER_TYPE(Y2, TMC2130)
265
           stepperY2.sgt(Y_HOMING_SENSITIVITY);
265
           stepperY2.sgt(Y_HOMING_SENSITIVITY);
266
         #endif
266
         #endif
267
       #endif
267
       #endif
268
       #if Z_SENSORLESS
268
       #if Z_SENSORLESS
269
-        #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
269
+        #if AXIS_DRIVER_TYPE(Z, TMC2130)
270
           stepperZ.sgt(Z_HOMING_SENSITIVITY);
270
           stepperZ.sgt(Z_HOMING_SENSITIVITY);
271
         #endif
271
         #endif
272
-        #if ENABLED(Z2_IS_TMC2130)
272
+        #if AXIS_DRIVER_TYPE(Z2, TMC2130)
273
           stepperZ2.sgt(Z_HOMING_SENSITIVITY);
273
           stepperZ2.sgt(Z_HOMING_SENSITIVITY);
274
         #endif
274
         #endif
275
       #endif
275
       #endif
276
     #endif
276
     #endif
277
   }
277
   }
278
-#endif // HAVE_TMC2130
278
+#endif // TMC2130
279
 
279
 
280
 //
280
 //
281
 // TMC2208 Driver objects and inits
281
 // TMC2208 Driver objects and inits
282
 //
282
 //
283
-#if ENABLED(HAVE_TMC2208)
283
+#if HAS_DRIVER(TMC2208)
284
 
284
 
285
   #include <SoftwareSerial.h>
285
   #include <SoftwareSerial.h>
286
   #include <HardwareSerial.h>
286
   #include <HardwareSerial.h>
296
                                        TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL, ST##_SERIAL_RX_PIN > -1)
296
                                        TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL, ST##_SERIAL_RX_PIN > -1)
297
 
297
 
298
   // Stepper objects of TMC2208 steppers used
298
   // Stepper objects of TMC2208 steppers used
299
-  #if ENABLED(X_IS_TMC2208)
299
+  #if AXIS_DRIVER_TYPE(X, TMC2208)
300
     #ifdef X_HARDWARE_SERIAL
300
     #ifdef X_HARDWARE_SERIAL
301
       _TMC2208_DEFINE_HARDWARE(X);
301
       _TMC2208_DEFINE_HARDWARE(X);
302
     #else
302
     #else
303
       _TMC2208_DEFINE_SOFTWARE(X);
303
       _TMC2208_DEFINE_SOFTWARE(X);
304
     #endif
304
     #endif
305
   #endif
305
   #endif
306
-  #if ENABLED(X2_IS_TMC2208)
306
+  #if AXIS_DRIVER_TYPE(X2, TMC2208)
307
     #ifdef X2_HARDWARE_SERIAL
307
     #ifdef X2_HARDWARE_SERIAL
308
       _TMC2208_DEFINE_HARDWARE(X2);
308
       _TMC2208_DEFINE_HARDWARE(X2);
309
     #else
309
     #else
310
       _TMC2208_DEFINE_SOFTWARE(X2);
310
       _TMC2208_DEFINE_SOFTWARE(X2);
311
     #endif
311
     #endif
312
   #endif
312
   #endif
313
-  #if ENABLED(Y_IS_TMC2208)
313
+  #if AXIS_DRIVER_TYPE(Y, TMC2208)
314
     #ifdef Y_HARDWARE_SERIAL
314
     #ifdef Y_HARDWARE_SERIAL
315
       _TMC2208_DEFINE_HARDWARE(Y);
315
       _TMC2208_DEFINE_HARDWARE(Y);
316
     #else
316
     #else
317
       _TMC2208_DEFINE_SOFTWARE(Y);
317
       _TMC2208_DEFINE_SOFTWARE(Y);
318
     #endif
318
     #endif
319
   #endif
319
   #endif
320
-  #if ENABLED(Y2_IS_TMC2208)
320
+  #if AXIS_DRIVER_TYPE(Y2, TMC2208)
321
     #ifdef Y2_HARDWARE_SERIAL
321
     #ifdef Y2_HARDWARE_SERIAL
322
       _TMC2208_DEFINE_HARDWARE(Y2);
322
       _TMC2208_DEFINE_HARDWARE(Y2);
323
     #else
323
     #else
324
       _TMC2208_DEFINE_SOFTWARE(Y2);
324
       _TMC2208_DEFINE_SOFTWARE(Y2);
325
     #endif
325
     #endif
326
   #endif
326
   #endif
327
-  #if ENABLED(Z_IS_TMC2208)
327
+  #if AXIS_DRIVER_TYPE(Z, TMC2208)
328
     #ifdef Z_HARDWARE_SERIAL
328
     #ifdef Z_HARDWARE_SERIAL
329
       _TMC2208_DEFINE_HARDWARE(Z);
329
       _TMC2208_DEFINE_HARDWARE(Z);
330
     #else
330
     #else
331
       _TMC2208_DEFINE_SOFTWARE(Z);
331
       _TMC2208_DEFINE_SOFTWARE(Z);
332
     #endif
332
     #endif
333
   #endif
333
   #endif
334
-  #if ENABLED(Z2_IS_TMC2208)
334
+  #if AXIS_DRIVER_TYPE(Z2, TMC2208)
335
     #ifdef Z2_HARDWARE_SERIAL
335
     #ifdef Z2_HARDWARE_SERIAL
336
       _TMC2208_DEFINE_HARDWARE(Z2);
336
       _TMC2208_DEFINE_HARDWARE(Z2);
337
     #else
337
     #else
338
       _TMC2208_DEFINE_SOFTWARE(Z2);
338
       _TMC2208_DEFINE_SOFTWARE(Z2);
339
     #endif
339
     #endif
340
   #endif
340
   #endif
341
-  #if ENABLED(E0_IS_TMC2208)
341
+  #if AXIS_DRIVER_TYPE(E0, TMC2208)
342
     #ifdef E0_HARDWARE_SERIAL
342
     #ifdef E0_HARDWARE_SERIAL
343
       _TMC2208_DEFINE_HARDWARE(E0);
343
       _TMC2208_DEFINE_HARDWARE(E0);
344
     #else
344
     #else
345
       _TMC2208_DEFINE_SOFTWARE(E0);
345
       _TMC2208_DEFINE_SOFTWARE(E0);
346
     #endif
346
     #endif
347
   #endif
347
   #endif
348
-  #if ENABLED(E1_IS_TMC2208)
348
+  #if AXIS_DRIVER_TYPE(E1, TMC2208)
349
     #ifdef E1_HARDWARE_SERIAL
349
     #ifdef E1_HARDWARE_SERIAL
350
       _TMC2208_DEFINE_HARDWARE(E1);
350
       _TMC2208_DEFINE_HARDWARE(E1);
351
     #else
351
     #else
352
       _TMC2208_DEFINE_SOFTWARE(E1);
352
       _TMC2208_DEFINE_SOFTWARE(E1);
353
     #endif
353
     #endif
354
   #endif
354
   #endif
355
-  #if ENABLED(E2_IS_TMC2208)
355
+  #if AXIS_DRIVER_TYPE(E2, TMC2208)
356
     #ifdef E2_HARDWARE_SERIAL
356
     #ifdef E2_HARDWARE_SERIAL
357
       _TMC2208_DEFINE_HARDWARE(E2);
357
       _TMC2208_DEFINE_HARDWARE(E2);
358
     #else
358
     #else
359
       _TMC2208_DEFINE_SOFTWARE(E2);
359
       _TMC2208_DEFINE_SOFTWARE(E2);
360
     #endif
360
     #endif
361
   #endif
361
   #endif
362
-  #if ENABLED(E3_IS_TMC2208)
362
+  #if AXIS_DRIVER_TYPE(E3, TMC2208)
363
     #ifdef E3_HARDWARE_SERIAL
363
     #ifdef E3_HARDWARE_SERIAL
364
       _TMC2208_DEFINE_HARDWARE(E3);
364
       _TMC2208_DEFINE_HARDWARE(E3);
365
     #else
365
     #else
366
       _TMC2208_DEFINE_SOFTWARE(E3);
366
       _TMC2208_DEFINE_SOFTWARE(E3);
367
     #endif
367
     #endif
368
   #endif
368
   #endif
369
-  #if ENABLED(E4_IS_TMC2208)
369
+  #if AXIS_DRIVER_TYPE(E4, TMC2208)
370
     #ifdef E4_HARDWARE_SERIAL
370
     #ifdef E4_HARDWARE_SERIAL
371
       _TMC2208_DEFINE_HARDWARE(E4);
371
       _TMC2208_DEFINE_HARDWARE(E4);
372
     #else
372
     #else
375
   #endif
375
   #endif
376
 
376
 
377
   void tmc2208_serial_begin() {
377
   void tmc2208_serial_begin() {
378
-    #if ENABLED(X_IS_TMC2208)
378
+    #if AXIS_DRIVER_TYPE(X, TMC2208)
379
       X_HARDWARE_SERIAL.begin(115200);
379
       X_HARDWARE_SERIAL.begin(115200);
380
     #endif
380
     #endif
381
-    #if ENABLED(X2_IS_TMC2208)
381
+    #if AXIS_DRIVER_TYPE(X2, TMC2208)
382
       X2_HARDWARE_SERIAL.begin(115200);
382
       X2_HARDWARE_SERIAL.begin(115200);
383
     #endif
383
     #endif
384
-    #if ENABLED(Y_IS_TMC2208)
384
+    #if AXIS_DRIVER_TYPE(Y, TMC2208)
385
       Y_HARDWARE_SERIAL.begin(115200);
385
       Y_HARDWARE_SERIAL.begin(115200);
386
     #endif
386
     #endif
387
-    #if ENABLED(Y2_IS_TMC2208)
387
+    #if AXIS_DRIVER_TYPE(Y2, TMC2208)
388
       Y2_HARDWARE_SERIAL.begin(115200);
388
       Y2_HARDWARE_SERIAL.begin(115200);
389
     #endif
389
     #endif
390
-    #if ENABLED(Z_IS_TMC2208)
390
+    #if AXIS_DRIVER_TYPE(Z, TMC2208)
391
       Z_HARDWARE_SERIAL.begin(115200);
391
       Z_HARDWARE_SERIAL.begin(115200);
392
     #endif
392
     #endif
393
-    #if ENABLED(Z2_IS_TMC2208)
393
+    #if AXIS_DRIVER_TYPE(Z2, TMC2208)
394
       Z2_HARDWARE_SERIAL.begin(115200);
394
       Z2_HARDWARE_SERIAL.begin(115200);
395
     #endif
395
     #endif
396
-    #if ENABLED(E0_IS_TMC2208)
396
+    #if AXIS_DRIVER_TYPE(E0, TMC2208)
397
       E0_HARDWARE_SERIAL.begin(115200);
397
       E0_HARDWARE_SERIAL.begin(115200);
398
     #endif
398
     #endif
399
-    #if ENABLED(E1_IS_TMC2208)
399
+    #if AXIS_DRIVER_TYPE(E1, TMC2208)
400
       E1_HARDWARE_SERIAL.begin(115200);
400
       E1_HARDWARE_SERIAL.begin(115200);
401
     #endif
401
     #endif
402
-    #if ENABLED(E2_IS_TMC2208)
402
+    #if AXIS_DRIVER_TYPE(E2, TMC2208)
403
       E2_HARDWARE_SERIAL.begin(115200);
403
       E2_HARDWARE_SERIAL.begin(115200);
404
     #endif
404
     #endif
405
-    #if ENABLED(E3_IS_TMC2208)
405
+    #if AXIS_DRIVER_TYPE(E3, TMC2208)
406
       E3_HARDWARE_SERIAL.begin(115200);
406
       E3_HARDWARE_SERIAL.begin(115200);
407
     #endif
407
     #endif
408
-    #if ENABLED(E4_IS_TMC2208)
408
+    #if AXIS_DRIVER_TYPE(E4, TMC2208)
409
       E4_HARDWARE_SERIAL.begin(115200);
409
       E4_HARDWARE_SERIAL.begin(115200);
410
     #endif
410
     #endif
411
   }
411
   }
449
   #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
449
   #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_CURRENT, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
450
 
450
 
451
   void tmc2208_init_to_defaults() {
451
   void tmc2208_init_to_defaults() {
452
-    #if ENABLED(X_IS_TMC2208)
452
+    #if AXIS_DRIVER_TYPE(X, TMC2208)
453
       _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]);
453
       _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]);
454
     #endif
454
     #endif
455
-    #if ENABLED(X2_IS_TMC2208)
455
+    #if AXIS_DRIVER_TYPE(X2, TMC2208)
456
       _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
456
       _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
457
     #endif
457
     #endif
458
-    #if ENABLED(Y_IS_TMC2208)
458
+    #if AXIS_DRIVER_TYPE(Y, TMC2208)
459
       _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]);
459
       _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]);
460
     #endif
460
     #endif
461
-    #if ENABLED(Y2_IS_TMC2208)
461
+    #if AXIS_DRIVER_TYPE(Y2, TMC2208)
462
       _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
462
       _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
463
     #endif
463
     #endif
464
-    #if ENABLED(Z_IS_TMC2208)
464
+    #if AXIS_DRIVER_TYPE(Z, TMC2208)
465
       _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]);
465
       _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]);
466
     #endif
466
     #endif
467
-    #if ENABLED(Z2_IS_TMC2208)
467
+    #if AXIS_DRIVER_TYPE(Z2, TMC2208)
468
       _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
468
       _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
469
     #endif
469
     #endif
470
-    #if ENABLED(E0_IS_TMC2208)
470
+    #if AXIS_DRIVER_TYPE(E0, TMC2208)
471
       _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
471
       _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
472
     #endif
472
     #endif
473
-    #if ENABLED(E1_IS_TMC2208)
473
+    #if AXIS_DRIVER_TYPE(E1, TMC2208)
474
       { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
474
       { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
475
     #endif
475
     #endif
476
-    #if ENABLED(E2_IS_TMC2208)
476
+    #if AXIS_DRIVER_TYPE(E2, TMC2208)
477
       { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
477
       { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
478
     #endif
478
     #endif
479
-    #if ENABLED(E3_IS_TMC2208)
479
+    #if AXIS_DRIVER_TYPE(E3, TMC2208)
480
       { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
480
       { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
481
     #endif
481
     #endif
482
-    #if ENABLED(E4_IS_TMC2208)
482
+    #if AXIS_DRIVER_TYPE(E4, TMC2208)
483
       { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
483
       { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
484
     #endif
484
     #endif
485
   }
485
   }
486
-#endif // HAVE_TMC2208
486
+#endif // TMC2208
487
 
487
 
488
 void restore_stepper_drivers() {
488
 void restore_stepper_drivers() {
489
-  #if X_IS_TRINAMIC
489
+  #if AXIS_IS_TMC(X)
490
     stepperX.push();
490
     stepperX.push();
491
   #endif
491
   #endif
492
-  #if X2_IS_TRINAMIC
492
+  #if AXIS_IS_TMC(X2)
493
     stepperX2.push();
493
     stepperX2.push();
494
   #endif
494
   #endif
495
-  #if Y_IS_TRINAMIC
495
+  #if AXIS_IS_TMC(Y)
496
     stepperY.push();
496
     stepperY.push();
497
   #endif
497
   #endif
498
-  #if Y2_IS_TRINAMIC
498
+  #if AXIS_IS_TMC(Y2)
499
     stepperY2.push();
499
     stepperY2.push();
500
   #endif
500
   #endif
501
-  #if Z_IS_TRINAMIC
501
+  #if AXIS_IS_TMC(Z)
502
     stepperZ.push();
502
     stepperZ.push();
503
   #endif
503
   #endif
504
-  #if Z2_IS_TRINAMIC
504
+  #if AXIS_IS_TMC(Z2)
505
     stepperZ2.push();
505
     stepperZ2.push();
506
   #endif
506
   #endif
507
-  #if E0_IS_TRINAMIC
507
+  #if AXIS_IS_TMC(E0)
508
     stepperE0.push();
508
     stepperE0.push();
509
   #endif
509
   #endif
510
-  #if E1_IS_TRINAMIC
510
+  #if AXIS_IS_TMC(E1)
511
     stepperE1.push();
511
     stepperE1.push();
512
   #endif
512
   #endif
513
-  #if E2_IS_TRINAMIC
513
+  #if AXIS_IS_TMC(E2)
514
     stepperE2.push();
514
     stepperE2.push();
515
   #endif
515
   #endif
516
-  #if E3_IS_TRINAMIC
516
+  #if AXIS_IS_TMC(E3)
517
     stepperE3.push();
517
     stepperE3.push();
518
   #endif
518
   #endif
519
-  #if E4_IS_TRINAMIC
519
+  #if AXIS_IS_TMC(E4)
520
     stepperE4.push();
520
     stepperE4.push();
521
   #endif
521
   #endif
522
 }
522
 }
523
 
523
 
524
 void reset_stepper_drivers() {
524
 void reset_stepper_drivers() {
525
-  #if ENABLED(HAVE_TMC26X)
525
+  #if HAS_DRIVER(TMC26X)
526
     tmc26x_init_to_defaults();
526
     tmc26x_init_to_defaults();
527
   #endif
527
   #endif
528
-  #if ENABLED(HAVE_TMC2130)
528
+  #if HAS_DRIVER(TMC2130)
529
     delay(100);
529
     delay(100);
530
     tmc2130_init_to_defaults();
530
     tmc2130_init_to_defaults();
531
   #endif
531
   #endif
532
-  #if ENABLED(HAVE_TMC2208)
532
+  #if HAS_DRIVER(TMC2208)
533
     delay(100);
533
     delay(100);
534
     tmc2208_init_to_defaults();
534
     tmc2208_init_to_defaults();
535
   #endif
535
   #endif
536
   #ifdef TMC_ADV
536
   #ifdef TMC_ADV
537
     TMC_ADV()
537
     TMC_ADV()
538
   #endif
538
   #endif
539
-  #if ENABLED(HAVE_L6470DRIVER)
539
+  #if HAS_DRIVER(L6470)
540
     L6470_init_to_defaults();
540
     L6470_init_to_defaults();
541
   #endif
541
   #endif
542
 }
542
 }
544
 //
544
 //
545
 // L6470 Driver objects and inits
545
 // L6470 Driver objects and inits
546
 //
546
 //
547
-#if ENABLED(HAVE_L6470DRIVER)
547
+#if HAS_DRIVER(L6470)
548
 
548
 
549
   #include <SPI.h>
549
   #include <SPI.h>
550
   #include <L6470.h>
550
   #include <L6470.h>
552
   #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_PIN)
552
   #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_PIN)
553
 
553
 
554
   // L6470 Stepper objects
554
   // L6470 Stepper objects
555
-  #if ENABLED(X_IS_L6470)
555
+  #if AXIS_DRIVER_TYPE(X, L6470)
556
     _L6470_DEFINE(X);
556
     _L6470_DEFINE(X);
557
   #endif
557
   #endif
558
-  #if ENABLED(X2_IS_L6470)
558
+  #if AXIS_DRIVER_TYPE(X2, L6470)
559
     _L6470_DEFINE(X2);
559
     _L6470_DEFINE(X2);
560
   #endif
560
   #endif
561
-  #if ENABLED(Y_IS_L6470)
561
+  #if AXIS_DRIVER_TYPE(Y, L6470)
562
     _L6470_DEFINE(Y);
562
     _L6470_DEFINE(Y);
563
   #endif
563
   #endif
564
-  #if ENABLED(Y2_IS_L6470)
564
+  #if AXIS_DRIVER_TYPE(Y2, L6470)
565
     _L6470_DEFINE(Y2);
565
     _L6470_DEFINE(Y2);
566
   #endif
566
   #endif
567
-  #if ENABLED(Z_IS_L6470)
567
+  #if AXIS_DRIVER_TYPE(Z, L6470)
568
     _L6470_DEFINE(Z);
568
     _L6470_DEFINE(Z);
569
   #endif
569
   #endif
570
-  #if ENABLED(Z2_IS_L6470)
570
+  #if AXIS_DRIVER_TYPE(Z2, L6470)
571
     _L6470_DEFINE(Z2);
571
     _L6470_DEFINE(Z2);
572
   #endif
572
   #endif
573
-  #if ENABLED(E0_IS_L6470)
573
+  #if AXIS_DRIVER_TYPE(E0, L6470)
574
     _L6470_DEFINE(E0);
574
     _L6470_DEFINE(E0);
575
   #endif
575
   #endif
576
-  #if ENABLED(E1_IS_L6470)
576
+  #if AXIS_DRIVER_TYPE(E1, L6470)
577
     _L6470_DEFINE(E1);
577
     _L6470_DEFINE(E1);
578
   #endif
578
   #endif
579
-  #if ENABLED(E2_IS_L6470)
579
+  #if AXIS_DRIVER_TYPE(E2, L6470)
580
     _L6470_DEFINE(E2);
580
     _L6470_DEFINE(E2);
581
   #endif
581
   #endif
582
-  #if ENABLED(E3_IS_L6470)
582
+  #if AXIS_DRIVER_TYPE(E3, L6470)
583
     _L6470_DEFINE(E3);
583
     _L6470_DEFINE(E3);
584
   #endif
584
   #endif
585
-  #if ENABLED(E4_IS_L6470)
585
+  #if AXIS_DRIVER_TYPE(E4, L6470)
586
     _L6470_DEFINE(E4);
586
     _L6470_DEFINE(E4);
587
   #endif
587
   #endif
588
 
588
 
595
   }while(0)
595
   }while(0)
596
 
596
 
597
   void L6470_init_to_defaults() {
597
   void L6470_init_to_defaults() {
598
-    #if ENABLED(X_IS_L6470)
598
+    #if AXIS_DRIVER_TYPE(X, L6470)
599
       _L6470_INIT(X);
599
       _L6470_INIT(X);
600
     #endif
600
     #endif
601
-    #if ENABLED(X2_IS_L6470)
601
+    #if AXIS_DRIVER_TYPE(X2, L6470)
602
       _L6470_INIT(X2);
602
       _L6470_INIT(X2);
603
     #endif
603
     #endif
604
-    #if ENABLED(Y_IS_L6470)
604
+    #if AXIS_DRIVER_TYPE(Y, L6470)
605
       _L6470_INIT(Y);
605
       _L6470_INIT(Y);
606
     #endif
606
     #endif
607
-    #if ENABLED(Y2_IS_L6470)
607
+    #if AXIS_DRIVER_TYPE(Y2, L6470)
608
       _L6470_INIT(Y2);
608
       _L6470_INIT(Y2);
609
     #endif
609
     #endif
610
-    #if ENABLED(Z_IS_L6470)
610
+    #if AXIS_DRIVER_TYPE(Z, L6470)
611
       _L6470_INIT(Z);
611
       _L6470_INIT(Z);
612
     #endif
612
     #endif
613
-    #if ENABLED(Z2_IS_L6470)
613
+    #if AXIS_DRIVER_TYPE(Z2, L6470)
614
       _L6470_INIT(Z2);
614
       _L6470_INIT(Z2);
615
     #endif
615
     #endif
616
-    #if ENABLED(E0_IS_L6470)
616
+    #if AXIS_DRIVER_TYPE(E0, L6470)
617
       _L6470_INIT(E0);
617
       _L6470_INIT(E0);
618
     #endif
618
     #endif
619
-    #if ENABLED(E1_IS_L6470)
619
+    #if AXIS_DRIVER_TYPE(E1, L6470)
620
       _L6470_INIT(E1);
620
       _L6470_INIT(E1);
621
     #endif
621
     #endif
622
-    #if ENABLED(E2_IS_L6470)
622
+    #if AXIS_DRIVER_TYPE(E2, L6470)
623
       _L6470_INIT(E2);
623
       _L6470_INIT(E2);
624
     #endif
624
     #endif
625
-    #if ENABLED(E3_IS_L6470)
625
+    #if AXIS_DRIVER_TYPE(E3, L6470)
626
       _L6470_INIT(E3);
626
       _L6470_INIT(E3);
627
     #endif
627
     #endif
628
-    #if ENABLED(E4_IS_L6470)
628
+    #if AXIS_DRIVER_TYPE(E4, L6470)
629
       _L6470_INIT(E4);
629
       _L6470_INIT(E4);
630
     #endif
630
     #endif
631
   }
631
   }
632
 
632
 
633
-#endif // HAVE_L6470DRIVER
633
+#endif // L6470

+ 48
- 48
Marlin/src/module/stepper_indirection.h View File

47
 #include "../inc/MarlinConfig.h"
47
 #include "../inc/MarlinConfig.h"
48
 
48
 
49
 // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI
49
 // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI
50
-#if ENABLED(HAVE_TMC26X)
50
+#if HAS_DRIVER(TMC26X)
51
   #include <SPI.h>
51
   #include <SPI.h>
52
   #ifdef STM32F7
52
   #ifdef STM32F7
53
     #include "../HAL/HAL_STM32F7/TMC2660.h"
53
     #include "../HAL/HAL_STM32F7/TMC2660.h"
57
   void tmc26x_init_to_defaults();
57
   void tmc26x_init_to_defaults();
58
 #endif
58
 #endif
59
 
59
 
60
-#if ENABLED(HAVE_TMC2130)
60
+#if HAS_DRIVER(TMC2130)
61
   #include <TMC2130Stepper.h>
61
   #include <TMC2130Stepper.h>
62
   void tmc2130_init_to_defaults();
62
   void tmc2130_init_to_defaults();
63
 #endif
63
 #endif
64
 
64
 
65
-#if ENABLED(HAVE_TMC2208)
65
+#if HAS_DRIVER(TMC2208)
66
   #include <TMC2208Stepper.h>
66
   #include <TMC2208Stepper.h>
67
   void tmc2208_serial_begin();
67
   void tmc2208_serial_begin();
68
   void tmc2208_init_to_defaults();
68
   void tmc2208_init_to_defaults();
69
 #endif
69
 #endif
70
 
70
 
71
 // L6470 has STEP on normal pins, but DIR/ENABLE via SPI
71
 // L6470 has STEP on normal pins, but DIR/ENABLE via SPI
72
-#if ENABLED(HAVE_L6470DRIVER)
72
+#if HAS_DRIVER(L6470)
73
   #include <SPI.h>
73
   #include <SPI.h>
74
   #include <L6470.h>
74
   #include <L6470.h>
75
   void L6470_init_to_defaults();
75
   void L6470_init_to_defaults();
79
 void reset_stepper_drivers();    // Called by settings.load / settings.reset
79
 void reset_stepper_drivers();    // Called by settings.load / settings.reset
80
 
80
 
81
 // X Stepper
81
 // X Stepper
82
-#if ENABLED(X_IS_L6470)
82
+#if AXIS_DRIVER_TYPE(X, L6470)
83
   extern L6470 stepperX;
83
   extern L6470 stepperX;
84
   #define X_ENABLE_INIT NOOP
84
   #define X_ENABLE_INIT NOOP
85
   #define X_ENABLE_WRITE(STATE) do{ if (STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree(); }while(0)
85
   #define X_ENABLE_WRITE(STATE) do{ if (STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree(); }while(0)
88
   #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE)
88
   #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE)
89
   #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
89
   #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
90
 #else
90
 #else
91
-  #if ENABLED(X_IS_TMC26X)
91
+  #if AXIS_DRIVER_TYPE(X, TMC26X)
92
     extern TMC26XStepper stepperX;
92
     extern TMC26XStepper stepperX;
93
     #define X_ENABLE_INIT NOOP
93
     #define X_ENABLE_INIT NOOP
94
     #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
94
     #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
95
     #define X_ENABLE_READ stepperX.isEnabled()
95
     #define X_ENABLE_READ stepperX.isEnabled()
96
   #else
96
   #else
97
-    #if ENABLED(X_IS_TMC2130)
97
+    #if AXIS_DRIVER_TYPE(X, TMC2130)
98
       extern TMC2130Stepper stepperX;
98
       extern TMC2130Stepper stepperX;
99
-    #elif ENABLED(X_IS_TMC2208)
99
+    #elif AXIS_DRIVER_TYPE(X, TMC2208)
100
       extern TMC2208Stepper stepperX;
100
       extern TMC2208Stepper stepperX;
101
     #endif
101
     #endif
102
     #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
102
     #define X_ENABLE_INIT SET_OUTPUT(X_ENABLE_PIN)
112
 #define X_STEP_READ READ(X_STEP_PIN)
112
 #define X_STEP_READ READ(X_STEP_PIN)
113
 
113
 
114
 // Y Stepper
114
 // Y Stepper
115
-#if ENABLED(Y_IS_L6470)
115
+#if AXIS_DRIVER_TYPE(Y, L6470)
116
   extern L6470 stepperY;
116
   extern L6470 stepperY;
117
   #define Y_ENABLE_INIT NOOP
117
   #define Y_ENABLE_INIT NOOP
118
   #define Y_ENABLE_WRITE(STATE) do{ if (STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree(); }while(0)
118
   #define Y_ENABLE_WRITE(STATE) do{ if (STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree(); }while(0)
121
   #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE)
121
   #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE)
122
   #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
122
   #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
123
 #else
123
 #else
124
-  #if ENABLED(Y_IS_TMC26X)
124
+  #if AXIS_DRIVER_TYPE(Y, TMC26X)
125
     extern TMC26XStepper stepperY;
125
     extern TMC26XStepper stepperY;
126
     #define Y_ENABLE_INIT NOOP
126
     #define Y_ENABLE_INIT NOOP
127
     #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
127
     #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
128
     #define Y_ENABLE_READ stepperY.isEnabled()
128
     #define Y_ENABLE_READ stepperY.isEnabled()
129
   #else
129
   #else
130
-    #if ENABLED(Y_IS_TMC2130)
130
+    #if AXIS_DRIVER_TYPE(Y, TMC2130)
131
       extern TMC2130Stepper stepperY;
131
       extern TMC2130Stepper stepperY;
132
-    #elif ENABLED(Y_IS_TMC2208)
132
+    #elif AXIS_DRIVER_TYPE(Y, TMC2208)
133
       extern TMC2208Stepper stepperY;
133
       extern TMC2208Stepper stepperY;
134
     #endif
134
     #endif
135
     #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
135
     #define Y_ENABLE_INIT SET_OUTPUT(Y_ENABLE_PIN)
145
 #define Y_STEP_READ READ(Y_STEP_PIN)
145
 #define Y_STEP_READ READ(Y_STEP_PIN)
146
 
146
 
147
 // Z Stepper
147
 // Z Stepper
148
-#if ENABLED(Z_IS_L6470)
148
+#if AXIS_DRIVER_TYPE(Z, L6470)
149
   extern L6470 stepperZ;
149
   extern L6470 stepperZ;
150
   #define Z_ENABLE_INIT NOOP
150
   #define Z_ENABLE_INIT NOOP
151
   #define Z_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree(); }while(0)
151
   #define Z_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree(); }while(0)
154
   #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE)
154
   #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE)
155
   #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
155
   #define Z_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
156
 #else
156
 #else
157
-  #if ENABLED(Z_IS_TMC26X)
157
+  #if AXIS_DRIVER_TYPE(Z, TMC26X)
158
     extern TMC26XStepper stepperZ;
158
     extern TMC26XStepper stepperZ;
159
     #define Z_ENABLE_INIT NOOP
159
     #define Z_ENABLE_INIT NOOP
160
     #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
160
     #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
161
     #define Z_ENABLE_READ stepperZ.isEnabled()
161
     #define Z_ENABLE_READ stepperZ.isEnabled()
162
   #else
162
   #else
163
-    #if ENABLED(Z_IS_TMC2130)
163
+    #if AXIS_DRIVER_TYPE(Z, TMC2130)
164
       extern TMC2130Stepper stepperZ;
164
       extern TMC2130Stepper stepperZ;
165
-    #elif ENABLED(Z_IS_TMC2208)
165
+    #elif AXIS_DRIVER_TYPE(Z, TMC2208)
166
       extern TMC2208Stepper stepperZ;
166
       extern TMC2208Stepper stepperZ;
167
     #endif
167
     #endif
168
     #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
168
     #define Z_ENABLE_INIT SET_OUTPUT(Z_ENABLE_PIN)
179
 
179
 
180
 // X2 Stepper
180
 // X2 Stepper
181
 #if HAS_X2_ENABLE
181
 #if HAS_X2_ENABLE
182
-  #if ENABLED(X2_IS_L6470)
182
+  #if AXIS_DRIVER_TYPE(X2, L6470)
183
     extern L6470 stepperX2;
183
     extern L6470 stepperX2;
184
     #define X2_ENABLE_INIT NOOP
184
     #define X2_ENABLE_INIT NOOP
185
     #define X2_ENABLE_WRITE(STATE) do{ if (STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree(); }while(0)
185
     #define X2_ENABLE_WRITE(STATE) do{ if (STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree(); }while(0)
188
     #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE)
188
     #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE)
189
     #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR)
189
     #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR)
190
   #else
190
   #else
191
-    #if ENABLED(X2_IS_TMC26X)
191
+    #if AXIS_DRIVER_TYPE(X2, TMC26X)
192
       extern TMC26XStepper stepperX2;
192
       extern TMC26XStepper stepperX2;
193
       #define X2_ENABLE_INIT NOOP
193
       #define X2_ENABLE_INIT NOOP
194
       #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
194
       #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
195
       #define X2_ENABLE_READ stepperX2.isEnabled()
195
       #define X2_ENABLE_READ stepperX2.isEnabled()
196
     #else
196
     #else
197
-      #if ENABLED(X2_IS_TMC2130)
197
+      #if AXIS_DRIVER_TYPE(X2, TMC2130)
198
         extern TMC2130Stepper stepperX2;
198
         extern TMC2130Stepper stepperX2;
199
-      #elif ENABLED(X2_IS_TMC2208)
199
+      #elif AXIS_DRIVER_TYPE(X2, TMC2208)
200
         extern TMC2208Stepper stepperX2;
200
         extern TMC2208Stepper stepperX2;
201
       #endif
201
       #endif
202
       #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
202
       #define X2_ENABLE_INIT SET_OUTPUT(X2_ENABLE_PIN)
214
 
214
 
215
 // Y2 Stepper
215
 // Y2 Stepper
216
 #if HAS_Y2_ENABLE
216
 #if HAS_Y2_ENABLE
217
-  #if ENABLED(Y2_IS_L6470)
217
+  #if AXIS_DRIVER_TYPE(Y2, L6470)
218
     extern L6470 stepperY2;
218
     extern L6470 stepperY2;
219
     #define Y2_ENABLE_INIT NOOP
219
     #define Y2_ENABLE_INIT NOOP
220
     #define Y2_ENABLE_WRITE(STATE) do{ if (STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree(); }while(0)
220
     #define Y2_ENABLE_WRITE(STATE) do{ if (STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree(); }while(0)
223
     #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE)
223
     #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE)
224
     #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR)
224
     #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR)
225
   #else
225
   #else
226
-    #if ENABLED(Y2_IS_TMC26X)
226
+    #if AXIS_DRIVER_TYPE(Y2, TMC26X)
227
       extern TMC26XStepper stepperY2;
227
       extern TMC26XStepper stepperY2;
228
       #define Y2_ENABLE_INIT NOOP
228
       #define Y2_ENABLE_INIT NOOP
229
       #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
229
       #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
230
       #define Y2_ENABLE_READ stepperY2.isEnabled()
230
       #define Y2_ENABLE_READ stepperY2.isEnabled()
231
     #else
231
     #else
232
-      #if ENABLED(Y2_IS_TMC2130)
232
+      #if AXIS_DRIVER_TYPE(Y2, TMC2130)
233
         extern TMC2130Stepper stepperY2;
233
         extern TMC2130Stepper stepperY2;
234
-      #elif ENABLED(Y2_IS_TMC2208)
234
+      #elif AXIS_DRIVER_TYPE(Y2, TMC2208)
235
         extern TMC2208Stepper stepperY2;
235
         extern TMC2208Stepper stepperY2;
236
       #endif
236
       #endif
237
       #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
237
       #define Y2_ENABLE_INIT SET_OUTPUT(Y2_ENABLE_PIN)
249
 
249
 
250
 // Z2 Stepper
250
 // Z2 Stepper
251
 #if HAS_Z2_ENABLE
251
 #if HAS_Z2_ENABLE
252
-  #if ENABLED(Z2_IS_L6470)
252
+  #if AXIS_DRIVER_TYPE(Z2, L6470)
253
     extern L6470 stepperZ2;
253
     extern L6470 stepperZ2;
254
     #define Z2_ENABLE_INIT NOOP
254
     #define Z2_ENABLE_INIT NOOP
255
     #define Z2_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree(); }while(0)
255
     #define Z2_ENABLE_WRITE(STATE) do{ if (STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree(); }while(0)
258
     #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE)
258
     #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE)
259
     #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
259
     #define Z2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
260
   #else
260
   #else
261
-    #if ENABLED(Z2_IS_TMC26X)
261
+    #if AXIS_DRIVER_TYPE(Z2, TMC26X)
262
       extern TMC26XStepper stepperZ2;
262
       extern TMC26XStepper stepperZ2;
263
       #define Z2_ENABLE_INIT NOOP
263
       #define Z2_ENABLE_INIT NOOP
264
       #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
264
       #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
265
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
265
       #define Z2_ENABLE_READ stepperZ2.isEnabled()
266
     #else
266
     #else
267
-      #if ENABLED(Z2_IS_TMC2130)
267
+      #if AXIS_DRIVER_TYPE(Z2, TMC2130)
268
         extern TMC2130Stepper stepperZ2;
268
         extern TMC2130Stepper stepperZ2;
269
-      #elif ENABLED(Z2_IS_TMC2208)
269
+      #elif AXIS_DRIVER_TYPE(Z2, TMC2208)
270
         extern TMC2208Stepper stepperZ2;
270
         extern TMC2208Stepper stepperZ2;
271
       #endif
271
       #endif
272
       #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
272
       #define Z2_ENABLE_INIT SET_OUTPUT(Z2_ENABLE_PIN)
283
 #endif
283
 #endif
284
 
284
 
285
 // E0 Stepper
285
 // E0 Stepper
286
-#if ENABLED(E0_IS_L6470)
286
+#if AXIS_DRIVER_TYPE(E0, L6470)
287
   extern L6470 stepperE0;
287
   extern L6470 stepperE0;
288
   #define E0_ENABLE_INIT NOOP
288
   #define E0_ENABLE_INIT NOOP
289
   #define E0_ENABLE_WRITE(STATE) do{ if (STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree(); }while(0)
289
   #define E0_ENABLE_WRITE(STATE) do{ if (STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree(); }while(0)
292
   #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE)
292
   #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE)
293
   #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
293
   #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
294
 #else
294
 #else
295
-  #if ENABLED(E0_IS_TMC26X)
295
+  #if AXIS_DRIVER_TYPE(E0, TMC26X)
296
     extern TMC26XStepper stepperE0;
296
     extern TMC26XStepper stepperE0;
297
     #define E0_ENABLE_INIT NOOP
297
     #define E0_ENABLE_INIT NOOP
298
     #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
298
     #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
299
     #define E0_ENABLE_READ stepperE0.isEnabled()
299
     #define E0_ENABLE_READ stepperE0.isEnabled()
300
   #else
300
   #else
301
-    #if ENABLED(E0_IS_TMC2130)
301
+    #if AXIS_DRIVER_TYPE(E0, TMC2130)
302
       extern TMC2130Stepper stepperE0;
302
       extern TMC2130Stepper stepperE0;
303
-    #elif ENABLED(E0_IS_TMC2208)
303
+    #elif AXIS_DRIVER_TYPE(E0, TMC2208)
304
       extern TMC2208Stepper stepperE0;
304
       extern TMC2208Stepper stepperE0;
305
     #endif
305
     #endif
306
     #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
306
     #define E0_ENABLE_INIT SET_OUTPUT(E0_ENABLE_PIN)
316
 #define E0_STEP_READ READ(E0_STEP_PIN)
316
 #define E0_STEP_READ READ(E0_STEP_PIN)
317
 
317
 
318
 // E1 Stepper
318
 // E1 Stepper
319
-#if ENABLED(E1_IS_L6470)
319
+#if AXIS_DRIVER_TYPE(E1, L6470)
320
   extern L6470 stepperE1;
320
   extern L6470 stepperE1;
321
   #define E1_ENABLE_INIT NOOP
321
   #define E1_ENABLE_INIT NOOP
322
   #define E1_ENABLE_WRITE(STATE) do{ if (STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree(); }while(0)
322
   #define E1_ENABLE_WRITE(STATE) do{ if (STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree(); }while(0)
325
   #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE)
325
   #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE)
326
   #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
326
   #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
327
 #else
327
 #else
328
-  #if ENABLED(E1_IS_TMC26X)
328
+  #if AXIS_DRIVER_TYPE(E1, TMC26X)
329
     extern TMC26XStepper stepperE1;
329
     extern TMC26XStepper stepperE1;
330
     #define E1_ENABLE_INIT NOOP
330
     #define E1_ENABLE_INIT NOOP
331
     #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
331
     #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
332
     #define E1_ENABLE_READ stepperE1.isEnabled()
332
     #define E1_ENABLE_READ stepperE1.isEnabled()
333
   #else
333
   #else
334
-    #if ENABLED(E1_IS_TMC2130)
334
+    #if AXIS_DRIVER_TYPE(E1, TMC2130)
335
       extern TMC2130Stepper stepperE1;
335
       extern TMC2130Stepper stepperE1;
336
-    #elif ENABLED(E1_IS_TMC2208)
336
+    #elif AXIS_DRIVER_TYPE(E1, TMC2208)
337
       extern TMC2208Stepper stepperE1;
337
       extern TMC2208Stepper stepperE1;
338
     #endif
338
     #endif
339
     #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
339
     #define E1_ENABLE_INIT SET_OUTPUT(E1_ENABLE_PIN)
349
 #define E1_STEP_READ READ(E1_STEP_PIN)
349
 #define E1_STEP_READ READ(E1_STEP_PIN)
350
 
350
 
351
 // E2 Stepper
351
 // E2 Stepper
352
-#if ENABLED(E2_IS_L6470)
352
+#if AXIS_DRIVER_TYPE(E2, L6470)
353
   extern L6470 stepperE2;
353
   extern L6470 stepperE2;
354
   #define E2_ENABLE_INIT NOOP
354
   #define E2_ENABLE_INIT NOOP
355
   #define E2_ENABLE_WRITE(STATE) do{ if (STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree(); }while(0)
355
   #define E2_ENABLE_WRITE(STATE) do{ if (STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree(); }while(0)
358
   #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE)
358
   #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE)
359
   #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
359
   #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
360
 #else
360
 #else
361
-  #if ENABLED(E2_IS_TMC26X)
361
+  #if AXIS_DRIVER_TYPE(E2, TMC26X)
362
     extern TMC26XStepper stepperE2;
362
     extern TMC26XStepper stepperE2;
363
     #define E2_ENABLE_INIT NOOP
363
     #define E2_ENABLE_INIT NOOP
364
     #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
364
     #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
365
     #define E2_ENABLE_READ stepperE2.isEnabled()
365
     #define E2_ENABLE_READ stepperE2.isEnabled()
366
   #else
366
   #else
367
-    #if ENABLED(E2_IS_TMC2130)
367
+    #if AXIS_DRIVER_TYPE(E2, TMC2130)
368
       extern TMC2130Stepper stepperE2;
368
       extern TMC2130Stepper stepperE2;
369
-    #elif ENABLED(E2_IS_TMC2208)
369
+    #elif AXIS_DRIVER_TYPE(E2, TMC2208)
370
       extern TMC2208Stepper stepperE2;
370
       extern TMC2208Stepper stepperE2;
371
     #endif
371
     #endif
372
     #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
372
     #define E2_ENABLE_INIT SET_OUTPUT(E2_ENABLE_PIN)
382
 #define E2_STEP_READ READ(E2_STEP_PIN)
382
 #define E2_STEP_READ READ(E2_STEP_PIN)
383
 
383
 
384
 // E3 Stepper
384
 // E3 Stepper
385
-#if ENABLED(E3_IS_L6470)
385
+#if AXIS_DRIVER_TYPE(E3, L6470)
386
   extern L6470 stepperE3;
386
   extern L6470 stepperE3;
387
   #define E3_ENABLE_INIT NOOP
387
   #define E3_ENABLE_INIT NOOP
388
   #define E3_ENABLE_WRITE(STATE) do{ if (STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree(); }while(0)
388
   #define E3_ENABLE_WRITE(STATE) do{ if (STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree(); }while(0)
391
   #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE)
391
   #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE)
392
   #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR)
392
   #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR)
393
 #else
393
 #else
394
-  #if ENABLED(E3_IS_TMC26X)
394
+  #if AXIS_DRIVER_TYPE(E3, TMC26X)
395
     extern TMC26XStepper stepperE3;
395
     extern TMC26XStepper stepperE3;
396
     #define E3_ENABLE_INIT NOOP
396
     #define E3_ENABLE_INIT NOOP
397
     #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
397
     #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
398
     #define E3_ENABLE_READ stepperE3.isEnabled()
398
     #define E3_ENABLE_READ stepperE3.isEnabled()
399
   #else
399
   #else
400
-    #if ENABLED(E3_IS_TMC2130)
400
+    #if AXIS_DRIVER_TYPE(E3, TMC2130)
401
       extern TMC2130Stepper stepperE3;
401
       extern TMC2130Stepper stepperE3;
402
-    #elif ENABLED(E3_IS_TMC2208)
402
+    #elif AXIS_DRIVER_TYPE(E3, TMC2208)
403
       extern TMC2208Stepper stepperE3;
403
       extern TMC2208Stepper stepperE3;
404
     #endif
404
     #endif
405
     #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
405
     #define E3_ENABLE_INIT SET_OUTPUT(E3_ENABLE_PIN)
415
 #define E3_STEP_READ READ(E3_STEP_PIN)
415
 #define E3_STEP_READ READ(E3_STEP_PIN)
416
 
416
 
417
 // E4 Stepper
417
 // E4 Stepper
418
-#if ENABLED(E4_IS_L6470)
418
+#if AXIS_DRIVER_TYPE(E4, L6470)
419
   extern L6470 stepperE4;
419
   extern L6470 stepperE4;
420
   #define E4_ENABLE_INIT NOOP
420
   #define E4_ENABLE_INIT NOOP
421
   #define E4_ENABLE_WRITE(STATE) do{ if (STATE) stepperE4.Step_Clock(stepperE4.getStatus() & STATUS_HIZ); else stepperE4.softFree(); }while(0)
421
   #define E4_ENABLE_WRITE(STATE) do{ if (STATE) stepperE4.Step_Clock(stepperE4.getStatus() & STATUS_HIZ); else stepperE4.softFree(); }while(0)
424
   #define E4_DIR_WRITE(STATE) stepperE4.Step_Clock(STATE)
424
   #define E4_DIR_WRITE(STATE) stepperE4.Step_Clock(STATE)
425
   #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR)
425
   #define E4_DIR_READ (stepperE4.getStatus() & STATUS_DIR)
426
 #else
426
 #else
427
-  #if ENABLED(E4_IS_TMC26X)
427
+  #if AXIS_DRIVER_TYPE(E4, TMC26X)
428
     extern TMC26XStepper stepperE4;
428
     extern TMC26XStepper stepperE4;
429
     #define E4_ENABLE_INIT NOOP
429
     #define E4_ENABLE_INIT NOOP
430
     #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE)
430
     #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE)
431
     #define E4_ENABLE_READ stepperE4.isEnabled()
431
     #define E4_ENABLE_READ stepperE4.isEnabled()
432
   #else
432
   #else
433
-    #if ENABLED(E4_IS_TMC2130)
433
+    #if AXIS_DRIVER_TYPE(E4, TMC2130)
434
       extern TMC2130Stepper stepperE4;
434
       extern TMC2130Stepper stepperE4;
435
-    #elif ENABLED(E4_IS_TMC2208)
435
+    #elif AXIS_DRIVER_TYPE(E4, TMC2208)
436
       extern TMC2208Stepper stepperE4;
436
       extern TMC2208Stepper stepperE4;
437
     #endif
437
     #endif
438
     #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN)
438
     #define E4_ENABLE_INIT SET_OUTPUT(E4_ENABLE_PIN)

+ 2
- 4
Marlin/src/pins/pins_EINSY_RAMBO.h View File

33
 //
33
 //
34
 // TMC2130 Configuration_adv defaults for EinsyRambo
34
 // TMC2130 Configuration_adv defaults for EinsyRambo
35
 //
35
 //
36
-#if DISABLED(HAVE_TMC2130)
37
-  #error "You must enable TMC2130 support in Configuration_adv.h for EinsyRambo."
38
-#elif DISABLED(X_IS_TMC2130) || DISABLED(Y_IS_TMC2130) || DISABLED(Z_IS_TMC2130) || DISABLED(E0_IS_TMC2130)
39
-  #error "You must enable ([XYZ]|E0)_IS_TMC2130 in Configuration_adv.h for EinsyRambo."
36
+#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130)
37
+  #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRambo."
40
 #endif
38
 #endif
41
 
39
 
42
 // TMC2130 Diag Pins (currently just for reference)
40
 // TMC2130 Diag Pins (currently just for reference)

+ 2
- 4
Marlin/src/pins/pins_EINSY_RETRO.h View File

33
 //
33
 //
34
 // TMC2130 Configuration_adv defaults for EinsyRetro
34
 // TMC2130 Configuration_adv defaults for EinsyRetro
35
 //
35
 //
36
-#if DISABLED(HAVE_TMC2130)
37
-  #error "You must enable TMC2130 support in Configuration_adv.h for EinsyRetro."
38
-#elif DISABLED(X_IS_TMC2130) || DISABLED(Y_IS_TMC2130) || DISABLED(Z_IS_TMC2130) || DISABLED(E0_IS_TMC2130)
39
-  #error "You must enable ([XYZ]|E0)_IS_TMC2130 in Configuration_adv.h for EinsyRetro."
36
+#if !AXIS_DRIVER_TYPE(X, TMC2130) || !AXIS_DRIVER_TYPE(Y, TMC2130) || !AXIS_DRIVER_TYPE(Z, TMC2130) || !AXIS_DRIVER_TYPE(E0, TMC2130)
37
+  #error "You must set ([XYZ]|E0)_DRIVER_TYPE to TMC2130 in Configuration.h for EinsyRetro."
40
 #endif
38
 #endif
41
 
39
 
42
 // TMC2130 Diag Pins (currently just for reference)
40
 // TMC2130 Diag Pins (currently just for reference)

+ 1
- 1
Marlin/src/pins/pins_RAMPS.h View File

146
   #endif
146
   #endif
147
 #endif
147
 #endif
148
 
148
 
149
-#if ENABLED(HAVE_TMC2208)
149
+#if HAS_DRIVER(TMC2208)
150
   /**
150
   /**
151
    * TMC2208 stepper drivers
151
    * TMC2208 stepper drivers
152
    *
152
    *

+ 1
- 1
Marlin/src/pins/pins_RAMPS_FD_V1.h View File

178
 
178
 
179
 #endif // ULTRA_LCD
179
 #endif // ULTRA_LCD
180
 
180
 
181
-#if ENABLED(HAVE_TMC2208)
181
+#if HAS_DRIVER(TMC2208)
182
   /**
182
   /**
183
    * TMC2208 stepper drivers
183
    * TMC2208 stepper drivers
184
    *
184
    *

+ 8
- 2
buildroot/share/tests/megaatmega2560_tests View File

287
 #
287
 #
288
 use_example_configs SCARA
288
 use_example_configs SCARA
289
 opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER
289
 opt_enable AUTO_BED_LEVELING_BILINEAR FIX_MOUNTED_PROBE USE_ZMIN_PLUG EEPROM_SETTINGS EEPROM_CHITCHAT ULTIMAKERCONTROLLER
290
-opt_enable_adv HAVE_TMC2130 X_IS_TMC2130 Y_IS_TMC2130 Z_IS_TMC2130
290
+opt_set X_DRIVER_TYPE TMC2130
291
+opt_set Y_DRIVER_TYPE TMC2130
292
+opt_set Z_DRIVER_TYPE TMC2130
293
+opt_set E0_DRIVER_TYPE TMC2130
291
 opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING
294
 opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD SENSORLESS_HOMING
292
 exec_test $1 $2 "SCARA with TMC2130"
295
 exec_test $1 $2 "SCARA with TMC2130"
293
 #
296
 #
294
 # TMC2208 Config
297
 # TMC2208 Config
295
 #
298
 #
296
 restore_configs
299
 restore_configs
297
-opt_enable_adv HAVE_TMC2208 X_IS_TMC2208 Y_IS_TMC2208 Z_IS_TMC2208
300
+opt_set X_DRIVER_TYPE TMC2208
301
+opt_set Y_DRIVER_TYPE TMC2208
302
+opt_set Z_DRIVER_TYPE TMC2208
303
+opt_set E0_DRIVER_TYPE TMC2208
298
 opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG
304
 opt_enable_adv MONITOR_DRIVER_STATUS STEALTHCHOP HYBRID_THRESHOLD TMC_DEBUG
299
 exec_test $1 $2 "TMC2208 Config"
305
 exec_test $1 $2 "TMC2208 Config"
300
 #
306
 #

Loading…
Cancel
Save