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

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