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.

pins.h 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  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. #define IS_RAMPS_EFB (MB(RAMPS_13_EFB) || MB(RAMPS_14_EFB) || MB(RAMPS_14_RE_ARM_EFB) || MB(RAMPS_SMART_EFB) || MB(RAMPS_DUO_EFB) || MB(RAMPS4DUE_EFB))
  36. #define IS_RAMPS_EEB (MB(RAMPS_13_EEB) || MB(RAMPS_14_EEB) || MB(RAMPS_14_RE_ARM_EEB) || MB(RAMPS_SMART_EEB) || MB(RAMPS_DUO_EEB) || MB(RAMPS4DUE_EEB))
  37. #define IS_RAMPS_EFF (MB(RAMPS_13_EFF) || MB(RAMPS_14_EFF) || MB(RAMPS_14_RE_ARM_EFF) || MB(RAMPS_SMART_EFF) || MB(RAMPS_DUO_EFF) || MB(RAMPS4DUE_EFF))
  38. #define IS_RAMPS_EEF (MB(RAMPS_13_EEF) || MB(RAMPS_14_EEF) || MB(RAMPS_14_RE_ARM_EEF) || MB(RAMPS_SMART_EEF) || MB(RAMPS_DUO_EEF) || MB(RAMPS4DUE_EEF))
  39. #define IS_RAMPS_SF (MB(RAMPS_13_SF) || MB(RAMPS_14_SF) || MB(RAMPS_14_RE_ARM_SF) || MB(RAMPS_SMART_SF) || MB(RAMPS_DUO_SF) || MB(RAMPS4DUE_SF) )
  40. //
  41. // RAMPS 1.3 / 1.4 - ATmega1280, ATmega2560
  42. //
  43. #if MB(RAMPS_OLD)
  44. #include "pins_RAMPS_OLD.h"
  45. #elif MB(RAMPS_13_EFB)
  46. #include "pins_RAMPS_13.h"
  47. #elif MB(RAMPS_13_EEB)
  48. #include "pins_RAMPS_13.h"
  49. #elif MB(RAMPS_13_EFF)
  50. #include "pins_RAMPS_13.h"
  51. #elif MB(RAMPS_13_EEF)
  52. #include "pins_RAMPS_13.h"
  53. #elif MB(RAMPS_13_SF)
  54. #include "pins_RAMPS_13.h"
  55. #elif MB(RAMPS_14_EFB)
  56. #include "pins_RAMPS.h"
  57. #elif MB(RAMPS_14_EEB)
  58. #include "pins_RAMPS.h"
  59. #elif MB(RAMPS_14_EFF)
  60. #include "pins_RAMPS.h"
  61. #elif MB(RAMPS_14_EEF)
  62. #include "pins_RAMPS.h"
  63. #elif MB(RAMPS_14_SF)
  64. #include "pins_RAMPS.h"
  65. //
  66. // RAMPS Derivatives - ATmega1280, ATmega2560
  67. //
  68. #elif MB(3DRAG)
  69. #include "pins_3DRAG.h" // ATmega1280, ATmega2560
  70. #elif MB(K8200)
  71. #include "pins_K8200.h" // ATmega1280, ATmega2560 (3DRAG)
  72. #elif MB(K8400)
  73. #include "pins_K8400.h" // ATmega1280, ATmega2560 (3DRAG)
  74. #elif MB(BAM_DICE)
  75. #include "pins_RAMPS.h" // ATmega1280, ATmega2560
  76. #elif MB(BAM_DICE_DUE)
  77. #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560
  78. #elif MB(MKS_BASE)
  79. #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560
  80. #elif MB(MKS_13)
  81. #include "pins_MKS_13.h" // ATmega1280, ATmega2560
  82. #elif MB(ZRIB_V20)
  83. #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 (MKS_13)
  84. #elif MB(FELIX2)
  85. #include "pins_FELIX2.h" // ATmega1280, ATmega2560
  86. #elif MB(RIGIDBOARD)
  87. #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560
  88. #elif MB(RIGIDBOARD_V2)
  89. #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560
  90. #elif MB(SAINSMART_2IN1)
  91. #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560
  92. #elif MB(ULTIMAKER)
  93. #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560
  94. #elif MB(ULTIMAKER_OLD)
  95. #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560
  96. #elif MB(AZTEEG_X3)
  97. #include "pins_AZTEEG_X3.h" // ATmega2560
  98. #elif MB(AZTEEG_X3_PRO)
  99. #include "pins_AZTEEG_X3_PRO.h" // ATmega2560
  100. #elif MB(ULTIMAIN_2)
  101. #include "pins_ULTIMAIN_2.h" // ATmega2560
  102. #elif MB(RUMBA)
  103. #include "pins_RUMBA.h" // ATmega2560
  104. #elif MB(BQ_ZUM_MEGA_3D)
  105. #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560
  106. //
  107. // Other ATmega1280, ATmega2560
  108. //
  109. #elif MB(CNCONTROLS_11)
  110. #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560
  111. #elif MB(CNCONTROLS_12)
  112. #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560
  113. #elif MB(MIGHTYBOARD_REVE)
  114. #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560
  115. #elif MB(CHEAPTRONIC)
  116. #include "pins_CHEAPTRONIC.h" // ATmega2560
  117. #elif MB(CHEAPTRONIC_V2)
  118. #include "pins_CHEAPTRONICv2.h" // ATmega2560
  119. #elif MB(MEGATRONICS)
  120. #include "pins_MEGATRONICS.h" // ATmega2560
  121. #elif MB(MEGATRONICS_2)
  122. #include "pins_MEGATRONICS_2.h" // ATmega2560
  123. #elif MB(MEGATRONICS_3)
  124. #include "pins_MEGATRONICS_3.h" // ATmega2560
  125. #elif MB(MEGATRONICS_31)
  126. #define MEGATRONICS_31
  127. #include "pins_MEGATRONICS_3.h" // ATmega2560
  128. #elif MB(RAMBO)
  129. #include "pins_RAMBO.h" // ATmega2560
  130. #elif MB(MINIRAMBO)
  131. #include "pins_MINIRAMBO.h" // ATmega2560
  132. #elif MB(ELEFU_3)
  133. #include "pins_ELEFU_3.h" // ATmega2560
  134. #elif MB(LEAPFROG)
  135. #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560
  136. #elif MB(MEGACONTROLLER)
  137. #include "pins_MEGACONTROLLER.h" // ATmega2560
  138. #elif MB(SCOOVO_X9H)
  139. #include "pins_SCOOVO_X9H.h" // ATmega2560
  140. #elif MB(GT2560_REV_A)
  141. #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560
  142. #elif MB(GT2560_REV_A_PLUS)
  143. #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560
  144. //
  145. // ATmega1281, ATmega2561
  146. //
  147. #elif MB(MINITRONICS)
  148. #include "pins_MINITRONICS.h" // ATmega1281
  149. //
  150. // Sanguinololu and Derivatives - ATmega644P, ATmega1284P
  151. //
  152. #elif MB(SANGUINOLOLU_11)
  153. #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P
  154. #elif MB(SANGUINOLOLU_12)
  155. #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P
  156. #elif MB(MELZI)
  157. #include "pins_MELZI.h" // ATmega644P, ATmega1284P
  158. #elif MB(MELZI_MAKR3D)
  159. #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P
  160. #elif MB(MELZI_CREALITY)
  161. #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P
  162. #elif MB(STB_11)
  163. #include "pins_STB_11.h" // ATmega644P, ATmega1284P
  164. #elif MB(AZTEEG_X1)
  165. #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P
  166. //
  167. // Other ATmega644P, ATmega644, ATmega1284P
  168. //
  169. #elif MB(GEN3_MONOLITHIC)
  170. #include "pins_GEN3_MONOLITHIC.h" // ATmega644P
  171. #elif MB(GEN3_PLUS)
  172. #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P
  173. #elif MB(GEN6)
  174. #include "pins_GEN6.h" // ATmega644P, ATmega1284P
  175. #elif MB(GEN6_DELUXE)
  176. #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P
  177. #elif MB(GEN7_CUSTOM)
  178. #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P
  179. #elif MB(GEN7_12)
  180. #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P
  181. #elif MB(GEN7_13)
  182. #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P
  183. #elif MB(GEN7_14)
  184. #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P
  185. #elif MB(OMCA_A)
  186. #include "pins_OMCA_A.h" // ATmega644
  187. #elif MB(OMCA)
  188. #include "pins_OMCA.h" // ATmega644P, ATmega644
  189. #elif MB(ANET_10)
  190. #include "pins_ANET_10.h" // ATmega1284P
  191. #elif MB(SETHI)
  192. #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P
  193. //
  194. // Teensyduino - AT90USB1286, AT90USB1286P
  195. //
  196. #elif MB(TEENSYLU)
  197. #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P
  198. #elif MB(PRINTRBOARD)
  199. #include "pins_PRINTRBOARD.h" // AT90USB1286
  200. #elif MB(PRINTRBOARD_REVF)
  201. #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286
  202. #elif MB(BRAINWAVE)
  203. #include "pins_BRAINWAVE.h" // AT90USB646
  204. #elif MB(BRAINWAVE_PRO)
  205. #include "pins_BRAINWAVE_PRO.h" // AT90USB1286
  206. #elif MB(SAV_MKI)
  207. #include "pins_SAV_MKI.h" // AT90USB1286
  208. #elif MB(TEENSY2)
  209. #include "pins_TEENSY2.h" // AT90USB1286
  210. #elif MB(5DPRINT)
  211. #include "pins_5DPRINT.h" // AT90USB1286
  212. //
  213. // Re-ARM - LPC1768
  214. //
  215. #elif MB(RAMPS_14_RE_ARM_EFB)
  216. #include "pins_RAMPS_RE_ARM.h"
  217. #elif MB(RAMPS_14_RE_ARM_EEB)
  218. #include "pins_RAMPS_RE_ARM.h"
  219. #elif MB(RAMPS_14_RE_ARM_EFF)
  220. #include "pins_RAMPS_RE_ARM.h"
  221. #elif MB(RAMPS_14_RE_ARM_EEF)
  222. #include "pins_RAMPS_RE_ARM.h"
  223. #elif MB(RAMPS_14_RE_ARM_SF)
  224. #include "pins_RAMPS_RE_ARM.h"
  225. //
  226. // Other 32-bit Boards
  227. //
  228. #elif MB(TEENSY35_36)
  229. #include "pins_TEENSY35_36.h"
  230. #elif MB(DUE3DOM)
  231. #include "pins_DUE3DOM.h"
  232. #elif MB(DUE3DOM_MINI)
  233. #include "pins_DUE3DOM_MINI.h"
  234. #elif MB(RADDS)
  235. #include "pins_RADDS.h"
  236. #elif MB(RAMPS_FD_V1)
  237. #include "pins_RAMPS_FD.h"
  238. #elif MB(RAMPS_FD_V2)
  239. #include "pins_RAMPS_FD_V2.h"
  240. #elif MB(RAMPS_SMART_EFB)
  241. #include "pins_RAMPS_SMART.h"
  242. #elif MB(RAMPS_SMART_EEB)
  243. #include "pins_RAMPS_SMART.h"
  244. #elif MB(RAMPS_SMART_EFF)
  245. #include "pins_RAMPS_SMART.h"
  246. #elif MB(RAMPS_SMART_EEF)
  247. #include "pins_RAMPS_SMART.h"
  248. #elif MB(RAMPS_SMART_SF)
  249. #include "pins_RAMPS_SMART.h"
  250. #elif MB(RAMPS_DUO_EFB)
  251. #include "pins_RAMPS_DUO.h"
  252. #elif MB(RAMPS_DUO_EEB)
  253. #include "pins_RAMPS_DUO.h"
  254. #elif MB(RAMPS_DUO_EFF)
  255. #include "pins_RAMPS_DUO.h"
  256. #elif MB(RAMPS_DUO_EEF)
  257. #include "pins_RAMPS_DUO.h"
  258. #elif MB(RAMPS_DUO_SF)
  259. #include "pins_RAMPS_DUO.h"
  260. #elif MB(RAMPS4DUE_EFB)
  261. #include "pins_RAMPS4DUE.h"
  262. #elif MB(RAMPS4DUE_EEB)
  263. #include "pins_RAMPS4DUE.h"
  264. #elif MB(RAMPS4DUE_EFF)
  265. #include "pins_RAMPS4DUE.h"
  266. #elif MB(RAMPS4DUE_EEF)
  267. #include "pins_RAMPS4DUE.h"
  268. #elif MB(RAMPS4DUE_SF)
  269. #include "pins_RAMPS4DUE.h"
  270. #elif MB(ALLIGATOR)
  271. #include "pins_ALLIGATOR_R2.h"
  272. #elif MB(RAMPS_FD_V1) || MB(RAMPS_FD_V2)
  273. #include "pins_RAMPS_FD_v1.h"
  274. #else
  275. #error "Unknown MOTHERBOARD value set in Configuration.h"
  276. #endif
  277. // Define certain undefined pins
  278. #ifndef X_MS1_PIN
  279. #define X_MS1_PIN -1
  280. #endif
  281. #ifndef X_MS2_PIN
  282. #define X_MS2_PIN -1
  283. #endif
  284. #ifndef Y_MS1_PIN
  285. #define Y_MS1_PIN -1
  286. #endif
  287. #ifndef Y_MS2_PIN
  288. #define Y_MS2_PIN -1
  289. #endif
  290. #ifndef Z_MS1_PIN
  291. #define Z_MS1_PIN -1
  292. #endif
  293. #ifndef Z_MS2_PIN
  294. #define Z_MS2_PIN -1
  295. #endif
  296. #ifndef E0_MS1_PIN
  297. #define E0_MS1_PIN -1
  298. #endif
  299. #ifndef E0_MS2_PIN
  300. #define E0_MS2_PIN -1
  301. #endif
  302. #ifndef E1_MS1_PIN
  303. #define E1_MS1_PIN -1
  304. #endif
  305. #ifndef E1_MS2_PIN
  306. #define E1_MS2_PIN -1
  307. #endif
  308. #ifndef FAN_PIN
  309. #define FAN_PIN -1
  310. #endif
  311. #ifndef FAN1_PIN
  312. #define FAN1_PIN -1
  313. #endif
  314. #ifndef FAN2_PIN
  315. #define FAN2_PIN -1
  316. #endif
  317. #ifndef CONTROLLER_FAN_PIN
  318. #define CONTROLLER_FAN_PIN -1
  319. #endif
  320. #ifndef FANMUX0_PIN
  321. #define FANMUX0_PIN -1
  322. #endif
  323. #ifndef FANMUX1_PIN
  324. #define FANMUX1_PIN -1
  325. #endif
  326. #ifndef FANMUX2_PIN
  327. #define FANMUX2_PIN -1
  328. #endif
  329. #ifndef HEATER_0_PIN
  330. #define HEATER_0_PIN -1
  331. #endif
  332. #ifndef HEATER_1_PIN
  333. #define HEATER_1_PIN -1
  334. #endif
  335. #ifndef HEATER_2_PIN
  336. #define HEATER_2_PIN -1
  337. #endif
  338. #ifndef HEATER_3_PIN
  339. #define HEATER_3_PIN -1
  340. #endif
  341. #ifndef HEATER_4_PIN
  342. #define HEATER_4_PIN -1
  343. #endif
  344. #ifndef HEATER_BED_PIN
  345. #define HEATER_BED_PIN -1
  346. #endif
  347. #ifndef TEMP_0_PIN
  348. #define TEMP_0_PIN -1
  349. #endif
  350. #ifndef TEMP_1_PIN
  351. #define TEMP_1_PIN -1
  352. #endif
  353. #ifndef TEMP_2_PIN
  354. #define TEMP_2_PIN -1
  355. #endif
  356. #ifndef TEMP_3_PIN
  357. #define TEMP_3_PIN -1
  358. #endif
  359. #ifndef TEMP_4_PIN
  360. #define TEMP_4_PIN -1
  361. #endif
  362. #ifndef TEMP_BED_PIN
  363. #define TEMP_BED_PIN -1
  364. #endif
  365. #ifndef SD_DETECT_PIN
  366. #define SD_DETECT_PIN -1
  367. #endif
  368. #ifndef SDPOWER
  369. #define SDPOWER -1
  370. #endif
  371. #ifndef SDSS
  372. #define SDSS -1
  373. #endif
  374. #ifndef LED_PIN
  375. #define LED_PIN -1
  376. #endif
  377. #ifndef PS_ON_PIN
  378. #define PS_ON_PIN -1
  379. #endif
  380. #ifndef KILL_PIN
  381. #define KILL_PIN -1
  382. #endif
  383. #ifndef SUICIDE_PIN
  384. #define SUICIDE_PIN -1
  385. #endif
  386. #ifndef MAX_EXTRUDERS
  387. #define MAX_EXTRUDERS 5
  388. #endif
  389. // Marlin needs to account for pins that equal -1
  390. #define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : analogInputToDigitalPin(p))
  391. //
  392. // Assign auto fan pins if needed
  393. //
  394. #if !defined(E0_AUTO_FAN_PIN) && defined(ORIG_E0_AUTO_FAN_PIN)
  395. #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN
  396. #endif
  397. #if !defined(E1_AUTO_FAN_PIN) && defined(ORIG_E1_AUTO_FAN_PIN)
  398. #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN
  399. #endif
  400. #if !defined(E2_AUTO_FAN_PIN) && defined(ORIG_E2_AUTO_FAN_PIN)
  401. #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN
  402. #endif
  403. #if !defined(E3_AUTO_FAN_PIN) && defined(ORIG_E3_AUTO_FAN_PIN)
  404. #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN
  405. #endif
  406. #if !defined(E4_AUTO_FAN_PIN) && defined(ORIG_E4_AUTO_FAN_PIN)
  407. #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN
  408. #endif
  409. // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  410. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN,
  411. #define _E1_PINS
  412. #define _E2_PINS
  413. #define _E3_PINS
  414. #define _E4_PINS
  415. #if ENABLED(SWITCHING_EXTRUDER)
  416. // Tools 0 and 1 use E0
  417. #if EXTRUDERS > 2 // Tools 2 and 3 use E1
  418. #undef _E1_PINS
  419. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
  420. #if EXTRUDERS > 4 // Tools 4 and 5 use E2
  421. #undef _E2_PINS
  422. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  423. #endif
  424. #endif
  425. #elif EXTRUDERS > 1
  426. #undef _E1_PINS
  427. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
  428. #if EXTRUDERS > 2
  429. #undef _E2_PINS
  430. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  431. #if EXTRUDERS > 3
  432. #undef _E3_PINS
  433. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
  434. #if EXTRUDERS > 4
  435. #undef _E4_PINS
  436. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
  437. #endif // EXTRUDERS > 4
  438. #endif // EXTRUDERS > 3
  439. #endif // EXTRUDERS > 2
  440. #endif // EXTRUDERS > 1
  441. #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
  442. #define _H1_PINS
  443. #define _H2_PINS
  444. #define _H3_PINS
  445. #define _H4_PINS
  446. #if HOTENDS > 1
  447. #undef _H1_PINS
  448. #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN),
  449. #if HOTENDS > 2
  450. #undef _H2_PINS
  451. #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN),
  452. #if HOTENDS > 3
  453. #undef _H3_PINS
  454. #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN),
  455. #if HOTENDS > 4
  456. #undef _H4_PINS
  457. #define _H4_PINS HEATER_4_PIN, marlinAnalogInputToDigitalPin(TEMP_4_PIN),
  458. #endif // HOTENDS > 4
  459. #endif // HOTENDS > 3
  460. #endif // HOTENDS > 2
  461. #elif ENABLED(MIXING_EXTRUDER)
  462. #undef _E1_PINS
  463. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN,
  464. #if MIXING_STEPPERS > 2
  465. #undef _E2_PINS
  466. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  467. #if MIXING_STEPPERS > 3
  468. #undef _E3_PINS
  469. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
  470. #if MIXING_STEPPERS > 4
  471. #undef _E4_PINS
  472. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN,
  473. #endif // MIXING_STEPPERS > 4
  474. #endif // MIXING_STEPPERS > 3
  475. #endif // MIXING_STEPPERS > 2
  476. #endif // MIXING_STEPPERS > 1
  477. #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
  478. //
  479. // Assign endstop pins for boards with only 3 connectors
  480. //
  481. #ifdef X_STOP_PIN
  482. #if X_HOME_DIR < 0
  483. #define X_MIN_PIN X_STOP_PIN
  484. #define X_MAX_PIN -1
  485. #else
  486. #define X_MIN_PIN -1
  487. #define X_MAX_PIN X_STOP_PIN
  488. #endif
  489. #endif
  490. #ifdef Y_STOP_PIN
  491. #if Y_HOME_DIR < 0
  492. #define Y_MIN_PIN Y_STOP_PIN
  493. #define Y_MAX_PIN -1
  494. #else
  495. #define Y_MIN_PIN -1
  496. #define Y_MAX_PIN Y_STOP_PIN
  497. #endif
  498. #endif
  499. #ifdef Z_STOP_PIN
  500. #if Z_HOME_DIR < 0
  501. #define Z_MIN_PIN Z_STOP_PIN
  502. #define Z_MAX_PIN -1
  503. #else
  504. #define Z_MIN_PIN -1
  505. #define Z_MAX_PIN Z_STOP_PIN
  506. #endif
  507. #endif
  508. //
  509. // Disable unused endstop / probe pins
  510. //
  511. #if DISABLED(Z_MIN_PROBE_ENDSTOP)
  512. #undef Z_MIN_PROBE_PIN
  513. #define Z_MIN_PROBE_PIN -1
  514. #endif
  515. #if DISABLED(USE_XMAX_PLUG)
  516. #undef X_MAX_PIN
  517. #define X_MAX_PIN -1
  518. #endif
  519. #if DISABLED(USE_YMAX_PLUG)
  520. #undef Y_MAX_PIN
  521. #define Y_MAX_PIN -1
  522. #endif
  523. #if DISABLED(USE_ZMAX_PLUG)
  524. #undef Z_MAX_PIN
  525. #define Z_MAX_PIN -1
  526. #endif
  527. #if DISABLED(USE_XMIN_PLUG)
  528. #undef X_MIN_PIN
  529. #define X_MIN_PIN -1
  530. #endif
  531. #if DISABLED(USE_YMIN_PLUG)
  532. #undef Y_MIN_PIN
  533. #define Y_MIN_PIN -1
  534. #endif
  535. #if DISABLED(USE_ZMIN_PLUG)
  536. #undef Z_MIN_PIN
  537. #define Z_MIN_PIN -1
  538. #endif
  539. #ifndef LCD_PINS_D4
  540. #define LCD_PINS_D4 -1
  541. #endif
  542. #ifndef LCD_PINS_D5
  543. #define LCD_PINS_D5 -1
  544. #endif
  545. #ifndef LCD_PINS_D6
  546. #define LCD_PINS_D6 -1
  547. #endif
  548. #ifndef LCD_PINS_D7
  549. #define LCD_PINS_D7 -1
  550. #endif
  551. //
  552. // Dual X-carriage, Dual Y, Dual Z support
  553. //
  554. #define _X2_PINS
  555. #define _Y2_PINS
  556. #define _Z2_PINS
  557. #define __EPIN(p,q) E##p##_##q##_PIN
  558. #define _EPIN(p,q) __EPIN(p,q)
  559. // The X2 axis, if any, should be the next open extruder port
  560. #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)
  561. #ifndef X2_STEP_PIN
  562. #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP)
  563. #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR)
  564. #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
  565. #if X2_ENABLE_PIN == 0
  566. #error "No E stepper plug left for X2!"
  567. #endif
  568. #endif
  569. #undef _X2_PINS
  570. #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
  571. #define Y2_E_INDEX INCREMENT(E_STEPPERS)
  572. #else
  573. #define Y2_E_INDEX E_STEPPERS
  574. #endif
  575. // The Y2 axis, if any, should be the next open extruder port
  576. #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  577. #ifndef Y2_STEP_PIN
  578. #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
  579. #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
  580. #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
  581. #if Y2_ENABLE_PIN == 0
  582. #error "No E stepper plug left for Y2!"
  583. #endif
  584. #endif
  585. #undef _Y2_PINS
  586. #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
  587. #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
  588. #else
  589. #define Z2_E_INDEX Y2_E_INDEX
  590. #endif
  591. // The Z2 axis, if any, should be the next open extruder port
  592. #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
  593. #ifndef Z2_STEP_PIN
  594. #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
  595. #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
  596. #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
  597. #if Z2_ENABLE_PIN == 0
  598. #error "No E stepper plug left for Z2!"
  599. #endif
  600. #endif
  601. #undef _Z2_PINS
  602. #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
  603. #endif
  604. #define SENSITIVE_PINS { 0, 1, \
  605. X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
  606. Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
  607. Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \
  608. PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \
  609. _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \
  610. _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \
  611. _X2_PINS _Y2_PINS _Z2_PINS \
  612. X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \
  613. }
  614. #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
  615. // Note: default SPI pins are defined in the HAL
  616. #include "src/HAL/HAL_spi_pins.h"
  617. #endif // __PINS_H__