Subversion Repositories MK-Marlin

Rev

Details | Last modification | View Log | RSS feed

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