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

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