My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pins.h 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  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_PLUS_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_PLUS_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_PLUS_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_PLUS_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_PLUS_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. #elif MB(RAMPS_PLUS_EFB)
  73. #include "pins_RAMPS_PLUS.h"
  74. #elif MB(RAMPS_PLUS_EEB)
  75. #include "pins_RAMPS_PLUS.h"
  76. #elif MB(RAMPS_PLUS_EFF)
  77. #include "pins_RAMPS_PLUS.h"
  78. #elif MB(RAMPS_PLUS_EEF)
  79. #include "pins_RAMPS_PLUS.h"
  80. #elif MB(RAMPS_PLUS_SF)
  81. #include "pins_RAMPS_PLUS.h"
  82. //
  83. // RAMPS Derivatives - ATmega1280, ATmega2560
  84. //
  85. #elif MB(3DRAG)
  86. #include "pins_3DRAG.h" // ATmega1280, ATmega2560
  87. #elif MB(K8200)
  88. #include "pins_K8200.h" // ATmega1280, ATmega2560 (3DRAG)
  89. #elif MB(K8400)
  90. #include "pins_K8400.h" // ATmega1280, ATmega2560 (3DRAG)
  91. #elif MB(BAM_DICE)
  92. #include "pins_RAMPS.h" // ATmega1280, ATmega2560
  93. #elif MB(BAM_DICE_DUE)
  94. #include "pins_BAM_DICE_DUE.h" // ATmega1280, ATmega2560
  95. #elif MB(MKS_BASE)
  96. #include "pins_MKS_BASE.h" // ATmega1280, ATmega2560
  97. #elif MB(MKS_BASE_HEROIC)
  98. #include "pins_MKS_BASE_HEROIC.h" // ATmega1280, ATmega2560
  99. #elif MB(MKS_13)
  100. #include "pins_MKS_13.h" // ATmega1280, ATmega2560
  101. #elif MB(MKS_GEN_L)
  102. #include "pins_MKS_GEN_L.h" // ATmega1280, ATmega2560
  103. #elif MB(ZRIB_V20)
  104. #include "pins_ZRIB_V20.h" // ATmega1280, ATmega2560 (MKS_13)
  105. #elif MB(FELIX2)
  106. #include "pins_FELIX2.h" // ATmega1280, ATmega2560
  107. #elif MB(RIGIDBOARD)
  108. #include "pins_RIGIDBOARD.h" // ATmega1280, ATmega2560
  109. #elif MB(RIGIDBOARD_V2)
  110. #include "pins_RIGIDBOARD_V2.h" // ATmega1280, ATmega2560
  111. #elif MB(SAINSMART_2IN1)
  112. #include "pins_SAINSMART_2IN1.h" // ATmega1280, ATmega2560
  113. #elif MB(ULTIMAKER)
  114. #include "pins_ULTIMAKER.h" // ATmega1280, ATmega2560
  115. #elif MB(ULTIMAKER_OLD)
  116. #include "pins_ULTIMAKER_OLD.h" // ATmega1280, ATmega2560
  117. #elif MB(AZTEEG_X3)
  118. #include "pins_AZTEEG_X3.h" // ATmega2560
  119. #elif MB(AZTEEG_X3_PRO)
  120. #include "pins_AZTEEG_X3_PRO.h" // ATmega2560
  121. #elif MB(ULTIMAIN_2)
  122. #include "pins_ULTIMAIN_2.h" // ATmega2560
  123. #elif MB(RUMBA)
  124. #include "pins_RUMBA.h" // ATmega2560
  125. #elif MB(BQ_ZUM_MEGA_3D)
  126. #include "pins_BQ_ZUM_MEGA_3D.h" // ATmega2560
  127. #elif MB(MAKEBOARD_MINI)
  128. #include "pins_MAKEBOARD_MINI.h" // ATmega2560
  129. #elif MB(TRIGORILLA)
  130. #include "pins_TRIGORILLA.h" // ATmega2560
  131. //
  132. // Other ATmega1280, ATmega2560
  133. //
  134. #elif MB(CNCONTROLS_11)
  135. #include "pins_CNCONTROLS_11.h" // ATmega1280, ATmega2560
  136. #elif MB(CNCONTROLS_12)
  137. #include "pins_CNCONTROLS_12.h" // ATmega1280, ATmega2560
  138. #elif MB(MIGHTYBOARD_REVE)
  139. #include "pins_MIGHTYBOARD_REVE.h" // ATmega1280, ATmega2560
  140. #elif MB(CHEAPTRONIC)
  141. #include "pins_CHEAPTRONIC.h" // ATmega2560
  142. #elif MB(CHEAPTRONIC_V2)
  143. #include "pins_CHEAPTRONICv2.h" // ATmega2560
  144. #elif MB(MEGATRONICS)
  145. #include "pins_MEGATRONICS.h" // ATmega2560
  146. #elif MB(MEGATRONICS_2)
  147. #include "pins_MEGATRONICS_2.h" // ATmega2560
  148. #elif MB(MEGATRONICS_3) || MB(MEGATRONICS_31)
  149. #include "pins_MEGATRONICS_3.h" // ATmega2560
  150. #elif MB(RAMBO)
  151. #include "pins_RAMBO.h" // ATmega2560
  152. #elif MB(MINIRAMBO) || MB(MINIRAMBO_10A)
  153. #include "pins_MINIRAMBO.h" // ATmega2560
  154. #elif MB(EINSY_RAMBO)
  155. #include "pins_EINSY_RAMBO.h" // ATmega2560
  156. #elif MB(ELEFU_3)
  157. #include "pins_ELEFU_3.h" // ATmega2560
  158. #elif MB(LEAPFROG)
  159. #include "pins_LEAPFROG.h" // ATmega1280, ATmega2560
  160. #elif MB(MEGACONTROLLER)
  161. #include "pins_MEGACONTROLLER.h" // ATmega2560
  162. #elif MB(SCOOVO_X9H)
  163. #include "pins_SCOOVO_X9H.h" // ATmega2560
  164. #elif MB(GT2560_REV_A)
  165. #include "pins_GT2560_REV_A.h" // ATmega1280, ATmega2560
  166. #elif MB(GT2560_REV_A_PLUS)
  167. #include "pins_GT2560_REV_A_PLUS.h" // ATmega1280, ATmega2560
  168. #elif MB(RAMPS_ENDER_4)
  169. #include "pins_RAMPS_ENDER_4.h" // ATmega2560
  170. //
  171. // ATmega1281, ATmega2561
  172. //
  173. #elif MB(MINITRONICS)
  174. #include "pins_MINITRONICS.h" // ATmega1281
  175. #elif MB(SILVER_GATE)
  176. #include "pins_SILVER_GATE.h" // ATmega2561
  177. //
  178. // Sanguinololu and Derivatives - ATmega644P, ATmega1284P
  179. //
  180. #elif MB(SANGUINOLOLU_11)
  181. #include "pins_SANGUINOLOLU_11.h" // ATmega644P, ATmega1284P
  182. #elif MB(SANGUINOLOLU_12)
  183. #include "pins_SANGUINOLOLU_12.h" // ATmega644P, ATmega1284P
  184. #elif MB(MELZI)
  185. #include "pins_MELZI.h" // ATmega644P, ATmega1284P
  186. #elif MB(MELZI_MAKR3D)
  187. #include "pins_MELZI_MAKR3D.h" // ATmega644P, ATmega1284P
  188. #elif MB(MELZI_CREALITY)
  189. #include "pins_MELZI_CREALITY.h" // ATmega644P, ATmega1284P
  190. #elif MB(MELZI_MALYAN)
  191. #include "pins_MELZI_MALYAN.h" // ATmega644P, ATmega1284P
  192. #elif MB(CREALITY_ENDER)
  193. #include "pins_CREALITY_ENDER.h" // ATmega1284P
  194. #elif MB(MELZI_TRONXY)
  195. #include "pins_MELZI_TRONXY.h" // ATmega644P, ATmega1284P
  196. #elif MB(STB_11)
  197. #include "pins_STB_11.h" // ATmega644P, ATmega1284P
  198. #elif MB(AZTEEG_X1)
  199. #include "pins_AZTEEG_X1.h" // ATmega644P, ATmega1284P
  200. //
  201. // Other ATmega644P, ATmega644, ATmega1284P
  202. //
  203. #elif MB(GEN3_MONOLITHIC)
  204. #include "pins_GEN3_MONOLITHIC.h" // ATmega644P
  205. #elif MB(GEN3_PLUS)
  206. #include "pins_GEN3_PLUS.h" // ATmega644P, ATmega1284P
  207. #elif MB(GEN6)
  208. #include "pins_GEN6.h" // ATmega644P, ATmega1284P
  209. #elif MB(GEN6_DELUXE)
  210. #include "pins_GEN6_DELUXE.h" // ATmega644P, ATmega1284P
  211. #elif MB(GEN7_CUSTOM)
  212. #include "pins_GEN7_CUSTOM.h" // ATmega644P, ATmega644, ATmega1284P
  213. #elif MB(GEN7_12)
  214. #include "pins_GEN7_12.h" // ATmega644P, ATmega644, ATmega1284P
  215. #elif MB(GEN7_13)
  216. #include "pins_GEN7_13.h" // ATmega644P, ATmega644, ATmega1284P
  217. #elif MB(GEN7_14)
  218. #include "pins_GEN7_14.h" // ATmega644P, ATmega644, ATmega1284P
  219. #elif MB(OMCA_A)
  220. #include "pins_OMCA_A.h" // ATmega644
  221. #elif MB(OMCA)
  222. #include "pins_OMCA.h" // ATmega644P, ATmega644
  223. #elif MB(ANET_10)
  224. #include "pins_ANET_10.h" // ATmega1284P
  225. #elif MB(SETHI)
  226. #include "pins_SETHI.h" // ATmega644P, ATmega644, ATmega1284P
  227. //
  228. // Teensyduino - AT90USB1286, AT90USB1286P
  229. //
  230. #elif MB(TEENSYLU)
  231. #include "pins_TEENSYLU.h" // AT90USB1286, AT90USB1286P
  232. #elif MB(PRINTRBOARD)
  233. #include "pins_PRINTRBOARD.h" // AT90USB1286
  234. #elif MB(PRINTRBOARD_REVF)
  235. #include "pins_PRINTRBOARD_REVF.h" // AT90USB1286
  236. #elif MB(BRAINWAVE)
  237. #include "pins_BRAINWAVE.h" // AT90USB646
  238. #elif MB(BRAINWAVE_PRO)
  239. #include "pins_BRAINWAVE_PRO.h" // AT90USB1286
  240. #elif MB(SAV_MKI)
  241. #include "pins_SAV_MKI.h" // AT90USB1286
  242. #elif MB(TEENSY2)
  243. #include "pins_TEENSY2.h" // AT90USB1286
  244. #elif MB(5DPRINT)
  245. #include "pins_5DPRINT.h" // AT90USB1286
  246. //
  247. // Re-ARM - LPC1768
  248. //
  249. #elif MB(RAMPS_14_RE_ARM_EFB)
  250. #include "pins_RAMPS_RE_ARM.h"
  251. #elif MB(RAMPS_14_RE_ARM_EEB)
  252. #include "pins_RAMPS_RE_ARM.h"
  253. #elif MB(RAMPS_14_RE_ARM_EFF)
  254. #include "pins_RAMPS_RE_ARM.h"
  255. #elif MB(RAMPS_14_RE_ARM_EEF)
  256. #include "pins_RAMPS_RE_ARM.h"
  257. #elif MB(RAMPS_14_RE_ARM_SF)
  258. #include "pins_RAMPS_RE_ARM.h"
  259. //
  260. // Other 32-bit Boards
  261. //
  262. #elif MB(TEENSY35_36)
  263. #include "pins_TEENSY35_36.h"
  264. #elif MB(DUE3DOM)
  265. #include "pins_DUE3DOM.h"
  266. #elif MB(DUE3DOM_MINI)
  267. #include "pins_DUE3DOM_MINI.h"
  268. #elif MB(RADDS)
  269. #include "pins_RADDS.h"
  270. #elif MB(RURAMPS4D)
  271. #include "pins_RURAMPS4D.h"
  272. #elif MB(RAMPS_FD_V1)
  273. #include "pins_RAMPS_FD_V1.h"
  274. #elif MB(RAMPS_FD_V2)
  275. #include "pins_RAMPS_FD_V2.h"
  276. #elif MB(RAMPS_SMART_EFB)
  277. #include "pins_RAMPS_SMART.h"
  278. #elif MB(RAMPS_SMART_EEB)
  279. #include "pins_RAMPS_SMART.h"
  280. #elif MB(RAMPS_SMART_EFF)
  281. #include "pins_RAMPS_SMART.h"
  282. #elif MB(RAMPS_SMART_EEF)
  283. #include "pins_RAMPS_SMART.h"
  284. #elif MB(RAMPS_SMART_SF)
  285. #include "pins_RAMPS_SMART.h"
  286. #elif MB(RAMPS_DUO_EFB)
  287. #include "pins_RAMPS_DUO.h"
  288. #elif MB(RAMPS_DUO_EEB)
  289. #include "pins_RAMPS_DUO.h"
  290. #elif MB(RAMPS_DUO_EFF)
  291. #include "pins_RAMPS_DUO.h"
  292. #elif MB(RAMPS_DUO_EEF)
  293. #include "pins_RAMPS_DUO.h"
  294. #elif MB(RAMPS_DUO_SF)
  295. #include "pins_RAMPS_DUO.h"
  296. #elif MB(RAMPS4DUE_EFB)
  297. #include "pins_RAMPS4DUE.h"
  298. #elif MB(RAMPS4DUE_EEB)
  299. #include "pins_RAMPS4DUE.h"
  300. #elif MB(RAMPS4DUE_EFF)
  301. #include "pins_RAMPS4DUE.h"
  302. #elif MB(RAMPS4DUE_EEF)
  303. #include "pins_RAMPS4DUE.h"
  304. #elif MB(RAMPS4DUE_SF)
  305. #include "pins_RAMPS4DUE.h"
  306. #elif MB(ULTRATRONICS_PRO)
  307. #include "pins_ULTRATRONICS_PRO.h"
  308. #elif MB(ARCHIM2)
  309. #include "pins_ARCHIM2.h"
  310. #elif MB(ALLIGATOR)
  311. #include "pins_ALLIGATOR_R2.h"
  312. #elif MB(STM32F1R)
  313. #include "pins_STM32F1R.h"
  314. #elif MB(STM3R_MINI)
  315. #include "pins_STM3R_MINI.h"
  316. #elif MB(MALYAN_M200)
  317. #include "pins_MALYAN_M200.h"
  318. #elif MB(BEAST)
  319. #include "pins_BEAST.h"
  320. #elif MB(CHITU3D)
  321. #include "pins_CHITU3D.h"
  322. #elif MB(MKS_SBASE)
  323. #include "pins_MKS_SBASE.h"
  324. #elif MB(AZSMZ_MINI)
  325. #include "pins_AZSMZ_MINI.h"
  326. #elif MB(AZTEEG_X5_GT)
  327. #include "pins_AZTEEG_X5_GT.h"
  328. #elif MB(BIQU_BQ111_A4)
  329. #include "pins_BIQU_BQ111_A4.h"
  330. #elif MB(THE_BORG)
  331. #include "pins_THE_BORG.h"
  332. #elif MB(SELENA_COMPACT)
  333. #include "pins_SELENA_COMPACT.h"
  334. #elif MB(COHESION3D_REMIX)
  335. #include "pins_COHESION3D_REMIX.h"
  336. #elif MB(COHESION3D_MINI)
  337. #include "pins_COHESION3D_MINI.h"
  338. #else
  339. #error "Unknown MOTHERBOARD value set in Configuration.h"
  340. #endif
  341. // Define certain undefined pins
  342. #ifndef X_MS1_PIN
  343. #define X_MS1_PIN -1
  344. #endif
  345. #ifndef X_MS2_PIN
  346. #define X_MS2_PIN -1
  347. #endif
  348. #ifndef Y_MS1_PIN
  349. #define Y_MS1_PIN -1
  350. #endif
  351. #ifndef Y_MS2_PIN
  352. #define Y_MS2_PIN -1
  353. #endif
  354. #ifndef Z_MS1_PIN
  355. #define Z_MS1_PIN -1
  356. #endif
  357. #ifndef Z_MS2_PIN
  358. #define Z_MS2_PIN -1
  359. #endif
  360. #ifndef Z_MS3_PIN
  361. #define Z_MS3_PIN -1
  362. #endif
  363. #ifndef E0_MS1_PIN
  364. #define E0_MS1_PIN -1
  365. #endif
  366. #ifndef E0_MS2_PIN
  367. #define E0_MS2_PIN -1
  368. #endif
  369. #ifndef E1_MS1_PIN
  370. #define E1_MS1_PIN -1
  371. #endif
  372. #ifndef E1_MS2_PIN
  373. #define E1_MS2_PIN -1
  374. #endif
  375. #ifndef E2_MS1_PIN
  376. #define E2_MS1_PIN -1
  377. #endif
  378. #ifndef E2_MS2_PIN
  379. #define E2_MS2_PIN -1
  380. #endif
  381. #ifndef E3_MS1_PIN
  382. #define E3_MS1_PIN -1
  383. #endif
  384. #ifndef E3_MS2_PIN
  385. #define E3_MS2_PIN -1
  386. #endif
  387. #ifndef E3_MS3_PIN
  388. #define E3_MS3_PIN -1
  389. #endif
  390. #ifndef E4_MS1_PIN
  391. #define E4_MS1_PIN -1
  392. #endif
  393. #ifndef E4_MS2_PIN
  394. #define E4_MS2_PIN -1
  395. #endif
  396. #ifndef E4_MS3_PIN
  397. #define E4_MS3_PIN -1
  398. #endif
  399. #ifndef E0_STEP_PIN
  400. #define E0_STEP_PIN -1
  401. #endif
  402. #ifndef E0_DIR_PIN
  403. #define E0_DIR_PIN -1
  404. #endif
  405. #ifndef E0_ENABLE_PIN
  406. #define E0_ENABLE_PIN -1
  407. #endif
  408. #ifndef E1_STEP_PIN
  409. #define E1_STEP_PIN -1
  410. #endif
  411. #ifndef E1_DIR_PIN
  412. #define E1_DIR_PIN -1
  413. #endif
  414. #ifndef E1_ENABLE_PIN
  415. #define E1_ENABLE_PIN -1
  416. #endif
  417. #ifndef E2_STEP_PIN
  418. #define E2_STEP_PIN -1
  419. #endif
  420. #ifndef E2_DIR_PIN
  421. #define E2_DIR_PIN -1
  422. #endif
  423. #ifndef E2_ENABLE_PIN
  424. #define E2_ENABLE_PIN -1
  425. #endif
  426. #ifndef E3_STEP_PIN
  427. #define E3_STEP_PIN -1
  428. #endif
  429. #ifndef E3_DIR_PIN
  430. #define E3_DIR_PIN -1
  431. #endif
  432. #ifndef E3_ENABLE_PIN
  433. #define E3_ENABLE_PIN -1
  434. #endif
  435. #ifndef E4_STEP_PIN
  436. #define E4_STEP_PIN -1
  437. #endif
  438. #ifndef E4_DIR_PIN
  439. #define E4_DIR_PIN -1
  440. #endif
  441. #ifndef E4_ENABLE_PIN
  442. #define E4_ENABLE_PIN -1
  443. #endif
  444. #ifndef X_CS_PIN
  445. #define X_CS_PIN -1
  446. #endif
  447. #ifndef Y_CS_PIN
  448. #define Y_CS_PIN -1
  449. #endif
  450. #ifndef Z_CS_PIN
  451. #define Z_CS_PIN -1
  452. #endif
  453. #ifndef E0_CS_PIN
  454. #define E0_CS_PIN -1
  455. #endif
  456. #ifndef E1_CS_PIN
  457. #define E1_CS_PIN -1
  458. #endif
  459. #ifndef E2_CS_PIN
  460. #define E2_CS_PIN -1
  461. #endif
  462. #ifndef E3_CS_PIN
  463. #define E3_CS_PIN -1
  464. #endif
  465. #ifndef E4_CS_PIN
  466. #define E4_CS_PIN -1
  467. #endif
  468. #ifndef FAN_PIN
  469. #define FAN_PIN -1
  470. #endif
  471. #ifndef FAN1_PIN
  472. #define FAN1_PIN -1
  473. #endif
  474. #ifndef FAN2_PIN
  475. #define FAN2_PIN -1
  476. #endif
  477. #ifndef CONTROLLER_FAN_PIN
  478. #define CONTROLLER_FAN_PIN -1
  479. #endif
  480. #ifndef FANMUX0_PIN
  481. #define FANMUX0_PIN -1
  482. #endif
  483. #ifndef FANMUX1_PIN
  484. #define FANMUX1_PIN -1
  485. #endif
  486. #ifndef FANMUX2_PIN
  487. #define FANMUX2_PIN -1
  488. #endif
  489. #ifndef HEATER_0_PIN
  490. #define HEATER_0_PIN -1
  491. #endif
  492. #ifndef HEATER_1_PIN
  493. #define HEATER_1_PIN -1
  494. #endif
  495. #ifndef HEATER_2_PIN
  496. #define HEATER_2_PIN -1
  497. #endif
  498. #ifndef HEATER_3_PIN
  499. #define HEATER_3_PIN -1
  500. #endif
  501. #ifndef HEATER_4_PIN
  502. #define HEATER_4_PIN -1
  503. #endif
  504. #ifndef HEATER_BED_PIN
  505. #define HEATER_BED_PIN -1
  506. #endif
  507. #ifndef TEMP_0_PIN
  508. #define TEMP_0_PIN -1
  509. #endif
  510. #ifndef TEMP_1_PIN
  511. #define TEMP_1_PIN -1
  512. #endif
  513. #ifndef TEMP_2_PIN
  514. #define TEMP_2_PIN -1
  515. #endif
  516. #ifndef TEMP_3_PIN
  517. #define TEMP_3_PIN -1
  518. #endif
  519. #ifndef TEMP_4_PIN
  520. #define TEMP_4_PIN -1
  521. #endif
  522. #ifndef TEMP_BED_PIN
  523. #define TEMP_BED_PIN -1
  524. #endif
  525. #ifndef SD_DETECT_PIN
  526. #define SD_DETECT_PIN -1
  527. #endif
  528. #ifndef SDPOWER
  529. #define SDPOWER -1
  530. #endif
  531. #ifndef SDSS
  532. #define SDSS -1
  533. #endif
  534. #ifndef LED_PIN
  535. #define LED_PIN -1
  536. #endif
  537. #ifndef PS_ON_PIN
  538. #define PS_ON_PIN -1
  539. #endif
  540. #ifndef KILL_PIN
  541. #define KILL_PIN -1
  542. #endif
  543. #ifndef SUICIDE_PIN
  544. #define SUICIDE_PIN -1
  545. #endif
  546. #ifndef MAX_EXTRUDERS
  547. #define MAX_EXTRUDERS 5
  548. #endif
  549. //
  550. // Assign auto fan pins if needed
  551. //
  552. #ifndef E0_AUTO_FAN_PIN
  553. #ifdef ORIG_E0_AUTO_FAN_PIN
  554. #define E0_AUTO_FAN_PIN ORIG_E0_AUTO_FAN_PIN
  555. #else
  556. #define E0_AUTO_FAN_PIN -1
  557. #endif
  558. #endif
  559. #ifndef E1_AUTO_FAN_PIN
  560. #ifdef ORIG_E1_AUTO_FAN_PIN
  561. #define E1_AUTO_FAN_PIN ORIG_E1_AUTO_FAN_PIN
  562. #else
  563. #define E1_AUTO_FAN_PIN -1
  564. #endif
  565. #endif
  566. #ifndef E2_AUTO_FAN_PIN
  567. #ifdef ORIG_E2_AUTO_FAN_PIN
  568. #define E2_AUTO_FAN_PIN ORIG_E2_AUTO_FAN_PIN
  569. #else
  570. #define E2_AUTO_FAN_PIN -1
  571. #endif
  572. #endif
  573. #ifndef E3_AUTO_FAN_PIN
  574. #ifdef ORIG_E3_AUTO_FAN_PIN
  575. #define E3_AUTO_FAN_PIN ORIG_E3_AUTO_FAN_PIN
  576. #else
  577. #define E3_AUTO_FAN_PIN -1
  578. #endif
  579. #endif
  580. #ifndef E4_AUTO_FAN_PIN
  581. #ifdef ORIG_E4_AUTO_FAN_PIN
  582. #define E4_AUTO_FAN_PIN ORIG_E4_AUTO_FAN_PIN
  583. #else
  584. #define E4_AUTO_FAN_PIN -1
  585. #endif
  586. #endif
  587. // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  588. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN, E0_CS_PIN,
  589. #define _E1_PINS
  590. #define _E2_PINS
  591. #define _E3_PINS
  592. #define _E4_PINS
  593. #if ENABLED(SWITCHING_EXTRUDER)
  594. // Tools 0 and 1 use E0
  595. #if EXTRUDERS > 2 // Tools 2 and 3 use E1
  596. #undef _E1_PINS
  597. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
  598. #if EXTRUDERS > 4 // Tools 4 and 5 use E2
  599. #undef _E2_PINS
  600. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
  601. #endif
  602. #endif
  603. #elif EXTRUDERS > 1
  604. #undef _E1_PINS
  605. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
  606. #if EXTRUDERS > 2
  607. #undef _E2_PINS
  608. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
  609. #if EXTRUDERS > 3
  610. #undef _E3_PINS
  611. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_MS3_PIN, E3_CS_PIN,
  612. #if EXTRUDERS > 4
  613. #undef _E4_PINS
  614. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_MS3_PIN, E4_CS_PIN,
  615. #endif // EXTRUDERS > 4
  616. #endif // EXTRUDERS > 3
  617. #endif // EXTRUDERS > 2
  618. #endif // EXTRUDERS > 1
  619. #define _H0_PINS HEATER_0_PIN, E0_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_0_PIN),
  620. #define _H1_PINS
  621. #define _H2_PINS
  622. #define _H3_PINS
  623. #define _H4_PINS
  624. #if HOTENDS > 1
  625. #undef _H1_PINS
  626. #define _H1_PINS HEATER_1_PIN, E1_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_1_PIN),
  627. #if HOTENDS > 2
  628. #undef _H2_PINS
  629. #define _H2_PINS HEATER_2_PIN, E2_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_2_PIN),
  630. #if HOTENDS > 3
  631. #undef _H3_PINS
  632. #define _H3_PINS HEATER_3_PIN, E3_AUTO_FAN_PIN, analogInputToDigitalPin(TEMP_3_PIN),
  633. #if HOTENDS > 4
  634. #undef _H4_PINS
  635. #define _H4_PINS HEATER_4_PIN, analogInputToDigitalPin(TEMP_4_PIN),
  636. #endif // HOTENDS > 4
  637. #endif // HOTENDS > 3
  638. #endif // HOTENDS > 2
  639. #elif ENABLED(MIXING_EXTRUDER)
  640. #undef _E1_PINS
  641. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN, E1_CS_PIN,
  642. #if MIXING_STEPPERS > 2
  643. #undef _E2_PINS
  644. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN, E2_MS1_PIN, E2_MS2_PIN, E2_CS_PIN,
  645. #if MIXING_STEPPERS > 3
  646. #undef _E3_PINS
  647. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN, E3_MS1_PIN, E3_MS2_PIN, E3_CS_PIN,
  648. #if MIXING_STEPPERS > 4
  649. #undef _E4_PINS
  650. #define _E4_PINS E4_STEP_PIN, E4_DIR_PIN, E4_ENABLE_PIN, E4_MS1_PIN, E4_MS2_PIN, E4_CS_PIN,
  651. #endif // MIXING_STEPPERS > 4
  652. #endif // MIXING_STEPPERS > 3
  653. #endif // MIXING_STEPPERS > 2
  654. #endif // MIXING_STEPPERS > 1
  655. #define BED_PINS HEATER_BED_PIN, analogInputToDigitalPin(TEMP_BED_PIN),
  656. //
  657. // Assign endstop pins for boards with only 3 connectors
  658. //
  659. #ifdef X_STOP_PIN
  660. #if X_HOME_DIR < 0
  661. #define X_MIN_PIN X_STOP_PIN
  662. #define X_MAX_PIN -1
  663. #else
  664. #define X_MIN_PIN -1
  665. #define X_MAX_PIN X_STOP_PIN
  666. #endif
  667. #endif
  668. #ifdef Y_STOP_PIN
  669. #if Y_HOME_DIR < 0
  670. #define Y_MIN_PIN Y_STOP_PIN
  671. #define Y_MAX_PIN -1
  672. #else
  673. #define Y_MIN_PIN -1
  674. #define Y_MAX_PIN Y_STOP_PIN
  675. #endif
  676. #endif
  677. #ifdef Z_STOP_PIN
  678. #if Z_HOME_DIR < 0
  679. #define Z_MIN_PIN Z_STOP_PIN
  680. #define Z_MAX_PIN -1
  681. #else
  682. #define Z_MIN_PIN -1
  683. #define Z_MAX_PIN Z_STOP_PIN
  684. #endif
  685. #endif
  686. //
  687. // Disable unused endstop / probe pins
  688. //
  689. #if DISABLED(Z_MIN_PROBE_ENDSTOP)
  690. #undef Z_MIN_PROBE_PIN
  691. #define Z_MIN_PROBE_PIN -1
  692. #endif
  693. #if DISABLED(USE_XMAX_PLUG)
  694. #undef X_MAX_PIN
  695. #define X_MAX_PIN -1
  696. #endif
  697. #if DISABLED(USE_YMAX_PLUG)
  698. #undef Y_MAX_PIN
  699. #define Y_MAX_PIN -1
  700. #endif
  701. #if DISABLED(USE_ZMAX_PLUG)
  702. #undef Z_MAX_PIN
  703. #define Z_MAX_PIN -1
  704. #endif
  705. #if DISABLED(USE_XMIN_PLUG)
  706. #undef X_MIN_PIN
  707. #define X_MIN_PIN -1
  708. #endif
  709. #if DISABLED(USE_YMIN_PLUG)
  710. #undef Y_MIN_PIN
  711. #define Y_MIN_PIN -1
  712. #endif
  713. #if DISABLED(USE_ZMIN_PLUG)
  714. #undef Z_MIN_PIN
  715. #define Z_MIN_PIN -1
  716. #endif
  717. #ifndef LCD_PINS_D4
  718. #define LCD_PINS_D4 -1
  719. #endif
  720. #ifndef LCD_PINS_D5
  721. #define LCD_PINS_D5 -1
  722. #endif
  723. #ifndef LCD_PINS_D6
  724. #define LCD_PINS_D6 -1
  725. #endif
  726. #ifndef LCD_PINS_D7
  727. #define LCD_PINS_D7 -1
  728. #endif
  729. //
  730. // Dual X-carriage, Dual Y, Dual Z support
  731. //
  732. #define _X2_PINS
  733. #define _Y2_PINS
  734. #define _Z2_PINS
  735. #define __EPIN(p,q) E##p##_##q##_PIN
  736. #define _EPIN(p,q) __EPIN(p,q)
  737. // The X2 axis, if any, should be the next open extruder port
  738. #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(X_DUAL_STEPPER_DRIVERS)
  739. #ifndef X2_STEP_PIN
  740. #define X2_STEP_PIN _EPIN(E_STEPPERS, STEP)
  741. #define X2_DIR_PIN _EPIN(E_STEPPERS, DIR)
  742. #define X2_ENABLE_PIN _EPIN(E_STEPPERS, ENABLE)
  743. #ifndef X2_CS_PIN
  744. #define X2_CS_PIN _EPIN(E_STEPPERS, CS)
  745. #endif
  746. #if E_STEPPERS > 4 || !PIN_EXISTS(X2_ENABLE)
  747. #error "No E stepper plug left for X2!"
  748. #endif
  749. #endif
  750. #undef _X2_PINS
  751. #define __X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
  752. #ifdef X2_CS_PIN
  753. #define _X2_PINS __X2_PINS X2_CS_PIN,
  754. #else
  755. #define _X2_PINS __X2_PINS
  756. #endif
  757. #define Y2_E_INDEX INCREMENT(E_STEPPERS)
  758. #else
  759. #define Y2_E_INDEX E_STEPPERS
  760. #endif
  761. // The Y2 axis, if any, should be the next open extruder port
  762. #if ENABLED(Y_DUAL_STEPPER_DRIVERS)
  763. #ifndef Y2_STEP_PIN
  764. #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
  765. #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
  766. #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
  767. #ifndef Y2_CS_PIN
  768. #define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS)
  769. #endif
  770. #if Y2_E_INDEX > 4 || !PIN_EXISTS(Y2_ENABLE)
  771. #error "No E stepper plug left for Y2!"
  772. #endif
  773. #endif
  774. #undef _Y2_PINS
  775. #define __Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
  776. #ifdef Y2_CS_PIN
  777. #define _Y2_PINS __Y2_PINS Y2_CS_PIN,
  778. #else
  779. #define _Y2_PINS __Y2_PINS
  780. #endif
  781. #define Z2_E_INDEX INCREMENT(Y2_E_INDEX)
  782. #else
  783. #define Z2_E_INDEX Y2_E_INDEX
  784. #endif
  785. // The Z2 axis, if any, should be the next open extruder port
  786. #if ENABLED(Z_DUAL_STEPPER_DRIVERS)
  787. #ifndef Z2_STEP_PIN
  788. #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
  789. #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
  790. #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
  791. #ifndef Z2_CS_PIN
  792. #define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS)
  793. #endif
  794. #if Z2_E_INDEX > 4 || !PIN_EXISTS(Z2_ENABLE)
  795. #error "No E stepper plug left for Z2!"
  796. #endif
  797. #endif
  798. #undef _Z2_PINS
  799. #define __Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
  800. #ifdef Z2_CS_PIN
  801. #define _Z2_PINS __Z2_PINS Z2_CS_PIN,
  802. #else
  803. #define _Z2_PINS __Z2_PINS
  804. #endif
  805. #endif
  806. #ifndef HAL_SENSITIVE_PINS
  807. #define HAL_SENSITIVE_PINS
  808. #endif
  809. #define SENSITIVE_PINS { \
  810. X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, X_MS1_PIN, X_MS2_PIN, X_CS_PIN, \
  811. Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Y_MS1_PIN, Y_MS2_PIN, Y_CS_PIN, \
  812. Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MS1_PIN, Z_MS2_PIN, Z_MS3_PIN, Z_CS_PIN, Z_MIN_PROBE_PIN, \
  813. PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLER_FAN_PIN, \
  814. _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS BED_PINS \
  815. _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS \
  816. _X2_PINS _Y2_PINS _Z2_PINS \
  817. HAL_SENSITIVE_PINS \
  818. }
  819. #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
  820. // Note: default SPI pins are defined in the HAL
  821. #include "../HAL/HAL_spi_pins.h"
  822. #endif // __PINS_H__