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.

fastio_168.h 7.7KB

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