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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * Include pins definitions
  24. *
  25. * Pins numbering schemes:
  26. *
  27. * - Digital I/O pin number if used by READ/WRITE macros. (e.g., X_STEP_DIR)
  28. * The FastIO headers map digital pins to their ports and functions.
  29. *
  30. * - Analog Input number if used by analogRead or DAC. (e.g., TEMP_n_PIN)
  31. * These numbers are the same in any pin mapping.
  32. */
  33. #ifndef __PINS_H__
  34. #define __PINS_H__
  35. #if MB(GEN7_CUSTOM)
  36. #include "pins_GEN7_CUSTOM.h"
  37. #elif MB(GEN7_12)
  38. #include "pins_GEN7_12.h"
  39. #elif MB(GEN7_13)
  40. #include "pins_GEN7_13.h"
  41. #elif MB(GEN7_14)
  42. #include "pins_GEN7_14.h"
  43. #elif MB(CNCONTROLS_11)
  44. #include "pins_CNCONTROLS_11.h"
  45. #elif MB(CNCONTROLS_12)
  46. #include "pins_CNCONTROLS_12.h"
  47. #elif MB(CHEAPTRONIC)
  48. #include "pins_CHEAPTRONIC.h"
  49. #elif MB(CHEAPTRONIC_V2)
  50. #include "pins_CHEAPTRONICv2.h"
  51. #elif MB(SETHI)
  52. #include "pins_SETHI.h"
  53. #elif MB(MIGHTYBOARD_REVE)
  54. #include "pins_MIGHTYBOARD_REVE.h"
  55. #elif MB(RAMPS_OLD)
  56. #include "pins_RAMPS_OLD.h"
  57. #elif MB(RAMPS_13_EFB)
  58. #define IS_RAMPS_EFB
  59. #include "pins_RAMPS_13.h"
  60. #elif MB(RAMPS_13_EEB)
  61. #define IS_RAMPS_EEB
  62. #include "pins_RAMPS_13.h"
  63. #elif MB(RAMPS_13_EFF)
  64. #define IS_RAMPS_EFF
  65. #include "pins_RAMPS_13.h"
  66. #elif MB(RAMPS_13_EEF)
  67. #define IS_RAMPS_EEF
  68. #include "pins_RAMPS_13.h"
  69. #elif MB(RAMPS_13_SF)
  70. #define IS_RAMPS_SF
  71. #include "pins_RAMPS_13.h"
  72. #elif MB(RAMPS_14_EFB)
  73. #define IS_RAMPS_EFB
  74. #include "pins_RAMPS.h"
  75. #elif MB(RAMPS_14_EEB)
  76. #define IS_RAMPS_EEB
  77. #include "pins_RAMPS.h"
  78. #elif MB(RAMPS_14_EFF)
  79. #define IS_RAMPS_EFF
  80. #include "pins_RAMPS.h"
  81. #elif MB(RAMPS_14_EEF)
  82. #define IS_RAMPS_EEF
  83. #include "pins_RAMPS.h"
  84. #elif MB(RAMPS_14_SF)
  85. #define IS_RAMPS_SF
  86. #include "pins_RAMPS.h"
  87. #elif MB(GEN6)
  88. #include "pins_GEN6.h"
  89. #elif MB(GEN6_DELUXE)
  90. #include "pins_GEN6_DELUXE.h"
  91. #elif MB(SANGUINOLOLU_11)
  92. #include "pins_SANGUINOLOLU_11.h"
  93. #elif MB(SANGUINOLOLU_12)
  94. #include "pins_SANGUINOLOLU_12.h"
  95. #elif MB(MELZI)
  96. #include "pins_MELZI.h"
  97. #elif MB(MELZI_MAKR3D)
  98. #include "pins_MELZI_MAKR3D.h"
  99. #elif MB(MELZI_CREALITY)
  100. #include "pins_MELZI_CREALITY.h"
  101. #elif MB(STB_11)
  102. #include "pins_STB_11.h"
  103. #elif MB(AZTEEG_X1)
  104. #include "pins_AZTEEG_X1.h"
  105. #elif MB(AZTEEG_X3)
  106. #include "pins_AZTEEG_X3.h"
  107. #elif MB(AZTEEG_X3_PRO)
  108. #include "pins_AZTEEG_X3_PRO.h"
  109. #elif MB(ANET_10)
  110. #include "pins_ANET_10.h"
  111. #elif MB(ULTIMAKER)
  112. #include "pins_ULTIMAKER.h"
  113. #elif MB(ULTIMAKER_OLD)
  114. #include "pins_ULTIMAKER_OLD.h"
  115. #elif MB(ULTIMAIN_2)
  116. #include "pins_ULTIMAIN_2.h"
  117. #elif MB(3DRAG)
  118. #include "pins_3DRAG.h"
  119. #elif MB(K8200)
  120. #include "pins_K8200.h"
  121. #elif MB(K8400)
  122. #include "pins_K8400.h"
  123. #elif MB(TEENSYLU)
  124. #include "pins_TEENSYLU.h"
  125. #elif MB(RUMBA)
  126. #include "pins_RUMBA.h"
  127. #elif MB(PRINTRBOARD)
  128. #include "pins_PRINTRBOARD.h"
  129. #elif MB(PRINTRBOARD_REVF)
  130. #include "pins_PRINTRBOARD_REVF.h"
  131. #elif MB(BRAINWAVE)
  132. #include "pins_BRAINWAVE.h"
  133. #elif MB(BRAINWAVE_PRO)
  134. #include "pins_BRAINWAVE_PRO.h"
  135. #elif MB(SAV_MKI)
  136. #include "pins_SAV_MKI.h"
  137. #elif MB(TEENSY2)
  138. #include "pins_TEENSY2.h"
  139. #elif MB(GEN3_PLUS)
  140. #include "pins_GEN3_PLUS.h"
  141. #elif MB(GEN3_MONOLITHIC)
  142. #include "pins_GEN3_MONOLITHIC.h"
  143. #elif MB(MEGATRONICS)
  144. #include "pins_MEGATRONICS.h"
  145. #elif MB(MINITRONICS)
  146. #include "pins_MINITRONICS.h"
  147. #elif MB(MEGATRONICS_2)
  148. #include "pins_MEGATRONICS_2.h"
  149. #elif MB(MEGATRONICS_3)
  150. #include "pins_MEGATRONICS_3.h"
  151. #elif MB(MEGATRONICS_31)
  152. #define MEGATRONICS_31
  153. #include "pins_MEGATRONICS_3.h"
  154. #elif MB(OMCA_A)
  155. #include "pins_OMCA_A.h"
  156. #elif MB(OMCA)
  157. #include "pins_OMCA.h"
  158. #elif MB(RAMBO)
  159. #include "pins_RAMBO.h"
  160. #elif MB(MINIRAMBO)
  161. #include "pins_MINIRAMBO.h"
  162. #elif MB(ELEFU_3)
  163. #include "pins_ELEFU_3.h"
  164. #elif MB(5DPRINT)
  165. #include "pins_5DPRINT.h"
  166. #elif MB(LEAPFROG)
  167. #include "pins_LEAPFROG.h"
  168. #elif MB(BAM_DICE)
  169. #include "pins_RAMPS.h"
  170. #elif MB(BAM_DICE_DUE)
  171. #include "pins_BAM_DICE_DUE.h"
  172. #elif MB(FELIX2)
  173. #include "pins_FELIX2.h"
  174. #elif MB(MKS_BASE)
  175. #include "pins_MKS_BASE.h"
  176. #elif MB(RIGIDBOARD)
  177. #include "pins_RIGIDBOARD.h"
  178. #elif MB(RIGIDBOARD_V2)
  179. #include "pins_RIGIDBOARD_V2.h"
  180. #elif MB(MEGACONTROLLER)
  181. #include "pins_MEGACONTROLLER.h"
  182. #elif MB(BQ_ZUM_MEGA_3D)
  183. #include "pins_BQ_ZUM_MEGA_3D.h"
  184. #elif MB(SCOOVO_X9H)
  185. #include "pins_SCOOVO_X9H.h"
  186. #elif MB(MKS_13)
  187. #include "pins_MKS_13.h"
  188. #elif MB(SAINSMART_2IN1)
  189. #include "pins_SAINSMART_2IN1.h"
  190. #elif MB(ZRIB_V20)
  191. #include "pins_ZRIB_V20.h"
  192. #elif MB(GT2560_REV_A)
  193. #include "pins_GT2560_REV_A.h"
  194. #elif MB(GT2560_REV_A_PLUS)
  195. #include "pins_GT2560_REV_A_PLUS.h"
  196. #else
  197. #error "Unknown MOTHERBOARD value set in Configuration.h"
  198. #endif
  199. // Define certain undefined pins
  200. #ifndef X_MS1_PIN
  201. #define X_MS1_PIN -1
  202. #endif
  203. #ifndef X_MS2_PIN
  204. #define X_MS2_PIN -1
  205. #endif
  206. #ifndef Y_MS1_PIN
  207. #define Y_MS1_PIN -1
  208. #endif
  209. #ifndef Y_MS2_PIN
  210. #define Y_MS2_PIN -1
  211. #endif
  212. #ifndef Z_MS1_PIN
  213. #define Z_MS1_PIN -1
  214. #endif
  215. #ifndef Z_MS2_PIN
  216. #define Z_MS2_PIN -1
  217. #endif
  218. #ifndef E0_MS1_PIN
  219. #define E0_MS1_PIN -1
  220. #endif
  221. #ifndef E0_MS2_PIN
  222. #define E0_MS2_PIN -1
  223. #endif
  224. #ifndef E1_MS1_PIN
  225. #define E1_MS1_PIN -1
  226. #endif
  227. #ifndef E1_MS2_PIN
  228. #define E1_MS2_PIN -1
  229. #endif
  230. #ifndef FAN_PIN
  231. #define FAN_PIN -1
  232. #endif
  233. #ifndef FAN1_PIN
  234. #define FAN1_PIN -1
  235. #endif
  236. #ifndef FAN2_PIN
  237. #define FAN2_PIN -1
  238. #endif
  239. #ifndef CONTROLLER_FAN_PIN
  240. #define CONTROLLER_FAN_PIN -1
  241. #endif
  242. #ifndef HEATER_0_PIN
  243. #define HEATER_0_PIN -1
  244. #endif
  245. #ifndef HEATER_1_PIN
  246. #define HEATER_1_PIN -1
  247. #endif
  248. #ifndef HEATER_2_PIN
  249. #define HEATER_2_PIN -1
  250. #endif
  251. #ifndef HEATER_3_PIN
  252. #define HEATER_3_PIN -1
  253. #endif
  254. #ifndef HEATER_4_PIN
  255. #define HEATER_4_PIN -1
  256. #endif
  257. #ifndef HEATER_BED_PIN
  258. #define HEATER_BED_PIN -1
  259. #endif
  260. #ifndef TEMP_0_PIN
  261. #define TEMP_0_PIN -1
  262. #endif
  263. #ifndef TEMP_1_PIN
  264. #define TEMP_1_PIN -1
  265. #endif
  266. #ifndef TEMP_2_PIN
  267. #define TEMP_2_PIN -1
  268. #endif
  269. #ifndef TEMP_3_PIN
  270. #define TEMP_3_PIN -1
  271. #endif
  272. #ifndef TEMP_4_PIN
  273. #define TEMP_4_PIN -1
  274. #endif
  275. #ifndef TEMP_BED_PIN
  276. #define TEMP_BED_PIN -1
  277. #endif
  278. #ifndef SD_DETECT_PIN
  279. #define SD_DETECT_PIN -1
  280. #endif
  281. #ifndef SDPOWER
  282. #define SDPOWER -1
  283. #endif
  284. #ifndef SDSS
  285. #define SDSS -1
  286. #endif
  287. #ifndef LED_PIN
  288. #define LED_PIN -1
  289. #endif
  290. #ifndef PS_ON_PIN
  291. #define PS_ON_PIN -1
  292. #endif
  293. #ifndef KILL_PIN
  294. #define KILL_PIN -1
  295. #endif
  296. #ifndef SUICIDE_PIN
  297. #define SUICIDE_PIN -1
  298. #endif
  299. #ifndef MAX_EXTRUDERS
  300. #define MAX_EXTRUDERS 5
  301. #endif
  302. // Marlin needs to account for pins that equal -1
  303. #define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p))
  304. //
  305. // Assign auto fan pins if needed
  306. //
  307. #if !defined(E0_AUTO_FAN_PIN) && defined(ORIG_E0_AUTO_FAN_PIN)
  308. #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN
  309. #endif
  310. #if !defined(E1_AUTO_FAN_PIN) && defined(ORIG_E1_AUTO_FAN_PIN)
  311. #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN
  312. #endif
  313. #if !defined(E2_AUTO_FAN_PIN) && defined(ORIG_E2_AUTO_FAN_PIN)
  314. #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN
  315. #endif
  316. #if !defined(E3_AUTO_FAN_PIN) && defined(ORIG_E3_AUTO_FAN_PIN)
  317. #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN
  318. #endif
  319. #if !defined(E4_AUTO_FAN_PIN) && defined(ORIG_E4_AUTO_FAN_PIN)
  320. #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN
  321. #endif
  322. // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  323. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN,
  324. #define _E1_PINS
  325. #define _E2_PINS
  326. #define _E3_PINS
  327. #define _E4_PINS
  328. #if ENABLED(SWITCHING_EXTRUDER)
  329. // Tools 0 and 1 use E0
  330. #if EXTRUDERS > 2 // Tools 2 and 3 use E1
  331. #undef _E1_PINS
  332. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
  333. #if EXTRUDERS > 4 // Tools 4 and 5 use E2
  334. #undef _E2_PINS
  335. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  336. #endif
  337. #endif
  338. #elif EXTRUDERS > 1
  339. #undef _E1_PINS
  340. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
  341. #if EXTRUDERS > 2
  342. #undef _E2_PINS
  343. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  344. #if EXTRUDERS > 3
  345. #undef _E3_PINS
  346. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
  347. #if EXTRUDERS > 4
  348. #undef _E4_PINS
  349. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
  350. #endif // EXTRUDERS > 4
  351. #endif // EXTRUDERS > 3
  352. #endif // EXTRUDERS > 2
  353. #endif // EXTRUDERS > 1
  354. #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
  355. #define _H1_PINS
  356. #define _H2_PINS
  357. #define _H3_PINS
  358. #define _H4_PINS
  359. #if HOTENDS > 1
  360. #undef _H1_PINS
  361. #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN),
  362. #if HOTENDS > 2
  363. #undef _H2_PINS
  364. #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN),
  365. #if HOTENDS > 3
  366. #undef _H3_PINS
  367. #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN),
  368. #if HOTENDS > 4
  369. #undef _H4_PINS
  370. #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN),
  371. #endif // HOTENDS > 4
  372. #endif // HOTENDS > 3
  373. #endif // HOTENDS > 2
  374. #elif ENABLED(MIXING_EXTRUDER)
  375. #undef _E1_PINS
  376. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
  377. #if MIXING_STEPPERS > 2
  378. #undef _E2_PINS
  379. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  380. #if MIXING_STEPPERS > 3
  381. #undef _E3_PINS
  382. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
  383. #if MIXING_STEPPERS > 4
  384. #undef _E4_PINS
  385. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
  386. #endif // MIXING_STEPPERS > 4
  387. #endif // MIXING_STEPPERS > 3
  388. #endif // MIXING_STEPPERS > 2
  389. #endif // MIXING_STEPPERS > 1
  390. #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
  391. //
  392. // Assign endstop pins for boards with only 3 connectors
  393. //
  394. #ifdef X_STOP_PIN
  395. #if X_HOME_DIR < 0
  396. #define X_MIN_PIN X_STOP_PIN
  397. #define X_MAX_PIN -1
  398. #else
  399. #define X_MIN_PIN -1
  400. #define X_MAX_PIN X_STOP_PIN
  401. #endif
  402. #endif
  403. #ifdef Y_STOP_PIN
  404. #if Y_HOME_DIR < 0
  405. #define Y_MIN_PIN Y_STOP_PIN
  406. #define Y_MAX_PIN -1
  407. #else
  408. #define Y_MIN_PIN -1
  409. #define Y_MAX_PIN Y_STOP_PIN
  410. #endif
  411. #endif
  412. #ifdef Z_STOP_PIN
  413. #if Z_HOME_DIR < 0
  414. #define Z_MIN_PIN Z_STOP_PIN
  415. #define Z_MAX_PIN -1
  416. #else
  417. #define Z_MIN_PIN -1
  418. #define Z_MAX_PIN Z_STOP_PIN
  419. #endif
  420. #endif
  421. //
  422. // Disable unused endstop / probe pins
  423. //
  424. #if DISABLED(Z_MIN_PROBE_ENDSTOP)
  425. #undef Z_MIN_PROBE_PIN
  426. #define Z_MIN_PROBE_PIN -1
  427. #endif
  428. #if DISABLED(USE_XMAX_PLUG)
  429. #undef X_MAX_PIN
  430. #define X_MAX_PIN -1
  431. #endif
  432. #if DISABLED(USE_YMAX_PLUG)
  433. #undef Y_MAX_PIN
  434. #define Y_MAX_PIN -1
  435. #endif
  436. #if DISABLED(USE_ZMAX_PLUG)
  437. #undef Z_MAX_PIN
  438. #define Z_MAX_PIN -1
  439. #endif
  440. #if DISABLED(USE_XMIN_PLUG)
  441. #undef X_MIN_PIN
  442. #define X_MIN_PIN -1
  443. #endif
  444. #if DISABLED(USE_YMIN_PLUG)
  445. #undef Y_MIN_PIN
  446. #define Y_MIN_PIN -1
  447. #endif
  448. #if DISABLED(USE_ZMIN_PLUG)
  449. #undef Z_MIN_PIN
  450. #define Z_MIN_PIN -1
  451. #endif
  452. #ifndef LCD_PINS_D4
  453. #define LCD_PINS_D4 -1
  454. #endif
  455. #ifndef LCD_PINS_D5
  456. #define LCD_PINS_D5 -1
  457. #endif
  458. #ifndef LCD_PINS_D6
  459. #define LCD_PINS_D6 -1
  460. #endif
  461. #ifndef LCD_PINS_D7
  462. #define LCD_PINS_D7 -1
  463. #endif
  464. //
  465. // Dual X-carriage, Dual Y, Dual Z support
  466. //
  467. #define _X2_PINS
  468. #define _Y2_PINS
  469. #define _Z2_PINS
  470. #define __EPIN(p,q) E##p##_##q##_PIN
  471. #define _EPIN(p,q) __EPIN(p,q)
  472. // The X2 axis, if any, should be the next open extruder port
  473. #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)
  474. #ifndef X2_STEP_PIN
  475. #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP)
  476. #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR)
  477. #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
  478. #if X2_ENABLE_PIN == 0
  479. #error "No E stepper plug left for X2!"
  480. #endif
  481. #endif
  482. #undef _X2_PINS
  483. #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
  484. #define Y2_E_INDEX INCREMENT(E_STEPPERS)
  485. #else
  486. #define Y2_E_INDEX E_STEPPERS
  487. #endif
  488. // The Y2 axis, if any, should be the next open extruder port
  489. #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  490. #ifndef Y2_STEP_PIN
  491. #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
  492. #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
  493. #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
  494. #if Y2_ENABLE_PIN == 0
  495. #error "No E stepper plug left for Y2!"
  496. #endif
  497. #endif
  498. #undef _Y2_PINS
  499. #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
  500. #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
  501. #else
  502. #define Z2_E_INDEX Y2_E_INDEX
  503. #endif
  504. // The Z2 axis, if any, should be the next open extruder port
  505. #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
  506. #ifndef Z2_STEP_PIN
  507. #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
  508. #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
  509. #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
  510. #if Z2_ENABLE_PIN == 0
  511. #error "No E stepper plug left for Z2!"
  512. #endif
  513. #endif
  514. #undef _Z2_PINS
  515. #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
  516. #endif
  517. #define SENSITIVE_PINS { 0, 1, \
  518. X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
  519. Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
  520. Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \
  521. PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \
  522. _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \
  523. _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \
  524. _X2_PINS _Y2_PINS _Z2_PINS \
  525. X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \
  526. }
  527. #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
  528. /**
  529. * Define SPI Pins: SCK, MISO, MOSI, SS
  530. */
  531. #if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
  532. #define AVR_SCK_PIN 13
  533. #define AVR_MISO_PIN 12
  534. #define AVR_MOSI_PIN 11
  535. #define AVR_SS_PIN 10
  536. #elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) || defined(__AVR_ATmega1284P__)
  537. #define AVR_SCK_PIN 7
  538. #define AVR_MISO_PIN 6
  539. #define AVR_MOSI_PIN 5
  540. #define AVR_SS_PIN 4
  541. #elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  542. #define AVR_SCK_PIN 52
  543. #define AVR_MISO_PIN 50
  544. #define AVR_MOSI_PIN 51
  545. #define AVR_SS_PIN 53
  546. #elif defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__)
  547. #define AVR_SCK_PIN 21
  548. #define AVR_MISO_PIN 23
  549. #define AVR_MOSI_PIN 22
  550. #define AVR_SS_PIN 20
  551. #elif defined(__AVR_ATmega1281__) || defined(__AVR_ATmega2561__)
  552. #define AVR_SCK_PIN 10
  553. #define AVR_MISO_PIN 12
  554. #define AVR_MOSI_PIN 11
  555. #define AVR_SS_PIN 16
  556. #endif
  557. #ifndef SCK_PIN
  558. #define SCK_PIN AVR_SCK_PIN
  559. #endif
  560. #ifndef MISO_PIN
  561. #define MISO_PIN AVR_MISO_PIN
  562. #endif
  563. #ifndef MOSI_PIN
  564. #define MOSI_PIN AVR_MOSI_PIN
  565. #endif
  566. #ifndef SS_PIN
  567. #define SS_PIN AVR_SS_PIN
  568. #endif
  569. #endif // __PINS_H__