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 18KB

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