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

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