My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

fastio_168.h 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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. * Pin mapping for the 168, 328, and 328P
  24. *
  25. * 168 08 09 10 11 12 13 14 15 16 17 18 19 20 21 00 01 02 03 04 05 06 07
  26. * Port B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7
  27. * Marlin 08 09 10 11 12 13 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  28. */
  29. #ifndef _FASTIO_168
  30. #define _FASTIO_168
  31. #include "fastio.h"
  32. #define DEBUG_LED AIO5
  33. // UART
  34. #define RXD DIO0
  35. #define TXD DIO1
  36. // SPI
  37. #define SCK DIO13
  38. #define MISO DIO12
  39. #define MOSI DIO11
  40. #define SS DIO10
  41. // TWI (I2C)
  42. #define SCL AIO5
  43. #define SDA AIO4
  44. // Timers and PWM
  45. #define OC0A DIO6
  46. #define OC0B DIO5
  47. #define OC1A DIO9
  48. #define OC1B DIO10
  49. #define OC2A DIO11
  50. #define OC2B DIO3
  51. // Digital I/O
  52. #define DIO0_PIN PIND0
  53. #define DIO0_RPORT PIND
  54. #define DIO0_WPORT PORTD
  55. #define DIO0_DDR DDRD
  56. #define DIO0_PWM NULL
  57. #define DIO1_PIN PIND1
  58. #define DIO1_RPORT PIND
  59. #define DIO1_WPORT PORTD
  60. #define DIO1_DDR DDRD
  61. #define DIO1_PWM NULL
  62. #define DIO2_PIN PIND2
  63. #define DIO2_RPORT PIND
  64. #define DIO2_WPORT PORTD
  65. #define DIO2_DDR DDRD
  66. #define DIO2_PWM NULL
  67. #define DIO3_PIN PIND3
  68. #define DIO3_RPORT PIND
  69. #define DIO3_WPORT PORTD
  70. #define DIO3_DDR DDRD
  71. #define DIO3_PWM &OCR2B
  72. #define DIO4_PIN PIND4
  73. #define DIO4_RPORT PIND
  74. #define DIO4_WPORT PORTD
  75. #define DIO4_DDR DDRD
  76. #define DIO4_PWM NULL
  77. #define DIO5_PIN PIND5
  78. #define DIO5_RPORT PIND
  79. #define DIO5_WPORT PORTD
  80. #define DIO5_DDR DDRD
  81. #define DIO5_PWM &OCR0B
  82. #define DIO6_PIN PIND6
  83. #define DIO6_RPORT PIND
  84. #define DIO6_WPORT PORTD
  85. #define DIO6_DDR DDRD
  86. #define DIO6_PWM &OCR0A
  87. #define DIO7_PIN PIND7
  88. #define DIO7_RPORT PIND
  89. #define DIO7_WPORT PORTD
  90. #define DIO7_DDR DDRD
  91. #define DIO7_PWM NULL
  92. #define DIO8_PIN PINB0
  93. #define DIO8_RPORT PINB
  94. #define DIO8_WPORT PORTB
  95. #define DIO8_DDR DDRB
  96. #define DIO8_PWM NULL
  97. #define DIO9_PIN PINB1
  98. #define DIO9_RPORT PINB
  99. #define DIO9_WPORT PORTB
  100. #define DIO9_DDR DDRB
  101. #define DIO9_PWM NULL
  102. #define DIO10_PIN PINB2
  103. #define DIO10_RPORT PINB
  104. #define DIO10_WPORT PORTB
  105. #define DIO10_DDR DDRB
  106. #define DIO10_PWM NULL
  107. #define DIO11_PIN PINB3
  108. #define DIO11_RPORT PINB
  109. #define DIO11_WPORT PORTB
  110. #define DIO11_DDR DDRB
  111. #define DIO11_PWM &OCR2A
  112. #define DIO12_PIN PINB4
  113. #define DIO12_RPORT PINB
  114. #define DIO12_WPORT PORTB
  115. #define DIO12_DDR DDRB
  116. #define DIO12_PWM NULL
  117. #define DIO13_PIN PINB5
  118. #define DIO13_RPORT PINB
  119. #define DIO13_WPORT PORTB
  120. #define DIO13_DDR DDRB
  121. #define DIO13_PWM NULL
  122. #define DIO14_PIN PINC0
  123. #define DIO14_RPORT PINC
  124. #define DIO14_WPORT PORTC
  125. #define DIO14_DDR DDRC
  126. #define DIO14_PWM NULL
  127. #define DIO15_PIN PINC1
  128. #define DIO15_RPORT PINC
  129. #define DIO15_WPORT PORTC
  130. #define DIO15_DDR DDRC
  131. #define DIO15_PWM NULL
  132. #define DIO16_PIN PINC2
  133. #define DIO16_RPORT PINC
  134. #define DIO16_WPORT PORTC
  135. #define DIO16_DDR DDRC
  136. #define DIO16_PWM NULL
  137. #define DIO17_PIN PINC3
  138. #define DIO17_RPORT PINC
  139. #define DIO17_WPORT PORTC
  140. #define DIO17_DDR DDRC
  141. #define DIO17_PWM NULL
  142. #define DIO18_PIN PINC4
  143. #define DIO18_RPORT PINC
  144. #define DIO18_WPORT PORTC
  145. #define DIO18_DDR DDRC
  146. #define DIO18_PWM NULL
  147. #define DIO19_PIN PINC5
  148. #define DIO19_RPORT PINC
  149. #define DIO19_WPORT PORTC
  150. #define DIO19_DDR DDRC
  151. #define DIO19_PWM NULL
  152. #define DIO20_PIN PINC6
  153. #define DIO20_RPORT PINC
  154. #define DIO20_WPORT PORTC
  155. #define DIO20_DDR DDRC
  156. #define DIO20_PWM NULL
  157. #define DIO21_PIN PINC7
  158. #define DIO21_RPORT PINC
  159. #define DIO21_WPORT PORTC
  160. #define DIO21_DDR DDRC
  161. #define DIO21_PWM NULL
  162. #undef PB0
  163. #define PB0_PIN PINB0
  164. #define PB0_RPORT PINB
  165. #define PB0_WPORT PORTB
  166. #define PB0_DDR DDRB
  167. #define PB0_PWM NULL
  168. #undef PB1
  169. #define PB1_PIN PINB1
  170. #define PB1_RPORT PINB
  171. #define PB1_WPORT PORTB
  172. #define PB1_DDR DDRB
  173. #define PB1_PWM NULL
  174. #undef PB2
  175. #define PB2_PIN PINB2
  176. #define PB2_RPORT PINB
  177. #define PB2_WPORT PORTB
  178. #define PB2_DDR DDRB
  179. #define PB2_PWM NULL
  180. #undef PB3
  181. #define PB3_PIN PINB3
  182. #define PB3_RPORT PINB
  183. #define PB3_WPORT PORTB
  184. #define PB3_DDR DDRB
  185. #define PB3_PWM &OCR2A
  186. #undef PB4
  187. #define PB4_PIN PINB4
  188. #define PB4_RPORT PINB
  189. #define PB4_WPORT PORTB
  190. #define PB4_DDR DDRB
  191. #define PB4_PWM NULL
  192. #undef PB5
  193. #define PB5_PIN PINB5
  194. #define PB5_RPORT PINB
  195. #define PB5_WPORT PORTB
  196. #define PB5_DDR DDRB
  197. #define PB5_PWM NULL
  198. #undef PB6
  199. #define PB6_PIN PINB6
  200. #define PB6_RPORT PINB
  201. #define PB6_WPORT PORTB
  202. #define PB6_DDR DDRB
  203. #define PB6_PWM NULL
  204. #undef PB7
  205. #define PB7_PIN PINB7
  206. #define PB7_RPORT PINB
  207. #define PB7_WPORT PORTB
  208. #define PB7_DDR DDRB
  209. #define PB7_PWM NULL
  210. #undef PC0
  211. #define PC0_PIN PINC0
  212. #define PC0_RPORT PINC
  213. #define PC0_WPORT PORTC
  214. #define PC0_DDR DDRC
  215. #define PC0_PWM NULL
  216. #undef PC1
  217. #define PC1_PIN PINC1
  218. #define PC1_RPORT PINC
  219. #define PC1_WPORT PORTC
  220. #define PC1_DDR DDRC
  221. #define PC1_PWM NULL
  222. #undef PC2
  223. #define PC2_PIN PINC2
  224. #define PC2_RPORT PINC
  225. #define PC2_WPORT PORTC
  226. #define PC2_DDR DDRC
  227. #define PC2_PWM NULL
  228. #undef PC3
  229. #define PC3_PIN PINC3
  230. #define PC3_RPORT PINC
  231. #define PC3_WPORT PORTC
  232. #define PC3_DDR DDRC
  233. #define PC3_PWM NULL
  234. #undef PC4
  235. #define PC4_PIN PINC4
  236. #define PC4_RPORT PINC
  237. #define PC4_WPORT PORTC
  238. #define PC4_DDR DDRC
  239. #define PC4_PWM NULL
  240. #undef PC5
  241. #define PC5_PIN PINC5
  242. #define PC5_RPORT PINC
  243. #define PC5_WPORT PORTC
  244. #define PC5_DDR DDRC
  245. #define PC5_PWM NULL
  246. #undef PC6
  247. #define PC6_PIN PINC6
  248. #define PC6_RPORT PINC
  249. #define PC6_WPORT PORTC
  250. #define PC6_DDR DDRC
  251. #define PC6_PWM NULL
  252. #undef PC7
  253. #define PC7_PIN PINC7
  254. #define PC7_RPORT PINC
  255. #define PC7_WPORT PORTC
  256. #define PC7_DDR DDRC
  257. #define PC7_PWM NULL
  258. #undef PD0
  259. #define PD0_PIN PIND0
  260. #define PD0_RPORT PIND
  261. #define PD0_WPORT PORTD
  262. #define PD0_DDR DDRD
  263. #define PD0_PWM NULL
  264. #undef PD1
  265. #define PD1_PIN PIND1
  266. #define PD1_RPORT PIND
  267. #define PD1_WPORT PORTD
  268. #define PD1_DDR DDRD
  269. #define PD1_PWM NULL
  270. #undef PD2
  271. #define PD2_PIN PIND2
  272. #define PD2_RPORT PIND
  273. #define PD2_WPORT PORTD
  274. #define PD2_DDR DDRD
  275. #define PD2_PWM NULL
  276. #undef PD3
  277. #define PD3_PIN PIND3
  278. #define PD3_RPORT PIND
  279. #define PD3_WPORT PORTD
  280. #define PD3_DDR DDRD
  281. #define PD3_PWM &OCR2B
  282. #undef PD4
  283. #define PD4_PIN PIND4
  284. #define PD4_RPORT PIND
  285. #define PD4_WPORT PORTD
  286. #define PD4_DDR DDRD
  287. #define PD4_PWM NULL
  288. #undef PD5
  289. #define PD5_PIN PIND5
  290. #define PD5_RPORT PIND
  291. #define PD5_WPORT PORTD
  292. #define PD5_DDR DDRD
  293. #define PD5_PWM &OCR0B
  294. #undef PD6
  295. #define PD6_PIN PIND6
  296. #define PD6_RPORT PIND
  297. #define PD6_WPORT PORTD
  298. #define PD6_DDR DDRD
  299. #define PD6_PWM &OCR0A
  300. #undef PD7
  301. #define PD7_PIN PIND7
  302. #define PD7_RPORT PIND
  303. #define PD7_WPORT PORTD
  304. #define PD7_DDR DDRD
  305. #define PD7_PWM NULL
  306. #endif // _FASTIO_168