init
[protos/xbee-avr.git] / aversive / parts / AT90S8515.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
48
49
50 /* available timers */
51 #define TIMER0_AVAILABLE
52 #define TIMER1_AVAILABLE
53 #define TIMER1A_AVAILABLE
54 #define TIMER1B_AVAILABLE
55
56 /* overflow interrupt number */
57 #define SIG_OVERFLOW0_NUM 0
58 #define SIG_OVERFLOW1_NUM 1
59 #define SIG_OVERFLOW_TOTAL_NUM 2
60
61 /* output compare interrupt number */
62 #define SIG_OUTPUT_COMPARE1A_NUM 0
63 #define SIG_OUTPUT_COMPARE1B_NUM 1
64 #define SIG_OUTPUT_COMPARE_TOTAL_NUM 2
65
66 /* Pwm nums */
67 #define PWM1A_NUM 0
68 #define PWM1B_NUM 1
69 #define PWM_TOTAL_NUM 2
70
71 /* input capture interrupt number */
72 #define SIG_INPUT_CAPTURE1_NUM 0
73 #define SIG_INPUT_CAPTURE_TOTAL_NUM 1
74
75
76 /* WDTCR */
77 #define WDP0_REG             WDTCR
78 #define WDP1_REG             WDTCR
79 #define WDP2_REG             WDTCR
80 #define WDE_REG              WDTCR
81 #define WDTOE_REG            WDTCR
82
83 /* GIMSK */
84 #define INT0_REG             GIMSK
85 #define INT1_REG             GIMSK
86
87 /* ICR1H */
88 #define ICR1H0_REG           ICR1H
89 #define ICR1H1_REG           ICR1H
90 #define ICR1H2_REG           ICR1H
91 #define ICR1H3_REG           ICR1H
92 #define ICR1H4_REG           ICR1H
93 #define ICR1H5_REG           ICR1H
94 #define ICR1H6_REG           ICR1H
95 #define ICR1H7_REG           ICR1H
96
97 /* TCCR0 */
98 #define CS00_REG             TCCR0
99 #define CS01_REG             TCCR0
100 #define CS02_REG             TCCR0
101
102 /* SREG */
103 #define C_REG                SREG
104 #define Z_REG                SREG
105 #define N_REG                SREG
106 #define V_REG                SREG
107 #define S_REG                SREG
108 #define H_REG                SREG
109 #define T_REG                SREG
110 #define I_REG                SREG
111
112 /* DDRB */
113 #define DDB0_REG             DDRB
114 #define DDB1_REG             DDRB
115 #define DDB2_REG             DDRB
116 #define DDB3_REG             DDRB
117 #define DDB4_REG             DDRB
118 #define DDB5_REG             DDRB
119 #define DDB6_REG             DDRB
120 #define DDB7_REG             DDRB
121
122 /* USR */
123 #define OR_REG               USR
124 #define FE_REG               USR
125 #define UDRE_REG             USR
126 #define TXC_REG              USR
127 #define RXC_REG              USR
128
129 /* EEDR */
130 #define EEDR0_REG            EEDR
131 #define EEDR1_REG            EEDR
132 #define EEDR2_REG            EEDR
133 #define EEDR3_REG            EEDR
134 #define EEDR4_REG            EEDR
135 #define EEDR5_REG            EEDR
136 #define EEDR6_REG            EEDR
137 #define EEDR7_REG            EEDR
138
139 /* DDRC */
140 #define DDC0_REG             DDRC
141 #define DDC1_REG             DDRC
142 #define DDC2_REG             DDRC
143 #define DDC3_REG             DDRC
144 #define DDC4_REG             DDRC
145 #define DDC5_REG             DDRC
146 #define DDC6_REG             DDRC
147 #define DDC7_REG             DDRC
148
149 /* DDRA */
150 #define DDA0_REG             DDRA
151 #define DDA1_REG             DDRA
152 #define DDA2_REG             DDRA
153 #define DDA3_REG             DDRA
154 #define DDA4_REG             DDRA
155 #define DDA5_REG             DDRA
156 #define DDA6_REG             DDRA
157 #define DDA7_REG             DDRA
158
159 /* TCCR1A */
160 #define PWM10_REG            TCCR1A
161 #define PWM11_REG            TCCR1A
162 #define COM1B0_REG           TCCR1A
163 #define COM1B1_REG           TCCR1A
164 #define COM1A0_REG           TCCR1A
165 #define COM1A1_REG           TCCR1A
166
167 /* DDRD */
168 #define DDD0_REG             DDRD
169 #define DDD1_REG             DDRD
170 #define DDD2_REG             DDRD
171 #define DDD3_REG             DDRD
172 #define DDD4_REG             DDRD
173 #define DDD5_REG             DDRD
174 #define DDD6_REG             DDRD
175 #define DDD7_REG             DDRD
176
177 /* TCCR1B */
178 #define CS10_REG             TCCR1B
179 #define CS11_REG             TCCR1B
180 #define CS12_REG             TCCR1B
181 #define CTC1_REG             TCCR1B
182 #define ICES1_REG            TCCR1B
183 #define ICNC1_REG            TCCR1B
184
185 /* GIFR */
186 #define INTF0_REG            GIFR
187 #define INTF1_REG            GIFR
188
189 /* TIMSK */
190 #define TICIE1_REG           TIMSK
191 #define OCIE1B_REG           TIMSK
192 #define OCIE1A_REG           TIMSK
193 #define TOIE1_REG            TIMSK
194 #define TOIE0_REG            TIMSK
195
196 /* UCR */
197 #define TXB8_REG             UCR
198 #define RXB8_REG             UCR
199 #define CHR9_REG             UCR
200 #define TXEN_REG             UCR
201 #define RXEN_REG             UCR
202 #define UDRIE_REG            UCR
203 #define TXCIE_REG            UCR
204 #define RXCIE_REG            UCR
205
206 /* SPDR */
207 #define SPDR0_REG            SPDR
208 #define SPDR1_REG            SPDR
209 #define SPDR2_REG            SPDR
210 #define SPDR3_REG            SPDR
211 #define SPDR4_REG            SPDR
212 #define SPDR5_REG            SPDR
213 #define SPDR6_REG            SPDR
214 #define SPDR7_REG            SPDR
215
216 /* SPSR */
217 #define WCOL_REG             SPSR
218 #define SPIF_REG             SPSR
219
220 /* ACSR */
221 #define ACIS0_REG            ACSR
222 #define ACIS1_REG            ACSR
223 #define ACIC_REG             ACSR
224 #define ACIE_REG             ACSR
225 #define ACI_REG              ACSR
226 #define ACO_REG              ACSR
227 #define ACD_REG              ACSR
228
229 /* SPH */
230 #define SP8_REG              SPH
231 #define SP9_REG              SPH
232 #define SP10_REG             SPH
233 #define SP11_REG             SPH
234 #define SP12_REG             SPH
235 #define SP13_REG             SPH
236 #define SP14_REG             SPH
237 #define SP15_REG             SPH
238
239 /* OCR1BL */
240 #define OCR1BL0_REG          OCR1BL
241 #define OCR1BL1_REG          OCR1BL
242 #define OCR1BL2_REG          OCR1BL
243 #define OCR1BL3_REG          OCR1BL
244 #define OCR1BL4_REG          OCR1BL
245 #define OCR1BL5_REG          OCR1BL
246 #define OCR1BL6_REG          OCR1BL
247 #define OCR1BL7_REG          OCR1BL
248
249 /* ICR1L */
250 #define ICR1L0_REG           ICR1L
251 #define ICR1L1_REG           ICR1L
252 #define ICR1L2_REG           ICR1L
253 #define ICR1L3_REG           ICR1L
254 #define ICR1L4_REG           ICR1L
255 #define ICR1L5_REG           ICR1L
256 #define ICR1L6_REG           ICR1L
257 #define ICR1L7_REG           ICR1L
258
259 /* OCR1BH */
260 #define OCR1BH0_REG          OCR1BH
261 #define OCR1BH1_REG          OCR1BH
262 #define OCR1BH2_REG          OCR1BH
263 #define OCR1BH3_REG          OCR1BH
264 #define OCR1BH4_REG          OCR1BH
265 #define OCR1BH5_REG          OCR1BH
266 #define OCR1BH6_REG          OCR1BH
267 #define OCR1BH7_REG          OCR1BH
268
269 /* PIND */
270 #define PIND0_REG            PIND
271 #define PIND1_REG            PIND
272 #define PIND2_REG            PIND
273 #define PIND3_REG            PIND
274 #define PIND4_REG            PIND
275 #define PIND5_REG            PIND
276 #define PIND6_REG            PIND
277 #define PIND7_REG            PIND
278
279 /* SPL */
280 #define SP0_REG              SPL
281 #define SP1_REG              SPL
282 #define SP2_REG              SPL
283 #define SP3_REG              SPL
284 #define SP4_REG              SPL
285 #define SP5_REG              SPL
286 #define SP6_REG              SPL
287 #define SP7_REG              SPL
288
289 /* EECR */
290 #define EERE_REG             EECR
291 #define EEWE_REG             EECR
292 #define EEMWE_REG            EECR
293
294 /* TCNT1L */
295 #define TCNT1L0_REG          TCNT1L
296 #define TCNT1L1_REG          TCNT1L
297 #define TCNT1L2_REG          TCNT1L
298 #define TCNT1L3_REG          TCNT1L
299 #define TCNT1L4_REG          TCNT1L
300 #define TCNT1L5_REG          TCNT1L
301 #define TCNT1L6_REG          TCNT1L
302 #define TCNT1L7_REG          TCNT1L
303
304 /* PORTB */
305 #define PORTB0_REG           PORTB
306 #define PORTB1_REG           PORTB
307 #define PORTB2_REG           PORTB
308 #define PORTB3_REG           PORTB
309 #define PORTB4_REG           PORTB
310 #define PORTB5_REG           PORTB
311 #define PORTB6_REG           PORTB
312 #define PORTB7_REG           PORTB
313
314 /* PORTD */
315 #define PORTD0_REG           PORTD
316 #define PORTD1_REG           PORTD
317 #define PORTD2_REG           PORTD
318 #define PORTD3_REG           PORTD
319 #define PORTD4_REG           PORTD
320 #define PORTD5_REG           PORTD
321 #define PORTD6_REG           PORTD
322 #define PORTD7_REG           PORTD
323
324 /* TCNT1H */
325 #define TCNT1H0_REG          TCNT1H
326 #define TCNT1H1_REG          TCNT1H
327 #define TCNT1H2_REG          TCNT1H
328 #define TCNT1H3_REG          TCNT1H
329 #define TCNT1H4_REG          TCNT1H
330 #define TCNT1H5_REG          TCNT1H
331 #define TCNT1H6_REG          TCNT1H
332 #define TCNT1H7_REG          TCNT1H
333
334 /* PORTC */
335 #define PORTC0_REG           PORTC
336 #define PORTC1_REG           PORTC
337 #define PORTC2_REG           PORTC
338 #define PORTC3_REG           PORTC
339 #define PORTC4_REG           PORTC
340 #define PORTC5_REG           PORTC
341 #define PORTC6_REG           PORTC
342 #define PORTC7_REG           PORTC
343
344 /* PORTA */
345 #define PORTA0_REG           PORTA
346 #define PORTA1_REG           PORTA
347 #define PORTA2_REG           PORTA
348 #define PORTA3_REG           PORTA
349 #define PORTA4_REG           PORTA
350 #define PORTA5_REG           PORTA
351 #define PORTA6_REG           PORTA
352 #define PORTA7_REG           PORTA
353
354 /* TCNT0 */
355 #define TCNT00_REG           TCNT0
356 #define TCNT01_REG           TCNT0
357 #define TCNT02_REG           TCNT0
358 #define TCNT03_REG           TCNT0
359 #define TCNT04_REG           TCNT0
360 #define TCNT05_REG           TCNT0
361 #define TCNT06_REG           TCNT0
362 #define TCNT07_REG           TCNT0
363
364 /* UDR */
365 #define UDR0_REG             UDR
366 #define UDR1_REG             UDR
367 #define UDR2_REG             UDR
368 #define UDR3_REG             UDR
369 #define UDR4_REG             UDR
370 #define UDR5_REG             UDR
371 #define UDR6_REG             UDR
372 #define UDR7_REG             UDR
373
374 /* UBRR */
375 #define UBRR0_REG            UBRR
376 #define UBRR1_REG            UBRR
377 #define UBRR2_REG            UBRR
378 #define UBRR3_REG            UBRR
379 #define UBRR4_REG            UBRR
380 #define UBRR5_REG            UBRR
381 #define UBRR6_REG            UBRR
382 #define UBRR7_REG            UBRR
383
384 /* TIFR */
385 #define ICF1_REG             TIFR
386 #define OCF1B_REG            TIFR
387 #define OCF1A_REG            TIFR
388 #define TOV1_REG             TIFR
389 #define TOV0_REG             TIFR
390
391 /* EEARH */
392 #define EEAR8_REG            EEARH
393
394 /* EEARL */
395 #define EEAR0_REG            EEARL
396 #define EEAR1_REG            EEARL
397 #define EEAR2_REG            EEARL
398 #define EEAR3_REG            EEARL
399 #define EEAR4_REG            EEARL
400 #define EEAR5_REG            EEARL
401 #define EEAR6_REG            EEARL
402 #define EEAR7_REG            EEARL
403
404 /* PINC */
405 #define PINC0_REG            PINC
406 #define PINC1_REG            PINC
407 #define PINC2_REG            PINC
408 #define PINC3_REG            PINC
409 #define PINC4_REG            PINC
410 #define PINC5_REG            PINC
411 #define PINC6_REG            PINC
412 #define PINC7_REG            PINC
413
414 /* PINB */
415 #define PINB0_REG            PINB
416 #define PINB1_REG            PINB
417 #define PINB2_REG            PINB
418 #define PINB3_REG            PINB
419 #define PINB4_REG            PINB
420 #define PINB5_REG            PINB
421 #define PINB6_REG            PINB
422 #define PINB7_REG            PINB
423
424 /* PINA */
425 #define PINA0_REG            PINA
426 #define PINA1_REG            PINA
427 #define PINA2_REG            PINA
428 #define PINA3_REG            PINA
429 #define PINA4_REG            PINA
430 #define PINA5_REG            PINA
431 #define PINA6_REG            PINA
432 #define PINA7_REG            PINA
433
434 /* MCUCR */
435 #define ISC00_REG            MCUCR
436 #define ISC01_REG            MCUCR
437 #define ISC10_REG            MCUCR
438 #define ISC11_REG            MCUCR
439 #define SM_REG               MCUCR
440 #define SE_REG               MCUCR
441 #define SRW_REG              MCUCR
442 #define SRE_REG              MCUCR
443
444 /* OCR1AH */
445 #define OCR1AH0_REG          OCR1AH
446 #define OCR1AH1_REG          OCR1AH
447 #define OCR1AH2_REG          OCR1AH
448 #define OCR1AH3_REG          OCR1AH
449 #define OCR1AH4_REG          OCR1AH
450 #define OCR1AH5_REG          OCR1AH
451 #define OCR1AH6_REG          OCR1AH
452 #define OCR1AH7_REG          OCR1AH
453
454 /* OCR1AL */
455 #define OCR1AL0_REG          OCR1AL
456 #define OCR1AL1_REG          OCR1AL
457 #define OCR1AL2_REG          OCR1AL
458 #define OCR1AL3_REG          OCR1AL
459 #define OCR1AL4_REG          OCR1AL
460 #define OCR1AL5_REG          OCR1AL
461 #define OCR1AL6_REG          OCR1AL
462 #define OCR1AL7_REG          OCR1AL
463
464 /* SPCR */
465 #define SPR0_REG             SPCR
466 #define SPR1_REG             SPCR
467 #define CPHA_REG             SPCR
468 #define CPOL_REG             SPCR
469 #define MSTR_REG             SPCR
470 #define DORD_REG             SPCR
471 #define SPE_REG              SPCR
472 #define SPIE_REG             SPCR
473
474 /* pins mapping */
475 #define AD0_PORT PORTA
476 #define AD0_BIT 0
477
478 #define AD1_PORT PORTA
479 #define AD1_BIT 1
480
481 #define AD2_PORT PORTA
482 #define AD2_BIT 2
483
484 #define AD3_PORT PORTA
485 #define AD3_BIT 3
486
487 #define AD4_PORT PORTA
488 #define AD4_BIT 4
489
490 #define AD5_PORT PORTA
491 #define AD5_BIT 5
492
493 #define AD6_PORT PORTA
494 #define AD6_BIT 6
495
496 #define AD7_PORT PORTA
497 #define AD7_BIT 7
498
499 #define T0_PORT PORTB
500 #define T0_BIT 0
501
502 #define T1_PORT PORTB
503 #define T1_BIT 1
504
505 #define AIN0_PORT PORTB
506 #define AIN0_BIT 2
507
508 #define AIN1_PORT PORTB
509 #define AIN1_BIT 3
510
511 #define SS_PORT PORTB
512 #define SS_BIT 4
513
514 #define MOSI_PORT PORTB
515 #define MOSI_BIT 5
516
517 #define MISO_PORT PORTB
518 #define MISO_BIT 6
519
520 #define SCK_PORT PORTB
521 #define SCK_BIT 7
522
523 #define A8_PORT PORTC
524 #define A8_BIT 0
525
526 #define A9_PORT PORTC
527 #define A9_BIT 1
528
529 #define A10_PORT PORTC
530 #define A10_BIT 2
531
532 #define A11_PORT PORTC
533 #define A11_BIT 3
534
535 #define A12_PORT PORTC
536 #define A12_BIT 4
537
538 #define A13_PORT PORTC
539 #define A13_BIT 5
540
541 #define A14_PORT PORTC
542 #define A14_BIT 6
543
544 #define A15_PORT PORTC
545 #define A15_BIT 7
546
547 #define RXD_PORT PORTD
548 #define RXD_BIT 0
549
550 #define TXD_PORT PORTD
551 #define TXD_BIT 1
552
553 #define INT0_PORT PORTD
554 #define INT0_BIT 2
555
556 #define INT1_PORT PORTD
557 #define INT1_BIT 3
558
559
560 #define OC1A_PORT PORTD
561 #define OC1A_BIT 5
562
563 #define WR_PORT PORTD
564 #define WR_BIT 6
565
566 #define RD_PORT PORTD
567 #define RD_BIT 7
568
569