My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

pins.h 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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. #ifndef PINS_H
  23. #define PINS_H
  24. #if MB(GEN7_CUSTOM)
  25. #include "pins_GEN7_CUSTOM.h"
  26. #elif MB(GEN7_12)
  27. #include "pins_GEN7_12.h"
  28. #elif MB(GEN7_13)
  29. #include "pins_GEN7_13.h"
  30. #elif MB(GEN7_14)
  31. #include "pins_GEN7_14.h"
  32. #elif MB(CNCONTROLS_12)
  33. #include "pins_CNCONTROLS_12.h"
  34. #elif MB(CHEAPTRONIC)
  35. #include "pins_CHEAPTRONIC.h"
  36. #elif MB(SETHI)
  37. #include "pins_SETHI.h"
  38. #elif MB(RAMPS_OLD)
  39. #include "pins_RAMPS_OLD.h"
  40. #elif MB(RAMPS_13_EFB)
  41. #include "pins_RAMPS_13_EFB.h"
  42. #elif MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
  43. #include "pins_RAMPS_13.h"
  44. #elif MB(RAMPS_14_EFB)
  45. #include "pins_RAMPS_14_EFB.h"
  46. #elif MB(RAMPS_14_EEB) || MB(RAMPS_14_EFF) || MB(RAMPS_14_EEF) || MB(RAMPS_14_SF)
  47. #include "pins_RAMPS_14.h"
  48. #elif MB(GEN6)
  49. #include "pins_GEN6.h"
  50. #elif MB(GEN6_DELUXE)
  51. #include "pins_GEN6_DELUXE.h"
  52. #elif MB(SANGUINOLOLU_11)
  53. #include "pins_SANGUINOLOLU_11.h"
  54. #elif MB(SANGUINOLOLU_12)
  55. #include "pins_SANGUINOLOLU_12.h"
  56. #elif MB(MELZI)
  57. #include "pins_MELZI.h"
  58. #elif MB(STB_11)
  59. #include "pins_STB_11.h"
  60. #elif MB(AZTEEG_X1)
  61. #include "pins_AZTEEG_X1.h"
  62. #elif MB(MELZI_MAKR3D)
  63. #include "pins_MELZI_MAKR3D.h"
  64. #elif MB(AZTEEG_X3)
  65. #include "pins_AZTEEG_X3.h"
  66. #elif MB(AZTEEG_X3_PRO)
  67. #include "pins_AZTEEG_X3_PRO.h"
  68. #elif MB(ULTIMAKER)
  69. #include "pins_ULTIMAKER.h"
  70. #elif MB(ULTIMAKER_OLD)
  71. #include "pins_ULTIMAKER_OLD.h"
  72. #elif MB(ULTIMAIN_2)
  73. #include "pins_ULTIMAIN_2.h"
  74. #elif MB(3DRAG)
  75. #include "pins_3DRAG.h"
  76. #elif MB(K8200)
  77. #include "pins_K8200.h"
  78. #elif MB(TEENSYLU)
  79. #include "pins_TEENSYLU.h"
  80. #elif MB(RUMBA)
  81. #include "pins_RUMBA.h"
  82. #elif MB(PRINTRBOARD)
  83. #include "pins_PRINTRBOARD.h"
  84. #elif MB(PRINTRBOARD_REVF)
  85. #include "pins_PRINTRBOARD_REVF.h"
  86. #elif MB(BRAINWAVE)
  87. #include "pins_BRAINWAVE.h"
  88. #elif MB(BRAINWAVE_PRO)
  89. #include "pins_BRAINWAVE_PRO.h"
  90. #elif MB(SAV_MKI)
  91. #include "pins_SAV_MKI.h"
  92. #elif MB(TEENSY2)
  93. #include "pins_TEENSY2.h"
  94. #elif MB(GEN3_PLUS)
  95. #include "pins_GEN3_PLUS.h"
  96. #elif MB(GEN3_MONOLITHIC)
  97. #include "pins_GEN3_MONOLITHIC.h"
  98. #elif MB(MEGATRONICS)
  99. #include "pins_MEGATRONICS.h"
  100. #elif MB(MINITRONICS)
  101. #include "pins_MINITRONICS.h"
  102. #elif MB(MEGATRONICS_2)
  103. #include "pins_MEGATRONICS_2.h"
  104. #elif MB(MEGATRONICS_3)
  105. #include "pins_MEGATRONICS_3.h"
  106. #elif MB(OMCA_A)
  107. #include "pins_OMCA_A.h"
  108. #elif MB(OMCA)
  109. #include "pins_OMCA.h"
  110. #elif MB(RAMBO)
  111. #include "pins_RAMBO.h"
  112. #elif MB(MINIRAMBO)
  113. #include "pins_MINIRAMBO.h"
  114. #elif MB(ELEFU_3)
  115. #include "pins_ELEFU_3.h"
  116. #elif MB(5DPRINT)
  117. #include "pins_5DPRINT.h"
  118. #elif MB(LEAPFROG)
  119. #include "pins_LEAPFROG.h"
  120. #elif MB(BAM_DICE)
  121. #include "pins_RAMPS_14.h"
  122. #elif MB(BAM_DICE_DUE)
  123. #include "pins_BAM_DICE_DUE.h"
  124. #elif MB(FELIX2)
  125. #include "pins_FELIX2.h"
  126. #elif MB(MKS_BASE)
  127. #include "pins_MKS_BASE.h"
  128. #elif MB(RIGIDBOARD)
  129. #include "pins_RIGIDBOARD.h"
  130. #elif MB(RIGIDBOARD_V2)
  131. #include "pins_RIGIDBOARD_V2.h"
  132. #elif MB(MEGACONTROLLER)
  133. #include "pins_MEGACONTROLLER.h"
  134. #elif MB(BQ_ZUM_MEGA_3D)
  135. #include "pins_BQ_ZUM_MEGA_3D.h"
  136. #elif MB(99)
  137. #include "pins_99.h"
  138. #elif MB(AJ4P)
  139. #include "pins_AJ4P.h"
  140. #elif MB(MKS_13)
  141. #include "pins_MKS_13.h"
  142. #elif MB(SAINSMART_2IN1)
  143. #include "pins_SAINSMART_2IN1.h"
  144. #else
  145. #error "Unknown MOTHERBOARD value set in Configuration.h"
  146. #endif
  147. // Define certain undefined pins
  148. #ifndef X_MS1_PIN
  149. #define X_MS1_PIN -1
  150. #endif
  151. #ifndef X_MS2_PIN
  152. #define X_MS2_PIN -1
  153. #endif
  154. #ifndef Y_MS1_PIN
  155. #define Y_MS1_PIN -1
  156. #endif
  157. #ifndef Y_MS2_PIN
  158. #define Y_MS2_PIN -1
  159. #endif
  160. #ifndef Z_MS1_PIN
  161. #define Z_MS1_PIN -1
  162. #endif
  163. #ifndef Z_MS2_PIN
  164. #define Z_MS2_PIN -1
  165. #endif
  166. #ifndef E0_MS1_PIN
  167. #define E0_MS1_PIN -1
  168. #endif
  169. #ifndef E0_MS2_PIN
  170. #define E0_MS2_PIN -1
  171. #endif
  172. #ifndef E1_MS1_PIN
  173. #define E1_MS1_PIN -1
  174. #endif
  175. #ifndef E1_MS2_PIN
  176. #define E1_MS2_PIN -1
  177. #endif
  178. #ifndef FAN_PIN
  179. #define FAN_PIN -1
  180. #endif
  181. #ifndef FAN1_PIN
  182. #define FAN1_PIN -1
  183. #endif
  184. #ifndef FAN2_PIN
  185. #define FAN2_PIN -1
  186. #endif
  187. #ifndef HEATER_0_PIN
  188. #define HEATER_0_PIN -1
  189. #endif
  190. #ifndef HEATER_1_PIN
  191. #define HEATER_1_PIN -1
  192. #endif
  193. #ifndef HEATER_2_PIN
  194. #define HEATER_2_PIN -1
  195. #endif
  196. #ifndef HEATER_3_PIN
  197. #define HEATER_3_PIN -1
  198. #endif
  199. #ifndef HEATER_BED_PIN
  200. #define HEATER_BED_PIN -1
  201. #endif
  202. #ifndef TEMP_0_PIN
  203. #define TEMP_0_PIN -1
  204. #endif
  205. #ifndef TEMP_1_PIN
  206. #define TEMP_1_PIN -1
  207. #endif
  208. #ifndef TEMP_2_PIN
  209. #define TEMP_2_PIN -1
  210. #endif
  211. #ifndef TEMP_3_PIN
  212. #define TEMP_3_PIN -1
  213. #endif
  214. #ifndef TEMP_BED_PIN
  215. #define TEMP_BED_PIN -1
  216. #endif
  217. #ifndef SD_DETECT_PIN
  218. #define SD_DETECT_PIN -1
  219. #endif
  220. #ifndef SDPOWER
  221. #define SDPOWER -1
  222. #endif
  223. #ifndef SDSS
  224. #define SDSS -1
  225. #endif
  226. #ifndef LED_PIN
  227. #define LED_PIN -1
  228. #endif
  229. #ifndef PS_ON_PIN
  230. #define PS_ON_PIN -1
  231. #endif
  232. #ifndef KILL_PIN
  233. #define KILL_PIN -1
  234. #endif
  235. #ifndef SUICIDE_PIN
  236. #define SUICIDE_PIN -1
  237. #endif
  238. // Marlin needs to account for pins that equal -1
  239. #define marlinAnalogInputToDigitalPin(p) ((p) == -1 ? -1 : (p) + 0xA0)
  240. // List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
  241. #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, E0_MS1_PIN, E0_MS2_PIN,
  242. #define _E1_PINS
  243. #define _E2_PINS
  244. #define _E3_PINS
  245. #if EXTRUDERS > 1
  246. #undef _E1_PINS
  247. #define _E1_PINS E1_STEP_PIN, E1_DIR_PIN, E1_ENABLE_PIN, E1_MS1_PIN, E1_MS2_PIN,
  248. #if EXTRUDERS > 2
  249. #undef _E2_PINS
  250. #define _E2_PINS E2_STEP_PIN, E2_DIR_PIN, E2_ENABLE_PIN,
  251. #if EXTRUDERS > 3
  252. #undef _E3_PINS
  253. #define _E3_PINS E3_STEP_PIN, E3_DIR_PIN, E3_ENABLE_PIN,
  254. #endif
  255. #endif
  256. #endif
  257. #define _H0_PINS HEATER_0_PIN, EXTRUDER_0_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_0_PIN),
  258. #define _H1_PINS
  259. #define _H2_PINS
  260. #define _H3_PINS
  261. #if HOTENDS > 1
  262. #undef _H1_PINS
  263. #define _H1_PINS HEATER_1_PIN, EXTRUDER_1_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_1_PIN),
  264. #if HOTENDS > 2
  265. #undef _H2_PINS
  266. #define _H2_PINS HEATER_2_PIN, EXTRUDER_2_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_2_PIN),
  267. #if HOTENDS > 3
  268. #undef _H3_PINS
  269. #define _H3_PINS HEATER_3_PIN, EXTRUDER_3_AUTO_FAN_PIN, marlinAnalogInputToDigitalPin(TEMP_3_PIN),
  270. #endif
  271. #endif
  272. #endif
  273. #define BED_PINS HEATER_BED_PIN, marlinAnalogInputToDigitalPin(TEMP_BED_PIN),
  274. //
  275. // Assign endstop pins for boards with only 3 connectors
  276. //
  277. #ifdef X_STOP_PIN
  278. #if X_HOME_DIR < 0
  279. #define X_MIN_PIN X_STOP_PIN
  280. #define X_MAX_PIN -1
  281. #else
  282. #define X_MIN_PIN -1
  283. #define X_MAX_PIN X_STOP_PIN
  284. #endif
  285. #endif
  286. #ifdef Y_STOP_PIN
  287. #if Y_HOME_DIR < 0
  288. #define Y_MIN_PIN Y_STOP_PIN
  289. #define Y_MAX_PIN -1
  290. #else
  291. #define Y_MIN_PIN -1
  292. #define Y_MAX_PIN Y_STOP_PIN
  293. #endif
  294. #endif
  295. #ifdef Z_STOP_PIN
  296. #if Z_HOME_DIR < 0
  297. #define Z_MIN_PIN Z_STOP_PIN
  298. #define Z_MAX_PIN -1
  299. #else
  300. #define Z_MIN_PIN -1
  301. #define Z_MAX_PIN Z_STOP_PIN
  302. #endif
  303. #endif
  304. //
  305. // Disable unused endstop / probe pins
  306. //
  307. #if ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) || DISABLED(Z_MIN_PROBE_ENDSTOP) // Allow code to compile regardless of Z_MIN_PROBE_ENDSTOP setting.
  308. #undef Z_MIN_PROBE_PIN
  309. #define Z_MIN_PROBE_PIN -1
  310. #endif
  311. #if DISABLED(USE_XMAX_PLUG)
  312. #undef X_MAX_PIN
  313. #define X_MAX_PIN -1
  314. #endif
  315. #if DISABLED(USE_YMAX_PLUG)
  316. #undef Y_MAX_PIN
  317. #define Y_MAX_PIN -1
  318. #endif
  319. #if DISABLED(USE_ZMAX_PLUG)
  320. #undef Z_MAX_PIN
  321. #define Z_MAX_PIN -1
  322. #endif
  323. #if DISABLED(USE_XMIN_PLUG)
  324. #undef X_MIN_PIN
  325. #define X_MIN_PIN -1
  326. #endif
  327. #if DISABLED(USE_YMIN_PLUG)
  328. #undef Y_MIN_PIN
  329. #define Y_MIN_PIN -1
  330. #endif
  331. #if DISABLED(USE_ZMIN_PLUG)
  332. #undef Z_MIN_PIN
  333. #define Z_MIN_PIN -1
  334. #endif
  335. //
  336. // Dual X-carriage, Dual Y, Dual Z support
  337. //
  338. #define _X2_PINS
  339. #define _Y2_PINS
  340. #define _Z2_PINS
  341. #define __EPIN(p,q) E##p##_##q##_PIN
  342. #define _EPIN(p,q) __EPIN(p,q)
  343. #if ENABLED(DUAL_X_CARRIAGE)
  344. // The X2 axis, if any, should be the next open extruder port
  345. #ifndef X2_STEP_PIN
  346. #define X2_STEP_PIN _EPIN(EXTRUDERS, STEP)
  347. #define X2_DIR_PIN _EPIN(EXTRUDERS, DIR)
  348. #define X2_ENABLE_PIN _EPIN(EXTRUDERS, ENABLE)
  349. #endif
  350. #undef _X2_PINS
  351. #define _X2_PINS X2_STEP_PIN, X2_DIR_PIN, X2_ENABLE_PIN,
  352. #define Y2_Z2_E_INDEX INCREMENT(EXTRUDERS)
  353. #else
  354. #define Y2_Z2_E_INDEX EXTRUDERS
  355. #endif
  356. // The Y2 axis, if any, should be the next open extruder port
  357. #if ENABLED(Y_DUAL_STEPPER_DRIVERS) && !defined(Y2_STEP_PIN)
  358. #define Y2_STEP_PIN _EPIN(Y2_Z2_E_INDEX, STEP)
  359. #define Y2_DIR_PIN _EPIN(Y2_Z2_E_INDEX, DIR)
  360. #define Y2_ENABLE_PIN _EPIN(Y2_Z2_E_INDEX, ENABLE)
  361. #undef _Y2_PINS
  362. #define _Y2_PINS Y2_STEP_PIN, Y2_DIR_PIN, Y2_ENABLE_PIN,
  363. #endif
  364. // The Z2 axis, if any, should be the next open extruder port
  365. #if ENABLED(Z_DUAL_STEPPER_DRIVERS) && !defined(Z2_STEP_PIN)
  366. #define Z2_STEP_PIN _EPIN(Y2_Z2_E_INDEX, STEP)
  367. #define Z2_DIR_PIN _EPIN(Y2_Z2_E_INDEX, DIR)
  368. #define Z2_ENABLE_PIN _EPIN(Y2_Z2_E_INDEX, ENABLE)
  369. #undef _Z2_PINS
  370. #define _Z2_PINS Z2_STEP_PIN, Z2_DIR_PIN, Z2_ENABLE_PIN,
  371. #endif
  372. #define SENSITIVE_PINS { 0, 1, \
  373. X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, \
  374. Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, \
  375. Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, Z_MIN_PROBE_PIN, \
  376. PS_ON_PIN, HEATER_BED_PIN, FAN_PIN, FAN1_PIN, FAN2_PIN, CONTROLLERFAN_PIN, \
  377. _E0_PINS _E1_PINS _E2_PINS _E3_PINS BED_PINS \
  378. _H0_PINS _H1_PINS _H2_PINS _H3_PINS \
  379. _X2_PINS _Y2_PINS _Z2_PINS \
  380. X_MS1_PIN, X_MS2_PIN, Y_MS1_PIN, Y_MS2_PIN, Z_MS1_PIN, Z_MS2_PIN \
  381. }
  382. #define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
  383. #endif //__PINS_H