prog_fuse.sh: reindent file
[aversive.git] / include / aversive / parts / ATmega644P.h
1 /*  
2  *  Copyright Droids Corporation, Microb Technology, Eirbot (2009)
3  * 
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  *  Revision : $Id $
19  *
20  */
21
22 /* WARNING : this file is automatically generated by scripts.
23  * You should not edit it. If you find something wrong in it,
24  * write to zer0@droids-corp.org */
25
26
27 /* prescalers timer 0 */
28 #define TIMER0_PRESCALER_DIV_0          0
29 #define TIMER0_PRESCALER_DIV_1          1
30 #define TIMER0_PRESCALER_DIV_8          2
31 #define TIMER0_PRESCALER_DIV_64         3
32 #define TIMER0_PRESCALER_DIV_256        4
33 #define TIMER0_PRESCALER_DIV_1024       5
34 #define TIMER0_PRESCALER_DIV_FALL       6
35 #define TIMER0_PRESCALER_DIV_RISE       7
36
37 #define TIMER0_PRESCALER_REG_0          0
38 #define TIMER0_PRESCALER_REG_1          1
39 #define TIMER0_PRESCALER_REG_2          8
40 #define TIMER0_PRESCALER_REG_3          64
41 #define TIMER0_PRESCALER_REG_4          256
42 #define TIMER0_PRESCALER_REG_5          1024
43 #define TIMER0_PRESCALER_REG_6          -1
44 #define TIMER0_PRESCALER_REG_7          -2
45
46 /* prescalers timer 1 */
47 #define TIMER1_PRESCALER_DIV_0          0
48 #define TIMER1_PRESCALER_DIV_1          1
49 #define TIMER1_PRESCALER_DIV_8          2
50 #define TIMER1_PRESCALER_DIV_64         3
51 #define TIMER1_PRESCALER_DIV_256        4
52 #define TIMER1_PRESCALER_DIV_1024       5
53 #define TIMER1_PRESCALER_DIV_FALL       6
54 #define TIMER1_PRESCALER_DIV_RISE       7
55
56 #define TIMER1_PRESCALER_REG_0          0
57 #define TIMER1_PRESCALER_REG_1          1
58 #define TIMER1_PRESCALER_REG_2          8
59 #define TIMER1_PRESCALER_REG_3          64
60 #define TIMER1_PRESCALER_REG_4          256
61 #define TIMER1_PRESCALER_REG_5          1024
62 #define TIMER1_PRESCALER_REG_6          -1
63 #define TIMER1_PRESCALER_REG_7          -2
64
65 /* prescalers timer 2 */
66 #define TIMER2_PRESCALER_DIV_0          0
67 #define TIMER2_PRESCALER_DIV_1          1
68 #define TIMER2_PRESCALER_DIV_8          2
69 #define TIMER2_PRESCALER_DIV_32         3
70 #define TIMER2_PRESCALER_DIV_64         4
71 #define TIMER2_PRESCALER_DIV_128        5
72 #define TIMER2_PRESCALER_DIV_256        6
73 #define TIMER2_PRESCALER_DIV_1024       7
74
75 #define TIMER2_PRESCALER_REG_0          0
76 #define TIMER2_PRESCALER_REG_1          1
77 #define TIMER2_PRESCALER_REG_2          8
78 #define TIMER2_PRESCALER_REG_3          32
79 #define TIMER2_PRESCALER_REG_4          64
80 #define TIMER2_PRESCALER_REG_5          128
81 #define TIMER2_PRESCALER_REG_6          256
82 #define TIMER2_PRESCALER_REG_7          1024
83
84
85 /* available timers */
86 #define TIMER0_AVAILABLE
87 #define TIMER0A_AVAILABLE
88 #define TIMER0B_AVAILABLE
89 #define TIMER1_AVAILABLE
90 #define TIMER1A_AVAILABLE
91 #define TIMER1B_AVAILABLE
92 #define TIMER2_AVAILABLE
93 #define TIMER2A_AVAILABLE
94 #define TIMER2B_AVAILABLE
95
96 /* overflow interrupt number */
97 #define SIG_OVERFLOW0_NUM 0
98 #define SIG_OVERFLOW1_NUM 1
99 #define SIG_OVERFLOW2_NUM 2
100 #define SIG_OVERFLOW_TOTAL_NUM 3
101
102 /* output compare interrupt number */
103 #define SIG_OUTPUT_COMPARE0A_NUM 0
104 #define SIG_OUTPUT_COMPARE0B_NUM 1
105 #define SIG_OUTPUT_COMPARE1A_NUM 2
106 #define SIG_OUTPUT_COMPARE1B_NUM 3
107 #define SIG_OUTPUT_COMPARE2A_NUM 4
108 #define SIG_OUTPUT_COMPARE2B_NUM 5
109 #define SIG_OUTPUT_COMPARE_TOTAL_NUM 6
110
111 /* Pwm nums */
112 #define PWM0A_NUM 0
113 #define PWM0B_NUM 1
114 #define PWM1A_NUM 2
115 #define PWM1B_NUM 3
116 #define PWM2A_NUM 4
117 #define PWM2B_NUM 5
118 #define PWM_TOTAL_NUM 6
119
120 /* input capture interrupt number */
121 #define SIG_INPUT_CAPTURE1_NUM 0
122 #define SIG_INPUT_CAPTURE_TOTAL_NUM 1
123
124
125 /* ADMUX */
126 #define MUX0_REG             ADMUX
127 #define MUX1_REG             ADMUX
128 #define MUX2_REG             ADMUX
129 #define MUX3_REG             ADMUX
130 #define MUX4_REG             ADMUX
131 #define ADLAR_REG            ADMUX
132 #define REFS0_REG            ADMUX
133 #define REFS1_REG            ADMUX
134
135 /* WDTCSR */
136 #define WDP0_REG             WDTCSR
137 #define WDP1_REG             WDTCSR
138 #define WDP2_REG             WDTCSR
139 #define WDE_REG              WDTCSR
140 #define WDCE_REG             WDTCSR
141 #define WDP3_REG             WDTCSR
142 #define WDIE_REG             WDTCSR
143 #define WDIF_REG             WDTCSR
144
145 /* EEDR */
146 #define EEDR0_REG            EEDR
147 #define EEDR1_REG            EEDR
148 #define EEDR2_REG            EEDR
149 #define EEDR3_REG            EEDR
150 #define EEDR4_REG            EEDR
151 #define EEDR5_REG            EEDR
152 #define EEDR6_REG            EEDR
153 #define EEDR7_REG            EEDR
154
155 /* ACSR */
156 #define ACIS0_REG            ACSR
157 #define ACIS1_REG            ACSR
158 #define ACIC_REG             ACSR
159 #define ACIE_REG             ACSR
160 #define ACI_REG              ACSR
161 #define ACO_REG              ACSR
162 #define ACBG_REG             ACSR
163 #define ACD_REG              ACSR
164
165 /* RAMPZ */
166 #define RAMPZ0_REG           RAMPZ
167
168 /* OCR2B */
169 #define OCR2B_0_REG          OCR2B
170 #define OCR2B_1_REG          OCR2B
171 #define OCR2B_2_REG          OCR2B
172 #define OCR2B_3_REG          OCR2B
173 #define OCR2B_4_REG          OCR2B
174 #define OCR2B_5_REG          OCR2B
175 #define OCR2B_6_REG          OCR2B
176 #define OCR2B_7_REG          OCR2B
177
178 /* OCR2A */
179 #define OCR2A_0_REG          OCR2A
180 #define OCR2A_1_REG          OCR2A
181 #define OCR2A_2_REG          OCR2A
182 #define OCR2A_3_REG          OCR2A
183 #define OCR2A_4_REG          OCR2A
184 #define OCR2A_5_REG          OCR2A
185 #define OCR2A_6_REG          OCR2A
186 #define OCR2A_7_REG          OCR2A
187
188 /* SPDR */
189 #define SPDR0_REG            SPDR
190 #define SPDR1_REG            SPDR
191 #define SPDR2_REG            SPDR
192 #define SPDR3_REG            SPDR
193 #define SPDR4_REG            SPDR
194 #define SPDR5_REG            SPDR
195 #define SPDR6_REG            SPDR
196 #define SPDR7_REG            SPDR
197
198 /* SPSR */
199 #define SPI2X_REG            SPSR
200 #define WCOL_REG             SPSR
201 #define SPIF_REG             SPSR
202
203 /* SPH */
204 #define SP8_REG              SPH
205 #define SP9_REG              SPH
206 #define SP10_REG             SPH
207 #define SP11_REG             SPH
208 #define SP12_REG             SPH
209
210 /* ICR1L */
211 #define ICR1L0_REG           ICR1L
212 #define ICR1L1_REG           ICR1L
213 #define ICR1L2_REG           ICR1L
214 #define ICR1L3_REG           ICR1L
215 #define ICR1L4_REG           ICR1L
216 #define ICR1L5_REG           ICR1L
217 #define ICR1L6_REG           ICR1L
218 #define ICR1L7_REG           ICR1L
219
220 /* TWSR */
221 #define TWPS0_REG            TWSR
222 #define TWPS1_REG            TWSR
223 #define TWS3_REG             TWSR
224 #define TWS4_REG             TWSR
225 #define TWS5_REG             TWSR
226 #define TWS6_REG             TWSR
227 #define TWS7_REG             TWSR
228
229 /* UCSR0A */
230 #define MPCM0_REG            UCSR0A
231 #define U2X0_REG             UCSR0A
232 #define UPE0_REG             UCSR0A
233 #define DOR0_REG             UCSR0A
234 #define FE0_REG              UCSR0A
235 #define UDRE0_REG            UCSR0A
236 #define TXC0_REG             UCSR0A
237 #define RXC0_REG             UCSR0A
238
239 /* UCSR0C */
240 #define UCPOL0_REG           UCSR0C
241 #define UCSZ00_REG           UCSR0C
242 #define UCSZ01_REG           UCSR0C
243 #define USBS0_REG            UCSR0C
244 #define UPM00_REG            UCSR0C
245 #define UPM01_REG            UCSR0C
246 #define UMSEL00_REG          UCSR0C
247 #define UMSEL01_REG          UCSR0C
248
249 /* UCSR0B */
250 #define TXB80_REG            UCSR0B
251 #define RXB80_REG            UCSR0B
252 #define UCSZ02_REG           UCSR0B
253 #define TXEN0_REG            UCSR0B
254 #define RXEN0_REG            UCSR0B
255 #define UDRIE0_REG           UCSR0B
256 #define TXCIE0_REG           UCSR0B
257 #define RXCIE0_REG           UCSR0B
258
259 /* TCNT1H */
260 #define TCNT1H0_REG          TCNT1H
261 #define TCNT1H1_REG          TCNT1H
262 #define TCNT1H2_REG          TCNT1H
263 #define TCNT1H3_REG          TCNT1H
264 #define TCNT1H4_REG          TCNT1H
265 #define TCNT1H5_REG          TCNT1H
266 #define TCNT1H6_REG          TCNT1H
267 #define TCNT1H7_REG          TCNT1H
268
269 /* PORTC */
270 #define PORTC0_REG           PORTC
271 #define PORTC1_REG           PORTC
272 #define PORTC2_REG           PORTC
273 #define PORTC3_REG           PORTC
274 #define PORTC4_REG           PORTC
275 #define PORTC5_REG           PORTC
276 #define PORTC6_REG           PORTC
277 #define PORTC7_REG           PORTC
278
279 /* PORTA */
280 #define PORTA0_REG           PORTA
281 #define PORTA1_REG           PORTA
282 #define PORTA2_REG           PORTA
283 #define PORTA3_REG           PORTA
284 #define PORTA4_REG           PORTA
285 #define PORTA5_REG           PORTA
286 #define PORTA6_REG           PORTA
287 #define PORTA7_REG           PORTA
288
289 /* UDR1 */
290 #define UDR1_0_REG           UDR1
291 #define UDR1_1_REG           UDR1
292 #define UDR1_2_REG           UDR1
293 #define UDR1_3_REG           UDR1
294 #define UDR1_4_REG           UDR1
295 #define UDR1_5_REG           UDR1
296 #define UDR1_6_REG           UDR1
297 #define UDR1_7_REG           UDR1
298
299 /* UDR0 */
300 #define UDR0_0_REG           UDR0
301 #define UDR0_1_REG           UDR0
302 #define UDR0_2_REG           UDR0
303 #define UDR0_3_REG           UDR0
304 #define UDR0_4_REG           UDR0
305 #define UDR0_5_REG           UDR0
306 #define UDR0_6_REG           UDR0
307 #define UDR0_7_REG           UDR0
308
309 /* EICRA */
310 #define ISC00_REG            EICRA
311 #define ISC01_REG            EICRA
312 #define ISC10_REG            EICRA
313 #define ISC11_REG            EICRA
314 #define ISC20_REG            EICRA
315 #define ISC21_REG            EICRA
316
317 /* DIDR0 */
318 #define ADC0D_REG            DIDR0
319 #define ADC1D_REG            DIDR0
320 #define ADC2D_REG            DIDR0
321 #define ADC3D_REG            DIDR0
322 #define ADC4D_REG            DIDR0
323 #define ADC5D_REG            DIDR0
324 #define ADC6D_REG            DIDR0
325 #define ADC7D_REG            DIDR0
326
327 /* DIDR1 */
328 #define AIN0D_REG            DIDR1
329 #define AIN1D_REG            DIDR1
330
331 /* ASSR */
332 #define TCR2BUB_REG          ASSR
333 #define TCR2AUB_REG          ASSR
334 #define OCR2BUB_REG          ASSR
335 #define OCR2AUB_REG          ASSR
336 #define TCN2UB_REG           ASSR
337 #define AS2_REG              ASSR
338 #define EXCLK_REG            ASSR
339
340 /* CLKPR */
341 #define CLKPS0_REG           CLKPR
342 #define CLKPS1_REG           CLKPR
343 #define CLKPS2_REG           CLKPR
344 #define CLKPS3_REG           CLKPR
345 #define CLKPCE_REG           CLKPR
346
347 /* SREG */
348 #define C_REG                SREG
349 #define Z_REG                SREG
350 #define N_REG                SREG
351 #define V_REG                SREG
352 #define S_REG                SREG
353 #define H_REG                SREG
354 #define T_REG                SREG
355 #define I_REG                SREG
356
357 /* UBRR1L */
358 #define UBRR_0_REG           UBRR1L
359 #define UBRR_1_REG           UBRR1L
360 #define UBRR_2_REG           UBRR1L
361 #define UBRR_3_REG           UBRR1L
362 #define UBRR_4_REG           UBRR1L
363 #define UBRR_5_REG           UBRR1L
364 #define UBRR_6_REG           UBRR1L
365 #define UBRR_7_REG           UBRR1L
366
367 /* DDRC */
368 #define DDC0_REG             DDRC
369 #define DDC1_REG             DDRC
370 #define DDC2_REG             DDRC
371 #define DDC3_REG             DDRC
372 #define DDC4_REG             DDRC
373 #define DDC5_REG             DDRC
374 #define DDC6_REG             DDRC
375 #define DDC7_REG             DDRC
376
377 /* DDRA */
378 #define DDA0_REG             DDRA
379 #define DDA1_REG             DDRA
380 #define DDA2_REG             DDRA
381 #define DDA3_REG             DDRA
382 #define DDA4_REG             DDRA
383 #define DDA5_REG             DDRA
384 #define DDA6_REG             DDRA
385 #define DDA7_REG             DDRA
386
387 /* UBRR1H */
388 #define UBRR_8_REG           UBRR1H
389 #define UBRR_9_REG           UBRR1H
390 #define UBRR_10_REG          UBRR1H
391 #define UBRR_11_REG          UBRR1H
392
393 /* TCCR1C */
394 #define FOC1B_REG            TCCR1C
395 #define FOC1A_REG            TCCR1C
396
397 /* TCCR1B */
398 #define CS10_REG             TCCR1B
399 #define CS11_REG             TCCR1B
400 #define CS12_REG             TCCR1B
401 #define WGM12_REG            TCCR1B
402 #define WGM13_REG            TCCR1B
403 #define ICES1_REG            TCCR1B
404 #define ICNC1_REG            TCCR1B
405
406 /* OSCCAL */
407 #define CAL0_REG             OSCCAL
408 #define CAL1_REG             OSCCAL
409 #define CAL2_REG             OSCCAL
410 #define CAL3_REG             OSCCAL
411 #define CAL4_REG             OSCCAL
412 #define CAL5_REG             OSCCAL
413 #define CAL6_REG             OSCCAL
414 #define CAL7_REG             OSCCAL
415
416 /* GPIOR1 */
417 #define GPIOR10_REG          GPIOR1
418 #define GPIOR11_REG          GPIOR1
419 #define GPIOR12_REG          GPIOR1
420 #define GPIOR13_REG          GPIOR1
421 #define GPIOR14_REG          GPIOR1
422 #define GPIOR15_REG          GPIOR1
423 #define GPIOR16_REG          GPIOR1
424 #define GPIOR17_REG          GPIOR1
425
426 /* GPIOR0 */
427 #define GPIOR00_REG          GPIOR0
428 #define GPIOR01_REG          GPIOR0
429 #define GPIOR02_REG          GPIOR0
430 #define GPIOR03_REG          GPIOR0
431 #define GPIOR04_REG          GPIOR0
432 #define GPIOR05_REG          GPIOR0
433 #define GPIOR06_REG          GPIOR0
434 #define GPIOR07_REG          GPIOR0
435
436 /* GPIOR2 */
437 #define GPIOR20_REG          GPIOR2
438 #define GPIOR21_REG          GPIOR2
439 #define GPIOR22_REG          GPIOR2
440 #define GPIOR23_REG          GPIOR2
441 #define GPIOR24_REG          GPIOR2
442 #define GPIOR25_REG          GPIOR2
443 #define GPIOR26_REG          GPIOR2
444 #define GPIOR27_REG          GPIOR2
445
446 /* PCICR */
447 #define PCIE0_REG            PCICR
448 #define PCIE1_REG            PCICR
449 #define PCIE2_REG            PCICR
450 #define PCIE3_REG            PCICR
451
452 /* TCNT2 */
453 #define TCNT2_0_REG          TCNT2
454 #define TCNT2_1_REG          TCNT2
455 #define TCNT2_2_REG          TCNT2
456 #define TCNT2_3_REG          TCNT2
457 #define TCNT2_4_REG          TCNT2
458 #define TCNT2_5_REG          TCNT2
459 #define TCNT2_6_REG          TCNT2
460 #define TCNT2_7_REG          TCNT2
461
462 /* TCNT0 */
463 #define TCNT0_0_REG          TCNT0
464 #define TCNT0_1_REG          TCNT0
465 #define TCNT0_2_REG          TCNT0
466 #define TCNT0_3_REG          TCNT0
467 #define TCNT0_4_REG          TCNT0
468 #define TCNT0_5_REG          TCNT0
469 #define TCNT0_6_REG          TCNT0
470 #define TCNT0_7_REG          TCNT0
471
472 /* TWAR */
473 #define TWGCE_REG            TWAR
474 #define TWA0_REG             TWAR
475 #define TWA1_REG             TWAR
476 #define TWA2_REG             TWAR
477 #define TWA3_REG             TWAR
478 #define TWA4_REG             TWAR
479 #define TWA5_REG             TWAR
480 #define TWA6_REG             TWAR
481
482 /* TCCR0B */
483 #define CS00_REG             TCCR0B
484 #define CS01_REG             TCCR0B
485 #define CS02_REG             TCCR0B
486 #define WGM02_REG            TCCR0B
487 #define FOC0B_REG            TCCR0B
488 #define FOC0A_REG            TCCR0B
489
490 /* TCCR0A */
491 #define WGM00_REG            TCCR0A
492 #define WGM01_REG            TCCR0A
493 #define COM0B0_REG           TCCR0A
494 #define COM0B1_REG           TCCR0A
495 #define COM0A0_REG           TCCR0A
496 #define COM0A1_REG           TCCR0A
497
498 /* TIFR2 */
499 #define TOV2_REG             TIFR2
500 #define OCF2A_REG            TIFR2
501 #define OCF2B_REG            TIFR2
502
503 /* SPCR */
504 #define SPR0_REG             SPCR
505 #define SPR1_REG             SPCR
506 #define CPHA_REG             SPCR
507 #define CPOL_REG             SPCR
508 #define MSTR_REG             SPCR
509 #define DORD_REG             SPCR
510 #define SPE_REG              SPCR
511 #define SPIE_REG             SPCR
512
513 /* TIFR1 */
514 #define TOV1_REG             TIFR1
515 #define OCF1A_REG            TIFR1
516 #define OCF1B_REG            TIFR1
517 #define ICF1_REG             TIFR1
518
519 /* GTCCR */
520 #define PSRSYNC_REG          GTCCR
521 #define TSM_REG              GTCCR
522 #define PSRASY_REG           GTCCR
523
524 /* TWBR */
525 #define TWBR0_REG            TWBR
526 #define TWBR1_REG            TWBR
527 #define TWBR2_REG            TWBR
528 #define TWBR3_REG            TWBR
529 #define TWBR4_REG            TWBR
530 #define TWBR5_REG            TWBR
531 #define TWBR6_REG            TWBR
532 #define TWBR7_REG            TWBR
533
534 /* ICR1H */
535 #define ICR1H0_REG           ICR1H
536 #define ICR1H1_REG           ICR1H
537 #define ICR1H2_REG           ICR1H
538 #define ICR1H3_REG           ICR1H
539 #define ICR1H4_REG           ICR1H
540 #define ICR1H5_REG           ICR1H
541 #define ICR1H6_REG           ICR1H
542 #define ICR1H7_REG           ICR1H
543
544 /* OCR1BL */
545 /* #define OCR1AL0_REG          OCR1BL */ /* dup in OCR1AL */
546 /* #define OCR1AL1_REG          OCR1BL */ /* dup in OCR1AL */
547 /* #define OCR1AL2_REG          OCR1BL */ /* dup in OCR1AL */
548 /* #define OCR1AL3_REG          OCR1BL */ /* dup in OCR1AL */
549 /* #define OCR1AL4_REG          OCR1BL */ /* dup in OCR1AL */
550 /* #define OCR1AL5_REG          OCR1BL */ /* dup in OCR1AL */
551 /* #define OCR1AL6_REG          OCR1BL */ /* dup in OCR1AL */
552 /* #define OCR1AL7_REG          OCR1BL */ /* dup in OCR1AL */
553
554 /* PCIFR */
555 #define PCIF0_REG            PCIFR
556 #define PCIF1_REG            PCIFR
557 #define PCIF2_REG            PCIFR
558 #define PCIF3_REG            PCIFR
559
560 /* SPL */
561 #define SP0_REG              SPL
562 #define SP1_REG              SPL
563 #define SP2_REG              SPL
564 #define SP3_REG              SPL
565 #define SP4_REG              SPL
566 #define SP5_REG              SPL
567 #define SP6_REG              SPL
568 #define SP7_REG              SPL
569
570 /* OCR1BH */
571 /* #define OCR1AH0_REG          OCR1BH */ /* dup in OCR1AH */
572 /* #define OCR1AH1_REG          OCR1BH */ /* dup in OCR1AH */
573 /* #define OCR1AH2_REG          OCR1BH */ /* dup in OCR1AH */
574 /* #define OCR1AH3_REG          OCR1BH */ /* dup in OCR1AH */
575 /* #define OCR1AH4_REG          OCR1BH */ /* dup in OCR1AH */
576 /* #define OCR1AH5_REG          OCR1BH */ /* dup in OCR1AH */
577 /* #define OCR1AH6_REG          OCR1BH */ /* dup in OCR1AH */
578 /* #define OCR1AH7_REG          OCR1BH */ /* dup in OCR1AH */
579
580 /* EECR */
581 #define EERE_REG             EECR
582 #define EEPE_REG             EECR
583 #define EEMPE_REG            EECR
584 #define EERIE_REG            EECR
585 #define EEPM0_REG            EECR
586 #define EEPM1_REG            EECR
587
588 /* SMCR */
589 #define SE_REG               SMCR
590 #define SM0_REG              SMCR
591 #define SM1_REG              SMCR
592 #define SM2_REG              SMCR
593
594 /* TWCR */
595 #define TWIE_REG             TWCR
596 #define TWEN_REG             TWCR
597 #define TWWC_REG             TWCR
598 #define TWSTO_REG            TWCR
599 #define TWSTA_REG            TWCR
600 #define TWEA_REG             TWCR
601 #define TWINT_REG            TWCR
602
603 /* TCCR2A */
604 #define WGM20_REG            TCCR2A
605 #define WGM21_REG            TCCR2A
606 #define COM2B0_REG           TCCR2A
607 #define COM2B1_REG           TCCR2A
608 #define COM2A0_REG           TCCR2A
609 #define COM2A1_REG           TCCR2A
610
611 /* TCCR2B */
612 #define CS20_REG             TCCR2B
613 #define CS21_REG             TCCR2B
614 #define CS22_REG             TCCR2B
615 #define WGM22_REG            TCCR2B
616 #define FOC2B_REG            TCCR2B
617 #define FOC2A_REG            TCCR2B
618
619 /* UBRR0H */
620 #define UBRR8_REG            UBRR0H
621 #define UBRR9_REG            UBRR0H
622 #define UBRR10_REG           UBRR0H
623 #define UBRR11_REG           UBRR0H
624
625 /* UBRR0L */
626 #define UBRR0_REG            UBRR0L
627 #define UBRR1_REG            UBRR0L
628 #define UBRR2_REG            UBRR0L
629 #define UBRR3_REG            UBRR0L
630 #define UBRR4_REG            UBRR0L
631 #define UBRR5_REG            UBRR0L
632 #define UBRR6_REG            UBRR0L
633 #define UBRR7_REG            UBRR0L
634
635 /* EEARH */
636 #define EEAR8_REG            EEARH
637 #define EEAR9_REG            EEARH
638 #define EEAR10_REG           EEARH
639 #define EEAR11_REG           EEARH
640
641 /* EEARL */
642 #define EEAR0_REG            EEARL
643 #define EEAR1_REG            EEARL
644 #define EEAR2_REG            EEARL
645 #define EEAR3_REG            EEARL
646 #define EEAR4_REG            EEARL
647 #define EEAR5_REG            EEARL
648 #define EEAR6_REG            EEARL
649 #define EEAR7_REG            EEARL
650
651 /* MCUCR */
652 #define JTD_REG              MCUCR
653 #define IVCE_REG             MCUCR
654 #define IVSEL_REG            MCUCR
655 #define PUD_REG              MCUCR
656 #define BODSE_REG            MCUCR
657 #define BODS_REG             MCUCR
658
659 /* MCUSR */
660 #define JTRF_REG             MCUSR
661 #define PORF_REG             MCUSR
662 #define EXTRF_REG            MCUSR
663 #define BORF_REG             MCUSR
664 #define WDRF_REG             MCUSR
665
666 /* OCDR */
667 #define OCDR0_REG            OCDR
668 #define OCDR1_REG            OCDR
669 #define OCDR2_REG            OCDR
670 #define OCDR3_REG            OCDR
671 #define OCDR4_REG            OCDR
672 #define OCDR5_REG            OCDR
673 #define OCDR6_REG            OCDR
674 #define OCDR7_REG            OCDR
675
676 /* PINA */
677 #define PINA0_REG            PINA
678 #define PINA1_REG            PINA
679 #define PINA2_REG            PINA
680 #define PINA3_REG            PINA
681 #define PINA4_REG            PINA
682 #define PINA5_REG            PINA
683 #define PINA6_REG            PINA
684 #define PINA7_REG            PINA
685
686 /* UCSR1B */
687 #define TXB81_REG            UCSR1B
688 #define RXB81_REG            UCSR1B
689 #define UCSZ12_REG           UCSR1B
690 #define TXEN1_REG            UCSR1B
691 #define RXEN1_REG            UCSR1B
692 #define UDRIE1_REG           UCSR1B
693 #define TXCIE1_REG           UCSR1B
694 #define RXCIE1_REG           UCSR1B
695
696 /* UCSR1C */
697 #define UCPOL1_REG           UCSR1C
698 #define UCSZ10_REG           UCSR1C
699 #define UCSZ11_REG           UCSR1C
700 #define USBS1_REG            UCSR1C
701 #define UPM10_REG            UCSR1C
702 #define UPM11_REG            UCSR1C
703 #define UMSEL10_REG          UCSR1C
704 #define UMSEL11_REG          UCSR1C
705
706 /* UCSR1A */
707 #define MPCM1_REG            UCSR1A
708 #define U2X1_REG             UCSR1A
709 #define UPE1_REG             UCSR1A
710 #define DOR1_REG             UCSR1A
711 #define FE1_REG              UCSR1A
712 #define UDRE1_REG            UCSR1A
713 #define TXC1_REG             UCSR1A
714 #define RXC1_REG             UCSR1A
715
716 /* DDRB */
717 #define DDB0_REG             DDRB
718 #define DDB1_REG             DDRB
719 #define DDB2_REG             DDRB
720 #define DDB3_REG             DDRB
721 #define DDB4_REG             DDRB
722 #define DDB5_REG             DDRB
723 #define DDB6_REG             DDRB
724 #define DDB7_REG             DDRB
725
726 /* TWDR */
727 #define TWD0_REG             TWDR
728 #define TWD1_REG             TWDR
729 #define TWD2_REG             TWDR
730 #define TWD3_REG             TWDR
731 #define TWD4_REG             TWDR
732 #define TWD5_REG             TWDR
733 #define TWD6_REG             TWDR
734 #define TWD7_REG             TWDR
735
736 /* TWAMR */
737 #define TWAM0_REG            TWAMR
738 #define TWAM1_REG            TWAMR
739 #define TWAM2_REG            TWAMR
740 #define TWAM3_REG            TWAMR
741 #define TWAM4_REG            TWAMR
742 #define TWAM5_REG            TWAMR
743 #define TWAM6_REG            TWAMR
744
745 /* ADCSRA */
746 #define ADPS0_REG            ADCSRA
747 #define ADPS1_REG            ADCSRA
748 #define ADPS2_REG            ADCSRA
749 #define ADIE_REG             ADCSRA
750 #define ADIF_REG             ADCSRA
751 #define ADATE_REG            ADCSRA
752 #define ADSC_REG             ADCSRA
753 #define ADEN_REG             ADCSRA
754
755 /* ADCSRB */
756 #define ACME_REG             ADCSRB
757 #define ADTS0_REG            ADCSRB
758 #define ADTS1_REG            ADCSRB
759 #define ADTS2_REG            ADCSRB
760
761 /* PRR0 */
762 #define PRADC_REG            PRR0
763 #define PRUSART0_REG         PRR0
764 #define PRSPI_REG            PRR0
765 #define PRTIM1_REG           PRR0
766 #define PRUSART1_REG         PRR0
767 #define PRTIM0_REG           PRR0
768 #define PRTIM2_REG           PRR0
769 #define PRTWI_REG            PRR0
770
771 /* TCCR1A */
772 #define WGM10_REG            TCCR1A
773 #define WGM11_REG            TCCR1A
774 #define COM1B0_REG           TCCR1A
775 #define COM1B1_REG           TCCR1A
776 #define COM1A0_REG           TCCR1A
777 #define COM1A1_REG           TCCR1A
778
779 /* OCR0A */
780 #define OCROA_0_REG          OCR0A
781 #define OCROA_1_REG          OCR0A
782 #define OCROA_2_REG          OCR0A
783 #define OCROA_3_REG          OCR0A
784 #define OCROA_4_REG          OCR0A
785 #define OCROA_5_REG          OCR0A
786 #define OCROA_6_REG          OCR0A
787 #define OCROA_7_REG          OCR0A
788
789 /* OCR0B */
790 #define OCR0B_0_REG          OCR0B
791 #define OCR0B_1_REG          OCR0B
792 #define OCR0B_2_REG          OCR0B
793 #define OCR0B_3_REG          OCR0B
794 #define OCR0B_4_REG          OCR0B
795 #define OCR0B_5_REG          OCR0B
796 #define OCR0B_6_REG          OCR0B
797 #define OCR0B_7_REG          OCR0B
798
799 /* TCNT1L */
800 #define TCNT1L0_REG          TCNT1L
801 #define TCNT1L1_REG          TCNT1L
802 #define TCNT1L2_REG          TCNT1L
803 #define TCNT1L3_REG          TCNT1L
804 #define TCNT1L4_REG          TCNT1L
805 #define TCNT1L5_REG          TCNT1L
806 #define TCNT1L6_REG          TCNT1L
807 #define TCNT1L7_REG          TCNT1L
808
809 /* DDRD */
810 #define DDD0_REG             DDRD
811 #define DDD1_REG             DDRD
812 #define DDD2_REG             DDRD
813 #define DDD3_REG             DDRD
814 #define DDD4_REG             DDRD
815 #define DDD5_REG             DDRD
816 #define DDD6_REG             DDRD
817 #define DDD7_REG             DDRD
818
819 /* PORTD */
820 #define PORTD0_REG           PORTD
821 #define PORTD1_REG           PORTD
822 #define PORTD2_REG           PORTD
823 #define PORTD3_REG           PORTD
824 #define PORTD4_REG           PORTD
825 #define PORTD5_REG           PORTD
826 #define PORTD6_REG           PORTD
827 #define PORTD7_REG           PORTD
828
829 /* SPMCSR */
830 #define SPMEN_REG            SPMCSR
831 #define PGERS_REG            SPMCSR
832 #define PGWRT_REG            SPMCSR
833 #define BLBSET_REG           SPMCSR
834 #define RWWSRE_REG           SPMCSR
835 #define SIGRD_REG            SPMCSR
836 #define RWWSB_REG            SPMCSR
837 #define SPMIE_REG            SPMCSR
838
839 /* PORTB */
840 #define PORTB0_REG           PORTB
841 #define PORTB1_REG           PORTB
842 #define PORTB2_REG           PORTB
843 #define PORTB3_REG           PORTB
844 #define PORTB4_REG           PORTB
845 #define PORTB5_REG           PORTB
846 #define PORTB6_REG           PORTB
847 #define PORTB7_REG           PORTB
848
849 /* ADCL */
850 #define ADCL0_REG            ADCL
851 #define ADCL1_REG            ADCL
852 #define ADCL2_REG            ADCL
853 #define ADCL3_REG            ADCL
854 #define ADCL4_REG            ADCL
855 #define ADCL5_REG            ADCL
856 #define ADCL6_REG            ADCL
857 #define ADCL7_REG            ADCL
858
859 /* ADCH */
860 #define ADCH0_REG            ADCH
861 #define ADCH1_REG            ADCH
862 #define ADCH2_REG            ADCH
863 #define ADCH3_REG            ADCH
864 #define ADCH4_REG            ADCH
865 #define ADCH5_REG            ADCH
866 #define ADCH6_REG            ADCH
867 #define ADCH7_REG            ADCH
868
869 /* TIMSK2 */
870 #define TOIE2_REG            TIMSK2
871 #define OCIE2A_REG           TIMSK2
872 #define OCIE2B_REG           TIMSK2
873
874 /* EIMSK */
875 #define INT0_REG             EIMSK
876 #define INT1_REG             EIMSK
877 #define INT2_REG             EIMSK
878
879 /* TIMSK0 */
880 #define TOIE0_REG            TIMSK0
881 #define OCIE0A_REG           TIMSK0
882 #define OCIE0B_REG           TIMSK0
883
884 /* TIMSK1 */
885 #define TOIE1_REG            TIMSK1
886 #define OCIE1A_REG           TIMSK1
887 #define OCIE1B_REG           TIMSK1
888 #define ICIE1_REG            TIMSK1
889
890 /* PCMSK0 */
891 #define PCINT0_REG           PCMSK0
892 #define PCINT1_REG           PCMSK0
893 #define PCINT2_REG           PCMSK0
894 #define PCINT3_REG           PCMSK0
895 #define PCINT4_REG           PCMSK0
896 #define PCINT5_REG           PCMSK0
897 #define PCINT6_REG           PCMSK0
898 #define PCINT7_REG           PCMSK0
899
900 /* PCMSK1 */
901 #define PCINT8_REG           PCMSK1
902 #define PCINT9_REG           PCMSK1
903 #define PCINT10_REG          PCMSK1
904 #define PCINT11_REG          PCMSK1
905 #define PCINT12_REG          PCMSK1
906 #define PCINT13_REG          PCMSK1
907 #define PCINT14_REG          PCMSK1
908 #define PCINT15_REG          PCMSK1
909
910 /* PCMSK2 */
911 #define PCINT16_REG          PCMSK2
912 #define PCINT17_REG          PCMSK2
913 #define PCINT18_REG          PCMSK2
914 #define PCINT19_REG          PCMSK2
915 #define PCINT20_REG          PCMSK2
916 #define PCINT21_REG          PCMSK2
917 #define PCINT22_REG          PCMSK2
918 #define PCINT23_REG          PCMSK2
919
920 /* PCMSK3 */
921 #define PCINT24_REG          PCMSK3
922 #define PCINT25_REG          PCMSK3
923 #define PCINT26_REG          PCMSK3
924 #define PCINT27_REG          PCMSK3
925 #define PCINT28_REG          PCMSK3
926 #define PCINT29_REG          PCMSK3
927 #define PCINT30_REG          PCMSK3
928 #define PCINT31_REG          PCMSK3
929
930 /* PINC */
931 #define PINC0_REG            PINC
932 #define PINC1_REG            PINC
933 #define PINC2_REG            PINC
934 #define PINC3_REG            PINC
935 #define PINC4_REG            PINC
936 #define PINC5_REG            PINC
937 #define PINC6_REG            PINC
938 #define PINC7_REG            PINC
939
940 /* PINB */
941 #define PINB0_REG            PINB
942 #define PINB1_REG            PINB
943 #define PINB2_REG            PINB
944 #define PINB3_REG            PINB
945 #define PINB4_REG            PINB
946 #define PINB5_REG            PINB
947 #define PINB6_REG            PINB
948 #define PINB7_REG            PINB
949
950 /* EIFR */
951 #define INTF0_REG            EIFR
952 #define INTF1_REG            EIFR
953 #define INTF2_REG            EIFR
954
955 /* PIND */
956 #define PIND0_REG            PIND
957 #define PIND1_REG            PIND
958 #define PIND2_REG            PIND
959 #define PIND3_REG            PIND
960 #define PIND4_REG            PIND
961 #define PIND5_REG            PIND
962 #define PIND6_REG            PIND
963 #define PIND7_REG            PIND
964
965 /* OCR1AH */
966 /* #define OCR1AH0_REG          OCR1AH */ /* dup in OCR1BH */
967 /* #define OCR1AH1_REG          OCR1AH */ /* dup in OCR1BH */
968 /* #define OCR1AH2_REG          OCR1AH */ /* dup in OCR1BH */
969 /* #define OCR1AH3_REG          OCR1AH */ /* dup in OCR1BH */
970 /* #define OCR1AH4_REG          OCR1AH */ /* dup in OCR1BH */
971 /* #define OCR1AH5_REG          OCR1AH */ /* dup in OCR1BH */
972 /* #define OCR1AH6_REG          OCR1AH */ /* dup in OCR1BH */
973 /* #define OCR1AH7_REG          OCR1AH */ /* dup in OCR1BH */
974
975 /* OCR1AL */
976 /* #define OCR1AL0_REG          OCR1AL */ /* dup in OCR1BL */
977 /* #define OCR1AL1_REG          OCR1AL */ /* dup in OCR1BL */
978 /* #define OCR1AL2_REG          OCR1AL */ /* dup in OCR1BL */
979 /* #define OCR1AL3_REG          OCR1AL */ /* dup in OCR1BL */
980 /* #define OCR1AL4_REG          OCR1AL */ /* dup in OCR1BL */
981 /* #define OCR1AL5_REG          OCR1AL */ /* dup in OCR1BL */
982 /* #define OCR1AL6_REG          OCR1AL */ /* dup in OCR1BL */
983 /* #define OCR1AL7_REG          OCR1AL */ /* dup in OCR1BL */
984
985 /* TIFR0 */
986 #define TOV0_REG             TIFR0
987 #define OCF0A_REG            TIFR0
988 #define OCF0B_REG            TIFR0
989
990 /* pins mapping */
991 #define ADC0_PORT PORTA
992 #define ADC0_BIT 0
993 #define PCINT0_PORT PORTA
994 #define PCINT0_BIT 0
995
996 #define ADC1_PORT PORTA
997 #define ADC1_BIT 1
998 #define PCINT1_PORT PORTA
999 #define PCINT1_BIT 1
1000
1001 #define ADC2_PORT PORTA
1002 #define ADC2_BIT 2
1003 #define PCINT2_PORT PORTA
1004 #define PCINT2_BIT 2
1005
1006 #define ADC3_PORT PORTA
1007 #define ADC3_BIT 3
1008 #define PCINT3_PORT PORTA
1009 #define PCINT3_BIT 3
1010
1011 #define ADC4_PORT PORTA
1012 #define ADC4_BIT 4
1013 #define PCINT4_PORT PORTA
1014 #define PCINT4_BIT 4
1015
1016 #define ADC5_PORT PORTA
1017 #define ADC5_BIT 5
1018 #define PCINT5_PORT PORTA
1019 #define PCINT5_BIT 5
1020
1021 #define ADC6_PORT PORTA
1022 #define ADC6_BIT 6
1023 #define PCINT6_PORT PORTA
1024 #define PCINT6_BIT 6
1025
1026 #define ADC7_PORT PORTA
1027 #define ADC7_BIT 7
1028 #define PCINT7_PORT PORTA
1029 #define PCINT7_BIT 7
1030
1031 #define XCK_PORT PORTB
1032 #define XCK_BIT 0
1033 #define T0_PORT PORTB
1034 #define T0_BIT 0
1035 #define PCINT9_PORT PORTB
1036 #define PCINT9_BIT 0
1037
1038 #define T1_PORT PORTB
1039 #define T1_BIT 1
1040 #define CLKO_PORT PORTB
1041 #define CLKO_BIT 1
1042 #define PCINT9_PORT PORTB
1043 #define PCINT9_BIT 1
1044
1045 #define AIN0_PORT PORTB
1046 #define AIN0_BIT 2
1047 #define INT2_PORT PORTB
1048 #define INT2_BIT 2
1049 #define PCINT10_PORT PORTB
1050 #define PCINT10_BIT 2
1051
1052 #define AIN1_PORT PORTB
1053 #define AIN1_BIT 3
1054 #define OC0A_PORT PORTB
1055 #define OC0A_BIT 3
1056 #define PCINT11_PORT PORTB
1057 #define PCINT11_BIT 3
1058
1059 #define SS_PORT PORTB
1060 #define SS_BIT 4
1061 #define OC0B_PORT PORTB
1062 #define OC0B_BIT 4
1063 #define PCINT12_PORT PORTB
1064 #define PCINT12_BIT 4
1065
1066 #define MOSI_PORT PORTB
1067 #define MOSI_BIT 5
1068 #define PCINT13_PORT PORTB
1069 #define PCINT13_BIT 5
1070
1071 #define MISO_PORT PORTB
1072 #define MISO_BIT 6
1073 #define PCINT14_PORT PORTB
1074 #define PCINT14_BIT 6
1075
1076 #define SCK_PORT PORTB
1077 #define SCK_BIT 7
1078 #define PCINT15_PORT PORTB
1079 #define PCINT15_BIT 7
1080
1081 #define SCL_PORT PORTC
1082 #define SCL_BIT 0
1083 #define PCINT16_PORT PORTC
1084 #define PCINT16_BIT 0
1085
1086 #define SDA_PORT PORTC
1087 #define SDA_BIT 1
1088 #define PCINT17_PORT PORTC
1089 #define PCINT17_BIT 1
1090
1091 #define TCK_PORT PORTC
1092 #define TCK_BIT 2
1093 #define PCINT18_PORT PORTC
1094 #define PCINT18_BIT 2
1095
1096 #define TMS_PORT PORTC
1097 #define TMS_BIT 3
1098 #define PCINT19_PORT PORTC
1099 #define PCINT19_BIT 3
1100
1101 #define TDO_PORT PORTC
1102 #define TDO_BIT 4
1103 #define PCINT20_PORT PORTC
1104 #define PCINT20_BIT 4
1105
1106 #define TDI_PORT PORTC
1107 #define TDI_BIT 5
1108 #define PCINT21_PORT PORTC
1109 #define PCINT21_BIT 5
1110
1111 #define TOSC1_PORT PORTC
1112 #define TOSC1_BIT 6
1113 #define PCINT22_PORT PORTC
1114 #define PCINT22_BIT 6
1115
1116 #define TOSC2_PORT PORTC
1117 #define TOSC2_BIT 7
1118 #define PCINT23_PORT PORTC
1119 #define PCINT23_BIT 7
1120
1121 #define RXD_PORT PORTD
1122 #define RXD_BIT 0
1123 #define PCINT24_PORT PORTD
1124 #define PCINT24_BIT 0
1125
1126 #define TXD_PORT PORTD
1127 #define TXD_BIT 1
1128 #define PCINT25_PORT PORTD
1129 #define PCINT25_BIT 1
1130
1131 #define INT0_PORT PORTD
1132 #define INT0_BIT 2
1133 #define RDX1_PORT PORTD
1134 #define RDX1_BIT 2
1135 #define PCINT26_PORT PORTD
1136 #define PCINT26_BIT 2
1137
1138 #define INT1_PORT PORTD
1139 #define INT1_BIT 3
1140 #define TXD1_PORT PORTD
1141 #define TXD1_BIT 3
1142 #define PCINT27_PORT PORTD
1143 #define PCINT27_BIT 3
1144
1145 #define OC1B_PORT PORTD
1146 #define OC1B_BIT 4
1147 #define XCK1_PORT PORTD
1148 #define XCK1_BIT 4
1149 #define PCINT28_PORT PORTD
1150 #define PCINT28_BIT 4
1151
1152 #define OC1A_PORT PORTD
1153 #define OC1A_BIT 5
1154 #define PCINT29_PORT PORTD
1155 #define PCINT29_BIT 5
1156
1157 #define ICP_PORT PORTD
1158 #define ICP_BIT 6
1159 #define OC2B_PORT PORTD
1160 #define OC2B_BIT 6
1161 #define PCINT30_PORT PORTD
1162 #define PCINT30_BIT 6
1163
1164 #define OC2A_PORT PORTD
1165 #define OC2A_BIT 7
1166 #define PCINT31_PORT PORTD
1167 #define PCINT31_BIT 7
1168
1169