My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stepper_indirection.cpp 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * stepper_indirection.cpp
  24. *
  25. * Stepper motor driver indirection to allow some stepper functions to
  26. * be done via SPI/I2c instead of direct pin manipulation.
  27. *
  28. * Part of Marlin
  29. *
  30. * Copyright (c) 2015 Dominik Wenger
  31. */
  32. #include "stepper_indirection.h"
  33. #include "MarlinConfig.h"
  34. //
  35. // TMC26X Driver objects and inits
  36. //
  37. #if ENABLED(HAVE_TMCDRIVER)
  38. #include <SPI.h>
  39. #include <TMC26XStepper.h>
  40. #define _TMC_DEFINE(ST) TMC26XStepper stepper##ST(200, ST##_ENABLE_PIN, ST##_STEP_PIN, ST##_DIR_PIN, ST##_MAX_CURRENT, ST##_SENSE_RESISTOR)
  41. #if ENABLED(X_IS_TMC)
  42. _TMC_DEFINE(X);
  43. #endif
  44. #if ENABLED(X2_IS_TMC)
  45. _TMC_DEFINE(X2);
  46. #endif
  47. #if ENABLED(Y_IS_TMC)
  48. _TMC_DEFINE(Y);
  49. #endif
  50. #if ENABLED(Y2_IS_TMC)
  51. _TMC_DEFINE(Y2);
  52. #endif
  53. #if ENABLED(Z_IS_TMC)
  54. _TMC_DEFINE(Z);
  55. #endif
  56. #if ENABLED(Z2_IS_TMC)
  57. _TMC_DEFINE(Z2);
  58. #endif
  59. #if ENABLED(E0_IS_TMC)
  60. _TMC_DEFINE(E0);
  61. #endif
  62. #if ENABLED(E1_IS_TMC)
  63. _TMC_DEFINE(E1);
  64. #endif
  65. #if ENABLED(E2_IS_TMC)
  66. _TMC_DEFINE(E2);
  67. #endif
  68. #if ENABLED(E3_IS_TMC)
  69. _TMC_DEFINE(E3);
  70. #endif
  71. #if ENABLED(E4_IS_TMC)
  72. _TMC_DEFINE(E4);
  73. #endif
  74. #define _TMC_INIT(A) do{ \
  75. stepper##A.setMicrosteps(A##_MICROSTEPS); \
  76. stepper##A.start(); \
  77. }while(0)
  78. void tmc_init() {
  79. #if ENABLED(X_IS_TMC)
  80. _TMC_INIT(X);
  81. #endif
  82. #if ENABLED(X2_IS_TMC)
  83. _TMC_INIT(X2);
  84. #endif
  85. #if ENABLED(Y_IS_TMC)
  86. _TMC_INIT(Y);
  87. #endif
  88. #if ENABLED(Y2_IS_TMC)
  89. _TMC_INIT(Y2);
  90. #endif
  91. #if ENABLED(Z_IS_TMC)
  92. _TMC_INIT(Z);
  93. #endif
  94. #if ENABLED(Z2_IS_TMC)
  95. _TMC_INIT(Z2);
  96. #endif
  97. #if ENABLED(E0_IS_TMC)
  98. _TMC_INIT(E0);
  99. #endif
  100. #if ENABLED(E1_IS_TMC)
  101. _TMC_INIT(E1);
  102. #endif
  103. #if ENABLED(E2_IS_TMC)
  104. _TMC_INIT(E2);
  105. #endif
  106. #if ENABLED(E3_IS_TMC)
  107. _TMC_INIT(E3);
  108. #endif
  109. #if ENABLED(E4_IS_TMC)
  110. _TMC_INIT(E4);
  111. #endif
  112. }
  113. #endif // HAVE_TMCDRIVER
  114. //
  115. // TMC2130 Driver objects and inits
  116. //
  117. #if ENABLED(HAVE_TMC2130)
  118. #include <SPI.h>
  119. #include <TMC2130Stepper.h>
  120. #include "planner.h"
  121. #include "enum.h"
  122. #define _TMC2130_DEFINE(ST) TMC2130Stepper stepper##ST(ST##_ENABLE_PIN, ST##_DIR_PIN, ST##_STEP_PIN, ST##_CS_PIN)
  123. // Stepper objects of TMC2130 steppers used
  124. #if ENABLED(X_IS_TMC2130)
  125. _TMC2130_DEFINE(X);
  126. #endif
  127. #if ENABLED(X2_IS_TMC2130)
  128. _TMC2130_DEFINE(X2);
  129. #endif
  130. #if ENABLED(Y_IS_TMC2130)
  131. _TMC2130_DEFINE(Y);
  132. #endif
  133. #if ENABLED(Y2_IS_TMC2130)
  134. _TMC2130_DEFINE(Y2);
  135. #endif
  136. #if ENABLED(Z_IS_TMC2130)
  137. _TMC2130_DEFINE(Z);
  138. #endif
  139. #if ENABLED(Z2_IS_TMC2130)
  140. _TMC2130_DEFINE(Z2);
  141. #endif
  142. #if ENABLED(E0_IS_TMC2130)
  143. _TMC2130_DEFINE(E0);
  144. #endif
  145. #if ENABLED(E1_IS_TMC2130)
  146. _TMC2130_DEFINE(E1);
  147. #endif
  148. #if ENABLED(E2_IS_TMC2130)
  149. _TMC2130_DEFINE(E2);
  150. #endif
  151. #if ENABLED(E3_IS_TMC2130)
  152. _TMC2130_DEFINE(E3);
  153. #endif
  154. #if ENABLED(E4_IS_TMC2130)
  155. _TMC2130_DEFINE(E4);
  156. #endif
  157. // Use internal reference voltage for current calculations. This is the default.
  158. // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
  159. // https://www.trinamic.com/products/integrated-circuits/details/tmc2130/
  160. void tmc2130_init(TMC2130Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float spmm) {
  161. st.begin();
  162. st.setCurrent(st.getCurrent(), R_SENSE, HOLD_MULTIPLIER);
  163. st.microsteps(microsteps);
  164. st.blank_time(24);
  165. st.off_time(5); // Only enables the driver if used with stealthChop
  166. st.interpolate(INTERPOLATE);
  167. st.power_down_delay(128); // ~2s until driver lowers to hold current
  168. st.hysterisis_start(3);
  169. st.hysterisis_end(2);
  170. st.diag1_active_high(1); // For sensorless homing
  171. #if ENABLED(STEALTHCHOP)
  172. st.stealth_freq(1); // f_pwm = 2/683 f_clk
  173. st.stealth_autoscale(1);
  174. st.stealth_gradient(5);
  175. st.stealth_amplitude(255);
  176. st.stealthChop(1);
  177. #if ENABLED(HYBRID_THRESHOLD)
  178. st.stealth_max_speed(12650000UL*microsteps/(256*thrs*spmm));
  179. #else
  180. UNUSED(thrs);
  181. UNUSED(spmm);
  182. #endif
  183. #elif ENABLED(SENSORLESS_HOMING)
  184. st.coolstep_min_speed(1024UL * 1024UL - 1UL);
  185. #endif
  186. st.GSTAT(); // Clear GSTAT
  187. }
  188. #define _TMC2130_INIT(ST, SPMM) tmc2130_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
  189. void tmc2130_init() {
  190. #if ENABLED(X_IS_TMC2130)
  191. _TMC2130_INIT( X, planner.axis_steps_per_mm[X_AXIS]);
  192. #endif
  193. #if ENABLED(X2_IS_TMC2130)
  194. _TMC2130_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
  195. #endif
  196. #if ENABLED(Y_IS_TMC2130)
  197. _TMC2130_INIT( Y, planner.axis_steps_per_mm[Y_AXIS]);
  198. #endif
  199. #if ENABLED(Y2_IS_TMC2130)
  200. _TMC2130_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
  201. #endif
  202. #if ENABLED(Z_IS_TMC2130)
  203. _TMC2130_INIT( Z, planner.axis_steps_per_mm[Z_AXIS]);
  204. #endif
  205. #if ENABLED(Z2_IS_TMC2130)
  206. _TMC2130_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
  207. #endif
  208. #if ENABLED(E0_IS_TMC2130)
  209. _TMC2130_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
  210. #endif
  211. #if ENABLED(E1_IS_TMC2130)
  212. { constexpr int extruder = 1; _TMC2130_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
  213. #endif
  214. #if ENABLED(E2_IS_TMC2130)
  215. { constexpr int extruder = 2; _TMC2130_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
  216. #endif
  217. #if ENABLED(E3_IS_TMC2130)
  218. { constexpr int extruder = 3; _TMC2130_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
  219. #endif
  220. #if ENABLED(E4_IS_TMC2130)
  221. { constexpr int extruder = 4; _TMC2130_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
  222. #endif
  223. }
  224. #endif // HAVE_TMC2130
  225. //
  226. // TMC2208 Driver objects and inits
  227. //
  228. #if ENABLED(HAVE_TMC2208)
  229. #include <SoftwareSerial.h>
  230. #include <HardwareSerial.h>
  231. #include <TMC2208Stepper.h>
  232. #include "planner.h"
  233. #define _TMC2208_DEFINE_HARDWARE(ST) TMC2208Stepper stepper##ST(&ST##_HARDWARE_SERIAL)
  234. #define _TMC2208_DEFINE_SOFTWARE(ST) SoftwareSerial stepper##ST##_serial = SoftwareSerial(ST##_SERIAL_RX_PIN, ST##_SERIAL_TX_PIN); \
  235. TMC2208Stepper stepper##ST(&stepper##ST##_serial, ST##_SERIAL_RX_PIN > -1)
  236. // Stepper objects of TMC2208 steppers used
  237. #if ENABLED(X_IS_TMC2208)
  238. #if defined(X_HARDWARE_SERIAL)
  239. _TMC2208_DEFINE_HARDWARE(X);
  240. #else
  241. _TMC2208_DEFINE_SOFTWARE(X);
  242. #endif
  243. #endif
  244. #if ENABLED(X2_IS_TMC2208)
  245. #if defined(X2_HARDWARE_SERIAL)
  246. _TMC2208_DEFINE_HARDWARE(X2);
  247. #else
  248. _TMC2208_DEFINE_SOFTWARE(X2);
  249. #endif
  250. #endif
  251. #if ENABLED(Y_IS_TMC2208)
  252. #if defined(Y_HARDWARE_SERIAL)
  253. _TMC2208_DEFINE_HARDWARE(Y);
  254. #else
  255. _TMC2208_DEFINE_SOFTWARE(Y);
  256. #endif
  257. #endif
  258. #if ENABLED(Y2_IS_TMC2208)
  259. #if defined(Y2_HARDWARE_SERIAL)
  260. _TMC2208_DEFINE_HARDWARE(Y2);
  261. #else
  262. _TMC2208_DEFINE_SOFTWARE(Y2);
  263. #endif
  264. #endif
  265. #if ENABLED(Z_IS_TMC2208)
  266. #if defined(Z_HARDWARE_SERIAL)
  267. _TMC2208_DEFINE_HARDWARE(Z);
  268. #else
  269. _TMC2208_DEFINE_SOFTWARE(Z);
  270. #endif
  271. #endif
  272. #if ENABLED(Z2_IS_TMC2208)
  273. #if defined(Z2_HARDWARE_SERIAL)
  274. _TMC2208_DEFINE_HARDWARE(Z2);
  275. #else
  276. _TMC2208_DEFINE_SOFTWARE(Z2);
  277. #endif
  278. #endif
  279. #if ENABLED(E0_IS_TMC2208)
  280. #if defined(E0_HARDWARE_SERIAL)
  281. _TMC2208_DEFINE_HARDWARE(E0);
  282. #else
  283. _TMC2208_DEFINE_SOFTWARE(E0);
  284. #endif
  285. #endif
  286. #if ENABLED(E1_IS_TMC2208)
  287. #if defined(E1_HARDWARE_SERIAL)
  288. _TMC2208_DEFINE_HARDWARE(E1);
  289. #else
  290. _TMC2208_DEFINE_SOFTWARE(E1);
  291. #endif
  292. #endif
  293. #if ENABLED(E2_IS_TMC2208)
  294. #if defined(E2_HARDWARE_SERIAL)
  295. _TMC2208_DEFINE_HARDWARE(E2);
  296. #else
  297. _TMC2208_DEFINE_SOFTWARE(E2);
  298. #endif
  299. #endif
  300. #if ENABLED(E3_IS_TMC2208)
  301. #if defined(E3_HARDWARE_SERIAL)
  302. _TMC2208_DEFINE_HARDWARE(E3);
  303. #else
  304. _TMC2208_DEFINE_SOFTWARE(E3);
  305. #endif
  306. #endif
  307. #if ENABLED(E4_IS_TMC2208)
  308. #if defined(E4_HARDWARE_SERIAL)
  309. _TMC2208_DEFINE_HARDWARE(E4);
  310. #else
  311. _TMC2208_DEFINE_SOFTWARE(E4);
  312. #endif
  313. #endif
  314. void tmc2208_serial_begin() {
  315. #if ENABLED(X_IS_TMC2208) && defined(X_HARDWARE_SERIAL)
  316. X_HARDWARE_SERIAL.begin(250000);
  317. #endif
  318. #if ENABLED(X2_IS_TMC2208) && defined(X2_HARDWARE_SERIAL)
  319. X2_HARDWARE_SERIAL.begin(250000);
  320. #endif
  321. #if ENABLED(Y_IS_TMC2208) && defined(Y_HARDWARE_SERIAL)
  322. Y_HARDWARE_SERIAL.begin(250000);
  323. #endif
  324. #if ENABLED(Y2_IS_TMC2208) && defined(Y2_HARDWARE_SERIAL)
  325. Y2_HARDWARE_SERIAL.begin(250000);
  326. #endif
  327. #if ENABLED(Z_IS_TMC2208) && defined(Z_HARDWARE_SERIAL)
  328. Z_HARDWARE_SERIAL.begin(250000);
  329. #endif
  330. #if ENABLED(Z2_IS_TMC2208) && defined(Z2_HARDWARE_SERIAL)
  331. Z2_HARDWARE_SERIAL.begin(250000);
  332. #endif
  333. #if ENABLED(E0_IS_TMC2208) && defined(E0_HARDWARE_SERIAL)
  334. E0_HARDWARE_SERIAL.begin(250000);
  335. #endif
  336. #if ENABLED(E1_IS_TMC2208) && defined(E1_HARDWARE_SERIAL)
  337. E1_HARDWARE_SERIAL.begin(250000);
  338. #endif
  339. #if ENABLED(E2_IS_TMC2208) && defined(E2_HARDWARE_SERIAL)
  340. E2_HARDWARE_SERIAL.begin(250000);
  341. #endif
  342. #if ENABLED(E3_IS_TMC2208) && defined(E3_HARDWARE_SERIAL)
  343. E3_HARDWARE_SERIAL.begin(250000);
  344. #endif
  345. #if ENABLED(E4_IS_TMC2208) && defined(E4_HARDWARE_SERIAL)
  346. E4_HARDWARE_SERIAL.begin(250000);
  347. #endif
  348. }
  349. // Use internal reference voltage for current calculations. This is the default.
  350. // Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
  351. void tmc2208_init(TMC2208Stepper &st, const uint16_t microsteps, const uint32_t thrs, const float spmm) {
  352. st.pdn_disable(true); // Use UART
  353. st.mstep_reg_select(true); // Select microsteps with UART
  354. st.I_scale_analog(false);
  355. st.rms_current(st.getCurrent(), HOLD_MULTIPLIER, R_SENSE);
  356. st.microsteps(microsteps);
  357. st.blank_time(24);
  358. st.toff(5);
  359. st.intpol(INTERPOLATE);
  360. st.TPOWERDOWN(128); // ~2s until driver lowers to hold current
  361. st.hysterisis_start(3);
  362. st.hysterisis_end(2);
  363. #if ENABLED(STEALTHCHOP)
  364. st.pwm_lim(12);
  365. st.pwm_reg(8);
  366. st.pwm_autograd(1);
  367. st.pwm_autoscale(1);
  368. st.pwm_freq(1);
  369. st.pwm_grad(14);
  370. st.pwm_ofs(36);
  371. st.en_spreadCycle(false);
  372. #if ENABLED(HYBRID_THRESHOLD)
  373. st.TPWMTHRS(12650000UL*microsteps/(256*thrs*spmm));
  374. #else
  375. UNUSED(thrs);
  376. UNUSED(spmm);
  377. #endif
  378. #else
  379. st.en_spreadCycle(true);
  380. #endif
  381. st.GSTAT(0b111); // Clear
  382. delay(200);
  383. }
  384. #define _TMC2208_INIT(ST, SPMM) tmc2208_init(stepper##ST, ST##_MICROSTEPS, ST##_HYBRID_THRESHOLD, SPMM)
  385. void tmc2208_init() {
  386. #if ENABLED(X_IS_TMC2208)
  387. _TMC2208_INIT(X, planner.axis_steps_per_mm[X_AXIS]);
  388. #endif
  389. #if ENABLED(X2_IS_TMC2208)
  390. _TMC2208_INIT(X2, planner.axis_steps_per_mm[X_AXIS]);
  391. #endif
  392. #if ENABLED(Y_IS_TMC2208)
  393. _TMC2208_INIT(Y, planner.axis_steps_per_mm[Y_AXIS]);
  394. #endif
  395. #if ENABLED(Y2_IS_TMC2208)
  396. _TMC2208_INIT(Y2, planner.axis_steps_per_mm[Y_AXIS]);
  397. #endif
  398. #if ENABLED(Z_IS_TMC2208)
  399. _TMC2208_INIT(Z, planner.axis_steps_per_mm[Z_AXIS]);
  400. #endif
  401. #if ENABLED(Z2_IS_TMC2208)
  402. _TMC2208_INIT(Z2, planner.axis_steps_per_mm[Z_AXIS]);
  403. #endif
  404. #if ENABLED(E0_IS_TMC2208)
  405. _TMC2208_INIT(E0, planner.axis_steps_per_mm[E_AXIS]);
  406. #endif
  407. #if ENABLED(E1_IS_TMC2208)
  408. { constexpr int extruder = 1; _TMC2208_INIT(E1, planner.axis_steps_per_mm[E_AXIS_N]); }
  409. #endif
  410. #if ENABLED(E2_IS_TMC2208)
  411. { constexpr int extruder = 2; _TMC2208_INIT(E2, planner.axis_steps_per_mm[E_AXIS_N]); }
  412. #endif
  413. #if ENABLED(E3_IS_TMC2208)
  414. { constexpr int extruder = 3; _TMC2208_INIT(E3, planner.axis_steps_per_mm[E_AXIS_N]); }
  415. #endif
  416. #if ENABLED(E4_IS_TMC2208)
  417. { constexpr int extruder = 4; _TMC2208_INIT(E4, planner.axis_steps_per_mm[E_AXIS_N]); }
  418. #endif
  419. }
  420. #endif // HAVE_TMC2208
  421. //
  422. // L6470 Driver objects and inits
  423. //
  424. #if ENABLED(HAVE_L6470DRIVER)
  425. #include <SPI.h>
  426. #include <L6470.h>
  427. #define _L6470_DEFINE(ST) L6470 stepper##ST(ST##_ENABLE_PIN)
  428. // L6470 Stepper objects
  429. #if ENABLED(X_IS_L6470)
  430. _L6470_DEFINE(X);
  431. #endif
  432. #if ENABLED(X2_IS_L6470)
  433. _L6470_DEFINE(X2);
  434. #endif
  435. #if ENABLED(Y_IS_L6470)
  436. _L6470_DEFINE(Y);
  437. #endif
  438. #if ENABLED(Y2_IS_L6470)
  439. _L6470_DEFINE(Y2);
  440. #endif
  441. #if ENABLED(Z_IS_L6470)
  442. _L6470_DEFINE(Z);
  443. #endif
  444. #if ENABLED(Z2_IS_L6470)
  445. _L6470_DEFINE(Z2);
  446. #endif
  447. #if ENABLED(E0_IS_L6470)
  448. _L6470_DEFINE(E0);
  449. #endif
  450. #if ENABLED(E1_IS_L6470)
  451. _L6470_DEFINE(E1);
  452. #endif
  453. #if ENABLED(E2_IS_L6470)
  454. _L6470_DEFINE(E2);
  455. #endif
  456. #if ENABLED(E3_IS_L6470)
  457. _L6470_DEFINE(E3);
  458. #endif
  459. #if ENABLED(E4_IS_L6470)
  460. _L6470_DEFINE(E4);
  461. #endif
  462. #define _L6470_INIT(A) do{ \
  463. stepper##A.init(A##_K_VAL); \
  464. stepper##A.softFree(); \
  465. stepper##A.setMicroSteps(A##_MICROSTEPS); \
  466. stepper##A.setOverCurrent(A##_OVERCURRENT); \
  467. stepper##A.setStallCurrent(A##_STALLCURRENT); \
  468. }while(0)
  469. void L6470_init() {
  470. #if ENABLED(X_IS_L6470)
  471. _L6470_INIT(X);
  472. #endif
  473. #if ENABLED(X2_IS_L6470)
  474. _L6470_INIT(X2);
  475. #endif
  476. #if ENABLED(Y_IS_L6470)
  477. _L6470_INIT(Y);
  478. #endif
  479. #if ENABLED(Y2_IS_L6470)
  480. _L6470_INIT(Y2);
  481. #endif
  482. #if ENABLED(Z_IS_L6470)
  483. _L6470_INIT(Z);
  484. #endif
  485. #if ENABLED(Z2_IS_L6470)
  486. _L6470_INIT(Z2);
  487. #endif
  488. #if ENABLED(E0_IS_L6470)
  489. _L6470_INIT(E0);
  490. #endif
  491. #if ENABLED(E1_IS_L6470)
  492. _L6470_INIT(E1);
  493. #endif
  494. #if ENABLED(E2_IS_L6470)
  495. _L6470_INIT(E2);
  496. #endif
  497. #if ENABLED(E3_IS_L6470)
  498. _L6470_INIT(E3);
  499. #endif
  500. #if ENABLED(E4_IS_L6470)
  501. _L6470_INIT(E4);
  502. #endif
  503. }
  504. #endif // HAVE_L6470DRIVER