My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #pragma once
  23. /**
  24. * stepper/TMC26X.h
  25. * Stepper driver indirection for TMC26X drivers
  26. */
  27. #include "../../inc/MarlinConfig.h"
  28. // TMC26X drivers have STEP/DIR on normal pins, but ENABLE via SPI
  29. #include <SPI.h>
  30. #if defined(STM32GENERIC) && defined(STM32F7)
  31. #include "../../HAL/HAL_STM32_F4_F7/STM32F7/TMC2660.h"
  32. #else
  33. #include <TMC26XStepper.h>
  34. #endif
  35. void tmc26x_init_to_defaults();
  36. // X Stepper
  37. #if AXIS_DRIVER_TYPE_X(TMC26X)
  38. extern TMC26XStepper stepperX;
  39. #define X_ENABLE_INIT() NOOP
  40. #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
  41. #define X_ENABLE_READ() stepperX.isEnabled()
  42. #endif
  43. // Y Stepper
  44. #if AXIS_DRIVER_TYPE_Y(TMC26X)
  45. extern TMC26XStepper stepperY;
  46. #define Y_ENABLE_INIT() NOOP
  47. #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
  48. #define Y_ENABLE_READ() stepperY.isEnabled()
  49. #endif
  50. // Z Stepper
  51. #if AXIS_DRIVER_TYPE_Z(TMC26X)
  52. extern TMC26XStepper stepperZ;
  53. #define Z_ENABLE_INIT() NOOP
  54. #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
  55. #define Z_ENABLE_READ() stepperZ.isEnabled()
  56. #endif
  57. // X2 Stepper
  58. #if HAS_X2_ENABLE && AXIS_DRIVER_TYPE_X2(TMC26X)
  59. extern TMC26XStepper stepperX2;
  60. #define X2_ENABLE_INIT() NOOP
  61. #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
  62. #define X2_ENABLE_READ() stepperX2.isEnabled()
  63. #endif
  64. // Y2 Stepper
  65. #if HAS_Y2_ENABLE && AXIS_DRIVER_TYPE_Y2(TMC26X)
  66. extern TMC26XStepper stepperY2;
  67. #define Y2_ENABLE_INIT() NOOP
  68. #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
  69. #define Y2_ENABLE_READ() stepperY2.isEnabled()
  70. #endif
  71. // Z2 Stepper
  72. #if HAS_Z2_ENABLE && AXIS_DRIVER_TYPE_Z2(TMC26X)
  73. extern TMC26XStepper stepperZ2;
  74. #define Z2_ENABLE_INIT() NOOP
  75. #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
  76. #define Z2_ENABLE_READ() stepperZ2.isEnabled()
  77. #endif
  78. // Z3 Stepper
  79. #if HAS_Z3_ENABLE && AXIS_DRIVER_TYPE_Z3(TMC26X)
  80. extern TMC26XStepper stepperZ3;
  81. #define Z3_ENABLE_INIT() NOOP
  82. #define Z3_ENABLE_WRITE(STATE) stepperZ3.setEnabled(STATE)
  83. #define Z3_ENABLE_READ() stepperZ3.isEnabled()
  84. #endif
  85. // Z4 Stepper
  86. #if HAS_Z4_ENABLE && AXIS_DRIVER_TYPE_Z4(TMC26X)
  87. extern TMC26XStepper stepperZ4;
  88. #define Z4_ENABLE_INIT() NOOP
  89. #define Z4_ENABLE_WRITE(STATE) stepperZ4.setEnabled(STATE)
  90. #define Z4_ENABLE_READ() stepperZ4.isEnabled()
  91. #endif
  92. // E0 Stepper
  93. #if AXIS_DRIVER_TYPE_E0(TMC26X)
  94. extern TMC26XStepper stepperE0;
  95. #define E0_ENABLE_INIT() NOOP
  96. #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
  97. #define E0_ENABLE_READ() stepperE0.isEnabled()
  98. #endif
  99. // E1 Stepper
  100. #if AXIS_DRIVER_TYPE_E1(TMC26X)
  101. extern TMC26XStepper stepperE1;
  102. #define E1_ENABLE_INIT() NOOP
  103. #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
  104. #define E1_ENABLE_READ() stepperE1.isEnabled()
  105. #endif
  106. // E2 Stepper
  107. #if AXIS_DRIVER_TYPE_E2(TMC26X)
  108. extern TMC26XStepper stepperE2;
  109. #define E2_ENABLE_INIT() NOOP
  110. #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
  111. #define E2_ENABLE_READ() stepperE2.isEnabled()
  112. #endif
  113. // E3 Stepper
  114. #if AXIS_DRIVER_TYPE_E3(TMC26X)
  115. extern TMC26XStepper stepperE3;
  116. #define E3_ENABLE_INIT() NOOP
  117. #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
  118. #define E3_ENABLE_READ() stepperE3.isEnabled()
  119. #endif
  120. // E4 Stepper
  121. #if AXIS_DRIVER_TYPE_E4(TMC26X)
  122. extern TMC26XStepper stepperE4;
  123. #define E4_ENABLE_INIT() NOOP
  124. #define E4_ENABLE_WRITE(STATE) stepperE4.setEnabled(STATE)
  125. #define E4_ENABLE_READ() stepperE4.isEnabled()
  126. #endif
  127. // E5 Stepper
  128. #if AXIS_DRIVER_TYPE_E5(TMC26X)
  129. extern TMC26XStepper stepperE5;
  130. #define E5_ENABLE_INIT() NOOP
  131. #define E5_ENABLE_WRITE(STATE) stepperE5.setEnabled(STATE)
  132. #define E5_ENABLE_READ() stepperE5.isEnabled()
  133. #endif
  134. // E6 Stepper
  135. #if AXIS_DRIVER_TYPE_E6(TMC26X)
  136. extern TMC26XStepper stepperE6;
  137. #define E6_ENABLE_INIT() NOOP
  138. #define E6_ENABLE_WRITE(STATE) stepperE6.setEnabled(STATE)
  139. #define E6_ENABLE_READ() stepperE6.isEnabled()
  140. #endif
  141. // E7 Stepper
  142. #if AXIS_DRIVER_TYPE_E7(TMC26X)
  143. extern TMC26XStepper stepperE7;
  144. #define E7_ENABLE_INIT() NOOP
  145. #define E7_ENABLE_WRITE(STATE) stepperE7.setEnabled(STATE)
  146. #define E7_ENABLE_READ() stepperE7.isEnabled()
  147. #endif