RTEMS CPU Kit with SuperCore  4.11.3
io90pwm81.h
Go to the documentation of this file.
1 
9 /* Copyright (c) 2009 Atmel Corporation
10  All rights reserved.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14 
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17 
18  * Redistributions in binary form must reproduce the above copyright
19  notice, this list of conditions and the following disclaimer in
20  the documentation and/or other materials provided with the
21  distribution.
22 
23  * Neither the name of the copyright holders nor the names of
24  contributors may be used to endorse or promote products derived
25  from this software without specific prior written permission.
26 
27  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  POSSIBILITY OF SUCH DAMAGE. */
38 
39 
40 /* avr/io90pwm81.h - definitions for AT90PWM81 */
41 
42 /* This file should only be included from <avr/io.h>, never directly. */
43 
44 #ifndef _AVR_IO_H_
45 # error "Include <avr/io.h> instead of this file."
46 #endif
47 
48 #ifndef _AVR_IOXXX_H_
49 # define _AVR_IOXXX_H_ "io90pwm81.h"
50 #else
51 # error "Attempt to include more than one <avr/ioXXX.h> file."
52 #endif
53 
62 #ifndef _AVR_AT90PWM81_H_
63 #define _AVR_AT90PWM81_H_ 1
64 
65 
66 /* Registers and associated bit numbers. */
67 
68 #define ACSR _SFR_IO8(0x00)
69 #define AC1O 1
70 #define AC2O 2
71 #define AC3O 3
72 #define AC1IF 5
73 #define AC2IF 6
74 #define AC3IF 7
75 
76 #define TIMSK1 _SFR_IO8(0x01)
77 #define TOIE1 0
78 #define ICIE1 5
79 
80 #define TIFR1 _SFR_IO8(0x02)
81 #define TOV1 0
82 #define ICF1 5
83 
84 #define PINB _SFR_IO8(0x03)
85 #define PINB0 0
86 #define PINB1 1
87 #define PINB2 2
88 #define PINB3 3
89 #define PINB4 4
90 #define PINB5 5
91 #define PINB6 6
92 #define PINB7 7
93 
94 #define DDRB _SFR_IO8(0x04)
95 #define DDB0 0
96 #define DDB1 1
97 #define DDB2 2
98 #define DDB3 3
99 #define DDB4 4
100 #define DDB5 5
101 #define DDB6 6
102 #define DDB7 7
103 
104 #define PORTB _SFR_IO8(0x05)
105 #define PORTB0 0
106 #define PORTB1 1
107 #define PORTB2 2
108 #define PORTB3 3
109 #define PORTB4 4
110 #define PORTB5 5
111 #define PORTB6 6
112 #define PORTB7 7
113 
114 #define ADCSRA _SFR_IO8(0x06)
115 #define ADPS0 0
116 #define ADPS1 1
117 #define ADPS2 2
118 #define ADIE 3
119 #define ADIF 4
120 #define ADATE 5
121 #define ADSC 6
122 #define ADEN 7
123 
124 #define ADCSRB _SFR_IO8(0x07)
125 #define ADTS0 0
126 #define ADTS1 1
127 #define ADTS2 2
128 #define ADTS3 3
129 #define ADSSEN 4
130 #define ADNCDIS 6
131 #define ADHSM 7
132 
133 #define ADMUX _SFR_IO8(0x08)
134 #define MUX0 0
135 #define MUX1 1
136 #define MUX2 2
137 #define MUX3 3
138 #define ADLAR 5
139 #define REFS0 6
140 #define REFS1 7
141 
142 #define PIND _SFR_IO8(0x09)
143 #define PIND0 0
144 #define PIND1 1
145 #define PIND2 2
146 #define PIND3 3
147 #define PIND4 4
148 #define PIND5 5
149 #define PIND6 6
150 #define PIND7 7
151 
152 #define DDRD _SFR_IO8(0x0A)
153 #define DDD0 0
154 #define DDD1 1
155 #define DDD2 2
156 #define DDD3 3
157 #define DDD4 4
158 #define DDD5 5
159 #define DDD6 6
160 #define DDD7 7
161 
162 #define PORTD _SFR_IO8(0x0B)
163 #define PORTD0 0
164 #define PORTD1 1
165 #define PORTD2 2
166 #define PORTD3 3
167 #define PORTD4 4
168 #define PORTD5 5
169 #define PORTD6 6
170 #define PORTD7 7
171 
172 #define PINE _SFR_IO8(0x0C)
173 #define PINE0 0
174 #define PINE1 1
175 #define PINE2 2
176 
177 #define DDRE _SFR_IO8(0x0D)
178 #define DDE0 0
179 #define DDE1 1
180 #define DDE2 2
181 
182 #define PORTE _SFR_IO8(0x0E)
183 #define PORTE0 0
184 #define PORTE1 1
185 #define PORTE2 2
186 
187 #define PIM0 _SFR_IO8(0x0F)
188 #define PEOPE0 0
189 #define PEOEPE0 1
190 #define PEVE0A 3
191 #define PEVE0B 4
192 
193 #define PIFR0 _SFR_IO8(0x10)
194 #define PEOP0 0
195 #define PRN00 1
196 #define PRN01 2
197 #define PEV0A 3
198 #define PEV0B 4
199 #define POAC0A 6
200 #define POAC0B 7
201 
202 #define PCNF0 _SFR_IO8(0x11)
203 #define PCLKSEL0 1
204 #define POP0 2
205 #define PMODE00 3
206 #define PMODE01 4
207 #define PLOCK0 5
208 #define PALOCK0 6
209 #define PFIFTY0 7
210 
211 #define PCTL0 _SFR_IO8(0x12)
212 #define PRUN0 0
213 #define PCCYC0 1
214 #define PBFM00 2
215 #define PAOC0A 3
216 #define PAOC0B 4
217 #define PBFM01 5
218 #define PPRE00 6
219 #define PPRE01 7
220 
221 #define PIM2 _SFR_IO8(0x13)
222 #define PEOPE2 0
223 #define PEOEPE2 1
224 #define PEVE2A 3
225 #define PEVE2B 4
226 #define PSEIE2 5
227 
228 #define PIFR2 _SFR_IO8(0x14)
229 #define PEOP2 0
230 #define PRN20 1
231 #define PRN21 2
232 #define PEV2A 3
233 #define PEV2B 4
234 #define PSEI2 5
235 #define POAC2A 6
236 #define POAC2B 7
237 
238 #define PCNF2 _SFR_IO8(0x15)
239 #define POME2 0
240 #define PCLKSEL2 1
241 #define POP2 2
242 #define PMODE20 3
243 #define PMODE21 4
244 #define PLOCK2 5
245 #define PALOCK2 6
246 #define PFIFTY2 7
247 
248 #define PCTL2 _SFR_IO8(0x16)
249 #define PRUN2 0
250 #define PCCYC2 1
251 #define PARUN2 2
252 #define PAOC2A 3
253 #define PAOC2B 4
254 #define PBFM2 5
255 #define PPRE20 6
256 #define PPRE21 7
257 
258 #define SPCR _SFR_IO8(0x17)
259 #define SPR0 0
260 #define SPR1 1
261 #define CPHA 2
262 #define CPOL 3
263 #define MSTR 4
264 #define DORD 5
265 #define SPE 6
266 #define SPIE 7
267 
268 #define SPSR _SFR_IO8(0x18)
269 #define SPI2X 0
270 #define WCOL 6
271 #define SPIF 7
272 
273 #define GPIOR0 _SFR_IO8(0x19)
274 #define GPIOR00 0
275 #define GPIOR01 1
276 #define GPIOR02 2
277 #define GPIOR03 3
278 #define GPIOR04 4
279 #define GPIOR05 5
280 #define GPIOR06 6
281 #define GPIOR07 7
282 
283 #define GPIOR1 _SFR_IO8(0x1A)
284 #define GPIOR10 0
285 #define GPIOR11 1
286 #define GPIOR12 2
287 #define GPIOR13 3
288 #define GPIOR14 4
289 #define GPIOR15 5
290 #define GPIOR16 6
291 #define GPIOR17 7
292 
293 #define GPIOR2 _SFR_IO8(0x1B)
294 #define GPIOR20 0
295 #define GPIOR21 1
296 #define GPIOR22 2
297 #define GPIOR23 3
298 #define GPIOR24 4
299 #define GPIOR25 5
300 #define GPIOR26 6
301 #define GPIOR27 7
302 
303 #define EECR _SFR_IO8(0x1C)
304 #define EERE 0
305 #define EEWE 1
306 #define EEMWE 2
307 #define EERIE 3
308 #define EEPM0 4
309 #define EEPM1 5
310 #define EEPAGE 6
311 #define NVMBSY 7
312 
313 #define EEDR _SFR_IO8(0x1D)
314 #define EEDR0 0
315 #define EEDR1 1
316 #define EEDR2 2
317 #define EEDR3 3
318 #define EEDR4 4
319 #define EEDR5 5
320 #define EEDR6 6
321 #define EEDR7 7
322 
323 #define EEAR _SFR_IO16(0x1E)
324 
325 #define EEARL _SFR_IO8(0x1E)
326 #define EEARL0 0
327 #define EEARL1 1
328 #define EEARL2 2
329 #define EEARL3 3
330 #define EEARL4 4
331 #define EEARL5 5
332 #define EEARL6 6
333 #define EEARL7 7
334 
335 #define EEARH _SFR_IO8(0x1F)
336 #define EEAR8 0
337 
338 #define EIFR _SFR_IO8(0x20)
339 #define INTF0 0
340 #define INTF1 1
341 #define INTF2 2
342 
343 #define EIMSK _SFR_IO8(0x21)
344 #define INT0 0
345 #define INT1 1
346 #define INT2 2
347 
348 #define OCR0SB _SFR_IO16(0x22)
349 
350 #define OCR0SBL _SFR_IO8(0x22)
351 #define OCR0SB_0 0
352 #define OCR0SB_1 1
353 #define OCR0SB_2 2
354 #define OCR0SB_3 3
355 #define OCR0SB_4 4
356 #define OCR0SB_5 5
357 #define OCR0SB_6 6
358 #define OCR0SB_7 7
359 
360 #define OCR0SBH _SFR_IO8(0x23)
361 #define OCR0SB_8 0
362 #define OCR0SB_9 1
363 #define OCR0SB_00 2
364 #define OCR0SB_01 3
365 
366 #define OCR0RB _SFR_IO16(0x24)
367 
368 #define OCR0RBL _SFR_IO8(0x24)
369 #define OCR0RB_0 0
370 #define OCR0RB_1 1
371 #define OCR0RB_2 2
372 #define OCR0RB_3 3
373 #define OCR0RB_4 4
374 #define OCR0RB_5 5
375 #define OCR0RB_6 6
376 #define OCR0RB_7 7
377 
378 #define OCR0RBH _SFR_IO8(0x25)
379 #define OCR0RB_8 0
380 #define OCR0RB_9 1
381 #define OCR0RB_00 2
382 #define OCR0RB_01 3
383 #define OCR0RB_02 4
384 #define OCR0RB_03 5
385 #define OCR0RB_04 6
386 #define OCR0RB_05 7
387 
388 #define OCR2SB _SFR_IO16(0x26)
389 
390 #define OCR2SBL _SFR_IO8(0x26)
391 #define OCR2SB_0 0
392 #define OCR2SB_1 1
393 #define OCR2SB_2 2
394 #define OCR2SB_3 3
395 #define OCR2SB_4 4
396 #define OCR2SB_5 5
397 #define OCR2SB_6 6
398 #define OCR2SB_7 7
399 
400 #define OCR2SBH _SFR_IO8(0x27)
401 #define OCR2SB_8 0
402 #define OCR2SB_9 1
403 #define OCR2SB_10 2
404 #define OCR2SB_11 3
405 
406 #define OCR2RB _SFR_IO16(0x28)
407 
408 #define OCR2RBL _SFR_IO8(0x28)
409 #define OCR2RB_0 0
410 #define OCR2RB_1 1
411 #define OCR2RB_2 2
412 #define OCR2RB_3 3
413 #define OCR2RB_4 4
414 #define OCR2RB_5 5
415 #define OCR2RB_6 6
416 #define OCR2RB_7 7
417 
418 #define OCR2RBH _SFR_IO8(0x29)
419 #define OCR2RB_8 0
420 #define OCR2RB_9 1
421 #define OCR2RB_10 2
422 #define OCR2RB_11 3
423 #define OCR2RB_12 4
424 #define OCR2RB_13 5
425 #define OCR2RB_14 6
426 #define OCR2RB_15 7
427 
428 #define OCR0RA _SFR_IO16(0x2A)
429 
430 #define OCR0RAL _SFR_IO8(0x2A)
431 #define OCR0RA_0 0
432 #define OCR0RA_1 1
433 #define OCR0RA_2 2
434 #define OCR0RA_3 3
435 #define OCR0RA_4 4
436 #define OCR0RA_5 5
437 #define OCR0RA_6 6
438 #define OCR0RA_7 7
439 
440 #define OCR0RAH _SFR_IO8(0x2B)
441 #define OCR0RA_8 0
442 #define OCR0RA_9 1
443 #define OCR0RA_00 2
444 #define OCR0RA_01 3
445 
446 #ifndef __ASSEMBLER__
447 #define ADC _SFR_IO16(0x2C)
448 #endif
449 #define ADCW _SFR_IO16(0x2C)
450 
451 #define ADCL _SFR_IO8(0x2C)
452 #define ADCL0 0
453 #define ADCL1 1
454 #define ADCL2 2
455 #define ADCL3 3
456 #define ADCL4 4
457 #define ADCL5 5
458 #define ADCL6 6
459 #define ADCL7 7
460 
461 #define ADCH _SFR_IO8(0x2D)
462 #define ADCH0 0
463 #define ADCH1 1
464 #define ADCH2 2
465 #define ADCH3 3
466 #define ADCH4 4
467 #define ADCH5 5
468 #define ADCH6 6
469 #define ADCH7 7
470 
471 #define OCR2RA _SFR_IO16(0x2E)
472 
473 #define OCR2RAL _SFR_IO8(0x2E)
474 #define OCR2RA_0 0
475 #define OCR2RA_1 1
476 #define OCR2RA_2 2
477 #define OCR2RA_3 3
478 #define OCR2RA_4 4
479 #define OCR2RA_5 5
480 #define OCR2RA_6 6
481 #define OCR2RA_7 7
482 
483 #define OCR2RAH _SFR_IO8(0x2F)
484 #define OCR2RA_8 0
485 #define OCR2RA_9 1
486 #define OCR2RA_10 2
487 #define OCR2RA_11 3
488 
489 #define DWDR _SFR_IO8(0x31)
490 
491 #define MSMCR _SFR_IO8(0x32)
492 
493 #define SMCR _SFR_IO8(0x33)
494 #define SE 0
495 #define SM0 1
496 #define SM1 2
497 #define SM2 3
498 
499 #define MCUSR _SFR_IO8(0x34)
500 #define PORF 0
501 #define EXTRF 1
502 #define BORF 2
503 #define WDRF 3
504 
505 #define MCUCR _SFR_IO8(0x35)
506 #define IVCE 0
507 #define IVSEL 1
508 #define CKRC81 2
509 #define RSTDIS 3
510 #define PUD 4
511 
512 #define SPDR _SFR_IO8(0x36)
513 #define SPDR0 0
514 #define SPDR1 1
515 #define SPDR2 2
516 #define SPDR3 3
517 #define SPDR4 4
518 #define SPDR5 5
519 #define SPDR6 6
520 #define SPDR7 7
521 
522 #define SPMCSR _SFR_IO8(0x37)
523 #define SPMEN 0
524 #define PGERS 1
525 #define PGWRT 2
526 #define BLBSET 3
527 #define RWWSRE 4
528 #define SIGRD 5
529 #define RWWSB 6
530 #define SPMIE 7
531 
532 #define DAC _SFR_IO16(0x38)
533 
534 #define DACL _SFR_IO8(0x38)
535 #define DACL0 0
536 #define DACL1 1
537 #define DACL2 2
538 #define DACL3 3
539 #define DACL4 4
540 #define DACL5 5
541 #define DACL6 6
542 #define DACL7 7
543 
544 #define DACH _SFR_IO8(0x39)
545 #define DACH0 0
546 #define DACH1 1
547 #define DACH2 2
548 #define DACH3 3
549 #define DACH4 4
550 #define DACH5 5
551 #define DACH6 6
552 #define DACH7 7
553 
554 #define TCNT1 _SFR_IO16(0x3A)
555 
556 #define TCNT1L _SFR_IO8(0x3A)
557 #define TCNT1L0 0
558 #define TCNT1L1 1
559 #define TCNT1L2 2
560 #define TCNT1L3 3
561 #define TCNT1L4 4
562 #define TCNT1L5 5
563 #define TCNT1L6 6
564 #define TCNT1L7 7
565 
566 #define TCNT1H _SFR_IO8(0x3B)
567 #define TCNT1H0 0
568 #define TCNT1H1 1
569 #define TCNT1H2 2
570 #define TCNT1H3 3
571 #define TCNT1H4 4
572 #define TCNT1H5 5
573 #define TCNT1H6 6
574 #define TCNT1H7 7
575 
576 #define OCR0SA _SFR_MEM16(0x60)
577 
578 #define OCR0SAL _SFR_MEM8(0x60)
579 #define OCR0SA_0 0
580 #define OCR0SA_1 1
581 #define OCR0SA_2 2
582 #define OCR0SA_3 3
583 #define OCR0SA_4 4
584 #define OCR0SA_5 5
585 #define OCR0SA_6 6
586 #define OCR0SA_7 7
587 
588 #define OCR0SAH _SFR_MEM8(0x61)
589 #define OCR0SA_8 0
590 #define OCR0SA_9 1
591 #define OCR0SA_00 2
592 #define OCR0SA_01 3
593 
594 #define PFRC0A _SFR_MEM8(0x62)
595 #define PRFM0A0 0
596 #define PRFM0A1 1
597 #define PRFM0A2 2
598 #define PRFM0A3 3
599 #define PFLTE0A 4
600 #define PELEV0A 5
601 #define PISEL0A 6
602 #define PCAE0A 7
603 
604 #define PFRC0B _SFR_MEM8(0x63)
605 #define PRFM0B0 0
606 #define PRFM0B1 1
607 #define PRFM0B2 2
608 #define PRFM0B3 3
609 #define PFLTE0B 4
610 #define PELEV0B 5
611 #define PISEL0B 6
612 #define PCAE0B 7
613 
614 #define OCR2SA _SFR_MEM16(0x64)
615 
616 #define OCR2SAL _SFR_MEM8(0x64)
617 #define OCR2SA_0 0
618 #define OCR2SA_1 1
619 #define OCR2SA_2 2
620 #define OCR2SA_3 3
621 #define OCR2SA_4 4
622 #define OCR2SA_5 5
623 #define OCR2SA_6 6
624 #define OCR2SA_7 7
625 
626 #define OCR2SAH _SFR_MEM8(0x65)
627 #define OCR2SA_8 0
628 #define OCR2SA_9 1
629 #define OCR2SA_10 2
630 #define OCR2SA_11 3
631 
632 #define PFRC2A _SFR_MEM8(0x66)
633 #define PRFM2A0 0
634 #define PRFM2A1 1
635 #define PRFM2A2 2
636 #define PRFM2A3 3
637 #define PFLTE2A 4
638 #define PELEV2A 5
639 #define PISEL2A 6
640 #define PCAE2A 7
641 
642 #define PFRC2B _SFR_MEM8(0x67)
643 #define PRFM2B0 0
644 #define PRFM2B1 1
645 #define PRFM2B2 2
646 #define PRFM2B3 3
647 #define PFLTE2B 4
648 #define PELEV2B 5
649 #define PISEL2B 6
650 #define PCAE2B 7
651 
652 #define PICR0 _SFR_MEM16(0x68)
653 
654 #define PICR0L _SFR_MEM8(0x68)
655 #define PICR0_0 0
656 #define PICR0_1 1
657 #define PICR0_2 2
658 #define PICR0_3 3
659 #define PICR0_4 4
660 #define PICR0_5 5
661 #define PICR0_6 6
662 #define PICR0_7 7
663 
664 #define PICR0H _SFR_MEM8(0x69)
665 #define PICR0_8 0
666 #define PICR0_9 1
667 #define PICR0_10 2
668 #define PICR0_11 3
669 #define PCST0 7
670 
671 #define PSOC0 _SFR_MEM8(0x6A)
672 #define POEN0A 0
673 #define POEN0B 2
674 #define PSYNC00 4
675 #define PSYNC01 5
676 #define PISEL0B1 6
677 #define PISEL0A1 7
678 
679 #define PICR2 _SFR_MEM16(0x6C)
680 
681 #define PICR2L _SFR_MEM8(0x6C)
682 #define PICR2_0 0
683 #define PICR2_1 1
684 #define PICR2_2 2
685 #define PICR2_3 3
686 #define PICR2_4 4
687 #define PICR2_5 5
688 #define PICR2_6 6
689 #define PICR2_7 7
690 
691 #define PICR2H _SFR_MEM8(0x6D)
692 #define PICR2_8 0
693 #define PICR2_9 1
694 #define PICR2_10 2
695 #define PICR2_11 3
696 #define PCST2 7
697 
698 #define PSOC2 _SFR_MEM8(0x6E)
699 #define POEN2A 0
700 #define POEN2C 1
701 #define POEN2B 2
702 #define POEN2D 3
703 #define PSYNC2_0 4
704 #define PSYNC2_1 5
705 #define POS22 6
706 #define POS23 7
707 
708 #define POM2 _SFR_MEM8(0x6F)
709 #define POMV2A0 0
710 #define POMV2A1 1
711 #define POMV2A2 2
712 #define POMV2A3 3
713 #define POMV2B0 4
714 #define POMV2B1 5
715 #define POMV2B2 6
716 #define POMV2B3 7
717 
718 #define PCNFE2 _SFR_MEM8(0x70)
719 #define PISEL2B1 0
720 #define PISEL2A1 1
721 #define PELEV2B1 2
722 #define PELEV2A1 3
723 #define PBFM21 4
724 #define PASDLK20 5
725 #define PASDLK21 6
726 #define PASDLK22 7
727 
728 #define PASDLY2 _SFR_MEM8(0x71)
729 #define PASDLY2_0 0
730 #define PASDLY2_1 1
731 #define PASDLY2_2 2
732 #define PASDLY2_3 3
733 #define PASDLY2_4 4
734 #define PASDLY2_5 5
735 #define PASDLY2_6 6
736 #define PASDLY2_7 7
737 
738 #define DACON _SFR_MEM8(0x76)
739 #define DAEN 0
740 #define DALA 2
741 #define DATS0 4
742 #define DATS1 5
743 #define DATS2 6
744 #define DAATE 7
745 
746 #define DIDR0 _SFR_MEM8(0x77)
747 #define ADC0D 0
748 #define ADC1D 1
749 #define ADC2D 2
750 #define ADC3D 3
751 #define ADC4D 4
752 #define ADC5D 5
753 #define ADC7D 6
754 #define ADC8D 7
755 
756 #define DIDR1 _SFR_MEM8(0x78)
757 #define ADC9D 0
758 #define ADC10D 1
759 #define AMP0PD 2
760 #define ACMP1MD 3
761 
762 #define AMP0CSR _SFR_MEM8(0x79)
763 #define AMP0TS0 0
764 #define AMP0TS1 1
765 #define AMP0GS 3
766 #define AMP0G0 4
767 #define AMP0G1 5
768 #define AMP0IS 6
769 #define AMP0EN 7
770 
771 #define AC1ECON _SFR_MEM8(0x7A)
772 #define AC1H0 0
773 #define AC1H1 1
774 #define AC1H2 2
775 #define AC1ICE 3
776 #define AC1OE 4
777 #define AC1OI 5
778 
779 #define AC2ECON _SFR_MEM8(0x7B)
780 #define AC2H0 0
781 #define AC2H1 1
782 #define AC2H2 2
783 #define AC2OE 4
784 #define AC2OI 5
785 
786 #define AC3ECON _SFR_MEM8(0x7C)
787 #define AC3H0 0
788 #define AC3H1 1
789 #define AC3H2 2
790 #define AC3OE 4
791 #define AC3OI 5
792 
793 #define AC1CON _SFR_MEM8(0x7D)
794 #define AC1M0 0
795 #define AC1M1 1
796 #define AC1M2 2
797 #define AC1IS0 4
798 #define AC1IS1 5
799 #define AC1IE 6
800 #define AC1EN 7
801 
802 #define AC2CON _SFR_MEM8(0x7E)
803 #define AC2M0 0
804 #define AC2M1 1
805 #define AC2M2 2
806 #define AC2IS0 4
807 #define AC2IS1 5
808 #define AC2IE 6
809 #define AC2EN 7
810 
811 #define AC3CON _SFR_MEM8(0x7F)
812 #define AC3M0 0
813 #define AC3M1 1
814 #define AC3M2 2
815 #define AC3OEA 3
816 #define AC3IS0 4
817 #define AC3IS1 5
818 #define AC3IE 6
819 #define AC3EN 7
820 
821 #define BGCRR _SFR_MEM8(0x80)
822 #define BGCR0 0
823 #define BGCR1 1
824 #define BGCR2 2
825 #define BGCR3 3
826 
827 #define BGCCR _SFR_MEM8(0x81)
828 #define BGCC0 0
829 #define BGCC1 1
830 #define BGCC2 2
831 #define BGCC3 3
832 
833 #define WDTCSR _SFR_MEM8(0x82)
834 #define WDP0 0
835 #define WDP1 1
836 #define WDP2 2
837 #define WDE 3
838 #define WDCE 4
839 #define WDP3 5
840 #define WDIE 6
841 #define WDIF 7
842 
843 #define CLKPR _SFR_MEM8(0x83)
844 #define CLKPS0 0
845 #define CLKPS1 1
846 #define CLKPS2 2
847 #define CLKPS3 3
848 #define CLKPCE 7
849 
850 #define CLKCSR _SFR_MEM8(0x84)
851 #define CLKC0 0
852 #define CLKC1 1
853 #define CLKC2 2
854 #define CLKC3 3
855 #define CLKRDY 4
856 #define CLKCCE 7
857 
858 #define CLKSELR _SFR_MEM8(0x85)
859 #define CKSEL0 0
860 #define CKSEL1 1
861 #define CKSEL2 2
862 #define CKSEL3 3
863 #define CSUT0 4
864 #define CSUT1 5
865 #define COUT 6
866 
867 #define PRR _SFR_MEM8(0x86)
868 #define PRADC 0
869 #define PRSPI 2
870 #define PRTIM1 4
871 #define PRPSC0 5
872 #define PRPSC2 7
873 
874 #define PLLCSR _SFR_MEM8(0x87)
875 #define PLOCK 0
876 #define PLLE 1
877 #define PLLF0 2
878 #define PLLF1 3
879 #define PLLF2 4
880 #define PLLF3 5
881 
882 #define OSCCAL _SFR_MEM8(0x88)
883 #define CAL0 0
884 #define CAL1 1
885 #define CAL2 2
886 #define CAL3 3
887 #define CAL4 4
888 #define CAL5 5
889 #define CAL6 6
890 #define CAL7 7
891 
892 #define EICRA _SFR_MEM8(0x89)
893 #define ISC00 0
894 #define ISC01 1
895 #define ISC10 2
896 #define ISC11 3
897 #define ISC20 4
898 #define ISC21 5
899 
900 #define TCCR1B _SFR_MEM8(0x8A)
901 #define CS10 0
902 #define CS11 1
903 #define CS12 2
904 #define WGM13 4
905 #define ICES1 6
906 #define ICNC1 7
907 
908 #define ICR1 _SFR_MEM16(0x8C)
909 
910 #define ICR1L _SFR_MEM8(0x8C)
911 #define ICR1L0 0
912 #define ICR1L1 1
913 #define ICR1L2 2
914 #define ICR1L3 3
915 #define ICR1L4 4
916 #define ICR1L5 5
917 #define ICR1L6 6
918 #define ICR1L7 7
919 
920 #define ICR1H _SFR_MEM8(0x8D)
921 #define ICR1H0 0
922 #define ICR1H1 1
923 #define ICR1H2 2
924 #define ICR1H3 3
925 #define ICR1H4 4
926 #define ICR1H5 5
927 #define ICR1H6 6
928 #define ICR1H7 7
929 
930 
931 /* Interrupt vectors */
932 /* Vector 0 is the reset vector */
933 #define PSC2_CAPT_vect_num 1
934 #define PSC2_CAPT_vect _VECTOR(1) /* PSC2 Capture Event */
935 #define PSC2_EC_vect_num 2
936 #define PSC2_EC_vect _VECTOR(2) /* PSC2 End Cycle */
937 #define PSC2_EEC_vect_num 3
938 #define PSC2_EEC_vect _VECTOR(3) /* PSC2 End Of Enhanced Cycle */
939 #define PSC0_CAPT_vect_num 4
940 #define PSC0_CAPT_vect _VECTOR(4) /* PSC0 Capture Event */
941 #define PSC0_EC_vect_num 5
942 #define PSC0_EC_vect _VECTOR(5) /* PSC0 End Cycle */
943 #define PSC0_EEC_vect_num 6
944 #define PSC0_EEC_vect _VECTOR(6) /* PSC0 End Of Enhanced Cycle */
945 #define ANALOG_COMP_1_vect_num 7
946 #define ANALOG_COMP_1_vect _VECTOR(7) /* Analog Comparator 1 */
947 #define ANALOG_COMP_2_vect_num 8
948 #define ANALOG_COMP_2_vect _VECTOR(8) /* Analog Comparator 2 */
949 #define ANALOG_COMP_3_vect_num 9
950 #define ANALOG_COMP_3_vect _VECTOR(9) /* Analog Comparator 3 */
951 #define INT0_vect_num 10
952 #define INT0_vect _VECTOR(10) /* External Interrupt Request 0 */
953 #define TIMER1_CAPT_vect_num 11
954 #define TIMER1_CAPT_vect _VECTOR(11) /* Timer/Counter1 Capture Event */
955 #define TIMER1_OVF_vect_num 12
956 #define TIMER1_OVF_vect _VECTOR(12) /* Timer/Counter1 Overflow */
957 #define ADC_vect_num 13
958 #define ADC_vect _VECTOR(13) /* ADC Conversion Complete */
959 #define INT1_vect_num 14
960 #define INT1_vect _VECTOR(14) /* External Interrupt Request 1 */
961 #define SPI_STC_vect_num 15
962 #define SPI_STC_vect _VECTOR(15) /* SPI Serial Transfer Complet */
963 #define INT2_vect_num 16
964 #define INT2_vect _VECTOR(16) /* External Interrupt Request 2 */
965 #define WDT_vect_num 17
966 #define WDT_vect _VECTOR(17) /* Watchdog Timeout Interrupt */
967 #define EE_READY_vect_num 18
968 #define EE_READY_vect _VECTOR(18) /* EEPROM Ready */
969 #define SPM_READY_vect_num 19
970 #define SPM_READY_vect _VECTOR(19) /* Store Program Memory Read */
971 
972 #define _VECTOR_SIZE 2 /* Size of individual vector. */
973 #define _VECTORS_SIZE (20 * _VECTOR_SIZE)
974 
975 
976 /* Constants */
977 #define SPM_PAGESIZE (64)
978 #define RAMSTART (0x0100)
979 #define RAMSIZE (256)
980 #define RAMEND (RAMSTART + RAMSIZE - 1)
981 #define XRAMSTART (NA)
982 #define XRAMSIZE (0)
983 #define XRAMEND (RAMEND)
984 #define E2END (0x1FF)
985 #define E2PAGESIZE (4)
986 #define FLASHEND (0x1FFF)
987 
988 
989 /* Fuses */
990 #define FUSE_MEMORY_SIZE 3
991 
992 /* Low Fuse Byte */
993 #define FUSE_CKSEL0 (unsigned char)~_BV(0) /* Select Clock Source */
994 #define FUSE_CKSEL1 (unsigned char)~_BV(1) /* Select Clock Source */
995 #define FUSE_CKSEL2 (unsigned char)~_BV(2) /* Select Clock Source */
996 #define FUSE_CKSEL3 (unsigned char)~_BV(3) /* Select Clock Source */
997 #define FUSE_SUT0 (unsigned char)~_BV(4) /* Select start-up time */
998 #define FUSE_SUT1 (unsigned char)~_BV(5) /* Select start-up time */
999 #define FUSE_CKOUT (unsigned char)~_BV(6) /* Clock Output */
1000 #define FUSE_CKDIV8 (unsigned char)~_BV(7) /* Divide clock by 8 */
1001 #define LFUSE_DEFAULT (FUSE_CKDIV8 & FUSE_SUT0 & FUSE_CKSEL3 & FUSE_CKSEL2 & FUSE_CKSEL0)
1002 
1003 /* High Fuse Byte */
1004 #define FUSE_BOOTRST (unsigned char)~_BV(0) /* Select Reset Vector */
1005 #define FUSE_BOOTSZ0 (unsigned char)~_BV(1) /* Select Boot Size */
1006 #define FUSE_BOOTSZ1 (unsigned char)~_BV(2) /* Select Boot Size */
1007 #define FUSE_EESAVE (unsigned char)~_BV(3) /* EEPROM memory is preserved through chip erase */
1008 #define FUSE_WDTON (unsigned char)~_BV(4) /* Watchdog timer always on */
1009 #define FUSE_SPIEN (unsigned char)~_BV(5) /* Enable Serial programming and Data Downloading */
1010 #define FUSE_DWEN (unsigned char)~_BV(6) /* debugWIRE Enable */
1011 #define FUSE_RSTDISBL (unsigned char)~_BV(7) /* External Reset Disable */
1012 #define HFUSE_DEFAULT (FUSE_SPIEN & FUSE_BOOTSZ1 & FUSE_BOOTSZ0)
1013 
1014 /* Extended Fuse Byte */
1015 #define FUSE_BODLEVEL0 (unsigned char)~_BV(0) /* Brown-out Detector trigger level */
1016 #define FUSE_BODLEVEL1 (unsigned char)~_BV(1) /* Brown-out Detector trigger level */
1017 #define FUSE_BODLEVEL2 (unsigned char)~_BV(2) /* Brown out detector trigger level */
1018 #define FUSE_PSCINRB (unsigned char)~_BV(3) /* PSC2 & PSC0 Input Reset Behavior */
1019 #define FUSE_PSCRV (unsigned char)~_BV(4) /* PSCOUT Reset Value */
1020 #define FUSE_PSC0RB (unsigned char)~_BV(5) /* PSC0 Reset Behaviour */
1021 #define FUSE_PSC2RBA (unsigned char)~_BV(6) /* PSC2 Rest Behavior for out OUT22 & 23 */
1022 #define FUSE_PSC2RB (unsigned char)~_BV(7) /* PSC2 Reset Behaviour */
1023 #define EFUSE_DEFAULT (0xFF)
1024 
1025 
1026 /* Lock Bits */
1027 #define __LOCK_BITS_EXIST
1028 #define __BOOT_LOCK_BITS_0_EXIST
1029 #define __BOOT_LOCK_BITS_1_EXIST
1030 
1031 
1032 /* Signature */
1033 #define SIGNATURE_0 0x1E
1034 #define SIGNATURE_1 0x93
1035 #define SIGNATURE_2 0x88
1036 
1039 #endif /* _AVR_AT90PWM81_H_ */
1040