source: rtems/cpukit/score/cpu/avr/avr/iom16u4.h @ 04a62dce

4.104.11
Last change on this file since 04a62dce was 04a62dce, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 6, 2009 at 2:52:07 PM

2009-08-05 Josh Switnicki <josh.switnicki@…>

  • Makefile.am: added AVR specific Header files to score/cpu/avr/avr. These are from avr-libc 1.6 and assumed to exist by AVR applications.
  • preinstall.am: Regenerated.
  • Property mode set to 100644
File size: 26.7 KB
Line 
1/* Copyright (c) 2009 Atmel Corporation
2   All rights reserved.
3
4   Redistribution and use in source and binary forms, with or without
5   modification, are permitted provided that the following conditions are met:
6
7   * Redistributions of source code must retain the above copyright
8     notice, this list of conditions and the following disclaimer.
9
10   * Redistributions in binary form must reproduce the above copyright
11     notice, this list of conditions and the following disclaimer in
12     the documentation and/or other materials provided with the
13     distribution.
14
15   * Neither the name of the copyright holders nor the names of
16     contributors may be used to endorse or promote products derived
17     from this software without specific prior written permission.
18
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  POSSIBILITY OF SUCH DAMAGE. */
30
31/* $Id$ */
32
33/* avr/iom16u4.h - definitions for ATmega16U4 */
34
35/* This file should only be included from <avr/io.h>, never directly. */
36
37#ifndef _AVR_IO_H_
38#  error "Include <avr/io.h> instead of this file."
39#endif
40
41#ifndef _AVR_IOXXX_H_
42#  define _AVR_IOXXX_H_ "iom16u4.h"
43#else
44#  error "Attempt to include more than one <avr/ioXXX.h> file."
45#endif
46
47
48#ifndef _AVR_ATmega16U4_H_
49#define _AVR_ATmega16U4_H_ 1
50
51
52/* Registers and associated bit numbers. */
53
54#define PINB _SFR_IO8(0x03)
55#define PINB0 0
56#define PINB1 1
57#define PINB2 2
58#define PINB3 3
59#define PINB4 4
60#define PINB5 5
61#define PINB6 6
62#define PINB7 7
63
64#define DDRB _SFR_IO8(0x04)
65#define DDB0 0
66#define DDB1 1
67#define DDB2 2
68#define DDB3 3
69#define DDB4 4
70#define DDB5 5
71#define DDB6 6
72#define DDB7 7
73
74#define PORTB _SFR_IO8(0x05)
75#define PORTB0 0
76#define PORTB1 1
77#define PORTB2 2
78#define PORTB3 3
79#define PORTB4 4
80#define PORTB5 5
81#define PORTB6 6
82#define PORTB7 7
83
84#define PINC _SFR_IO8(0x06)
85#define PINC6 6
86#define PINC7 7
87
88#define DDRC _SFR_IO8(0x07)
89#define DDC6 6
90#define DDC7 7
91
92#define PORTC _SFR_IO8(0x08)
93#define PORTC6 6
94#define PORTC7 7
95
96#define PIND _SFR_IO8(0x09)
97#define PIND0 0
98#define PIND1 1
99#define PIND2 2
100#define PIND3 3
101#define PIND4 4
102#define PIND5 5
103#define PIND6 6
104#define PIND7 7
105
106#define DDRD _SFR_IO8(0x0A)
107#define DDD0 0
108#define DDD1 1
109#define DDD2 2
110#define DDD3 3
111#define DDD4 4
112#define DDD5 5
113#define DDD6 6
114#define DDD7 7
115
116#define PORTD _SFR_IO8(0x0B)
117#define PORTD0 0
118#define PORTD1 1
119#define PORTD2 2
120#define PORTD3 3
121#define PORTD4 4
122#define PORTD5 5
123#define PORTD6 6
124#define PORTD7 7
125
126#define PINE _SFR_IO8(0x0C)
127#define PINE2 2
128#define PINE6 6
129
130#define DDRE _SFR_IO8(0x0D)
131#define DDE2 2
132#define DDE6 6
133
134#define PORTE _SFR_IO8(0x0E)
135#define PORTE2 2
136#define PORTE6 6
137
138#define PINF _SFR_IO8(0x0F)
139#define PINF0 0
140#define PINF1 1
141#define PINF4 4
142#define PINF5 5
143#define PINF6 6
144#define PINF7 7
145
146#define DDRF _SFR_IO8(0x10)
147#define DDF0 0
148#define DDF1 1
149#define DDF4 4
150#define DDF5 5
151#define DDF6 6
152#define DDF7 7
153
154#define PORTF _SFR_IO8(0x11)
155#define PORTF0 0
156#define PORTF1 1
157#define PORTF4 4
158#define PORTF5 5
159#define PORTF6 6
160#define PORTF7 7
161
162#define TIFR0 _SFR_IO8(0x15)
163#define TOV0 0
164#define OCF0A 1
165#define OCF0B 2
166
167#define TIFR1 _SFR_IO8(0x16)
168#define TOV1 0
169#define OCF1A 1
170#define OCF1B 2
171#define OCF1C 3
172#define ICF1 5
173
174#define TIFR2 _SFR_IO8(0x17)
175
176#define TIFR3 _SFR_IO8(0x18)
177#define TOV3 0
178#define OCF3A 1
179#define OCF3B 2
180#define OCF3C 3
181#define ICF3 5
182
183#define TIFR4 _SFR_IO8(0x19)
184#define TOV4 2
185#define OCF4B 5
186#define OCF4A 6
187#define OCF4D 7
188
189#define PCIFR _SFR_IO8(0x1B)
190#define PCIF0 0
191
192#define EIFR _SFR_IO8(0x1C)
193#define INTF0 0
194#define INTF1 1
195#define INTF2 2
196#define INTF3 3
197#define INTF4 4
198#define INTF5 5
199#define INTF6 6
200#define INTF7 7
201
202#define EIMSK _SFR_IO8(0x1D)
203#define INT0 0
204#define INT1 1
205#define INT2 2
206#define INT3 3
207#define INT4 4
208#define INT5 5
209#define INT6 6
210#define INT7 7
211
212#define GPIOR0 _SFR_IO8(0x1E)
213#define GPIOR00 0
214#define GPIOR01 1
215#define GPIOR02 2
216#define GPIOR03 3
217#define GPIOR04 4
218#define GPIOR05 5
219#define GPIOR06 6
220#define GPIOR07 7
221
222#define EECR _SFR_IO8(0x1F)
223#define EERE 0
224#define EEPE 1
225#define EEMPE 2
226#define EERIE 3
227#define EEPM0 4
228#define EEPM1 5
229
230#define EEDR _SFR_IO8(0x20)
231#define EEDR0 0
232#define EEDR1 1
233#define EEDR2 2
234#define EEDR3 3
235#define EEDR4 4
236#define EEDR5 5
237#define EEDR6 6
238#define EEDR7 7
239
240#define EEAR _SFR_IO16(0x21)
241
242#define EEARL _SFR_IO8(0x21)
243#define EEAR0 0
244#define EEAR1 1
245#define EEAR2 2
246#define EEAR3 3
247#define EEAR4 4
248#define EEAR5 5
249#define EEAR6 6
250#define EEAR7 7
251
252#define EEARH _SFR_IO8(0x22)
253#define EEAR8 0
254#define EEAR9 1
255#define EEAR10 2
256#define EEAR11 3
257
258#define GTCCR _SFR_IO8(0x23)
259#define PSRSYNC 0
260#define TSM 7
261
262#define TCCR0A _SFR_IO8(0x24)
263#define WGM00 0
264#define WGM01 1
265#define COM0B0 4
266#define COM0B1 5
267#define COM0A0 6
268#define COM0A1 7
269
270#define TCCR0B _SFR_IO8(0x25)
271#define CS00 0
272#define CS01 1
273#define CS02 2
274#define WGM02 3
275#define FOC0B 6
276#define FOC0A 7
277
278#define TCNT0 _SFR_IO8(0x26)
279#define TCNT0_0 0
280#define TCNT0_1 1
281#define TCNT0_2 2
282#define TCNT0_3 3
283#define TCNT0_4 4
284#define TCNT0_5 5
285#define TCNT0_6 6
286#define TCNT0_7 7
287
288#define OCR0A _SFR_IO8(0x27)
289#define OCROA_0 0
290#define OCROA_1 1
291#define OCROA_2 2
292#define OCROA_3 3
293#define OCROA_4 4
294#define OCROA_5 5
295#define OCROA_6 6
296#define OCROA_7 7
297
298#define OCR0B _SFR_IO8(0x28)
299#define OCR0B_0 0
300#define OCR0B_1 1
301#define OCR0B_2 2
302#define OCR0B_3 3
303#define OCR0B_4 4
304#define OCR0B_5 5
305#define OCR0B_6 6
306#define OCR0B_7 7
307
308#define PLLCSR _SFR_IO8(0x29)
309#define PLOCK 0
310#define PLLE 1
311#define PINDIV 4
312
313#define GPIOR1 _SFR_IO8(0x2A)
314#define GPIOR10 0
315#define GPIOR11 1
316#define GPIOR12 2
317#define GPIOR13 3
318#define GPIOR14 4
319#define GPIOR15 5
320#define GPIOR16 6
321#define GPIOR17 7
322
323#define GPIOR2 _SFR_IO8(0x2B)
324#define GPIOR20 0
325#define GPIOR21 1
326#define GPIOR22 2
327#define GPIOR23 3
328#define GPIOR24 4
329#define GPIOR25 5
330#define GPIOR26 6
331#define GPIOR27 7
332
333#define SPCR _SFR_IO8(0x2C)
334#define SPR0 0
335#define SPR1 1
336#define CPHA 2
337#define CPOL 3
338#define MSTR 4
339#define DORD 5
340#define SPE 6
341#define SPIE 7
342
343#define SPSR _SFR_IO8(0x2D)
344#define SPI2X 0
345#define WCOL 6
346#define SPIF 7
347
348#define SPDR _SFR_IO8(0x2E)
349#define SPDR0 0
350#define SPDR1 1
351#define SPDR2 2
352#define SPDR3 3
353#define SPDR4 4
354#define SPDR5 5
355#define SPDR6 6
356#define SPDR7 7
357
358#define ACSR _SFR_IO8(0x30)
359#define ACIS0 0
360#define ACIS1 1
361#define ACIC 2
362#define ACIE 3
363#define ACI 4
364#define ACO 5
365#define ACBG 6
366#define ACD 7
367
368#define OCDR _SFR_IO8(0x31)
369#define OCDR0 0
370#define OCDR1 1
371#define OCDR2 2
372#define OCDR3 3
373#define OCDR4 4
374#define OCDR5 5
375#define OCDR6 6
376#define OCDR7 7
377
378#define PLLFRQ _SFR_IO8(0x32)
379#define PDIV0 0
380#define PDIV1 1
381#define PDIV2 2
382#define PDIV3 3
383#define PLLTM0 4
384#define PLLTM1 5
385#define PLLUSB 6
386#define PINMUX 7
387
388#define SMCR _SFR_IO8(0x33)
389#define SE 0
390#define SM0 1
391#define SM1 2
392#define SM2 3
393
394#define MCUSR _SFR_IO8(0x34)
395#define PORF 0
396#define EXTRF 1
397#define BORF 2
398#define WDRF 3
399#define JTRF 4
400
401#define MCUCR _SFR_IO8(0x35)
402#define IVCE 0
403#define IVSEL 1
404#define PUD 4
405#define JTD 7
406
407#define SPMCSR _SFR_IO8(0x37)
408#define SPMEN 0
409#define PGERS 1
410#define PGWRT 2
411#define BLBSET 3
412#define RWWSRE 4
413#define SIGRD 5
414#define RWWSB 6
415#define SPMIE 7
416
417#define RAMPZ _SFR_IO8(0x3B)
418#define RAMPZ0 0
419
420#define EIND _SFR_IO8(0x3C)
421#define EIND0 0
422
423#define WDTCSR _SFR_MEM8(0x60)
424#define WDP0 0
425#define WDP1 1
426#define WDP2 2
427#define WDE 3
428#define WDCE 4
429#define WDP3 5
430#define WDIE 6
431#define WDIF 7
432
433#define CLKPR _SFR_MEM8(0x61)
434#define CLKPS0 0
435#define CLKPS1 1
436#define CLKPS2 2
437#define CLKPS3 3
438#define CLKPCE 7
439
440#define PRR0 _SFR_MEM8(0x64)
441#define PRADC 0
442#define PRUSART0 1
443#define PRSPI 2
444#define PRTIM1 3
445#define PRTIM0 5
446#define PRTIM2 6
447#define PRTWI 7
448
449#define PRR1 _SFR_MEM8(0x65)
450#define PRUSART1 0
451#define PRTIM3 3
452#define PRUSB 7
453
454#define OSCCAL _SFR_MEM8(0x66)
455#define CAL0 0
456#define CAL1 1
457#define CAL2 2
458#define CAL3 3
459#define CAL4 4
460#define CAL5 5
461#define CAL6 6
462#define CAL7 7
463
464#define RCCTRL _SFR_MEM8(0x67)
465#define RCFREQ 0
466
467#define PCICR _SFR_MEM8(0x68)
468#define PCIE0 0
469
470#define EICRA _SFR_MEM8(0x69)
471#define ISC00 0
472#define ISC01 1
473#define ISC10 2
474#define ISC11 3
475#define ISC20 4
476#define ISC21 5
477#define ISC30 6
478#define ISC31 7
479
480#define EICRB _SFR_MEM8(0x6A)
481#define ISC40 0
482#define ISC41 1
483#define ISC50 2
484#define ISC51 3
485#define ISC60 4
486#define ISC61 5
487#define ISC70 6
488#define ISC71 7
489
490#define PCMSK0 _SFR_MEM8(0x6B)
491#define PCINT0 0
492#define PCINT1 1
493#define PCINT2 2
494#define PCINT3 3
495#define PCINT4 4
496#define PCINT5 5
497#define PCINT6 6
498#define PCINT7 7
499
500#define TIMSK0 _SFR_MEM8(0x6E)
501#define TOIE0 0
502#define OCIE0A 1
503#define OCIE0B 2
504
505#define TIMSK1 _SFR_MEM8(0x6F)
506#define TOIE1 0
507#define OCIE1A 1
508#define OCIE1B 2
509#define OCIE1C 3
510#define ICIE1 5
511
512#define TIMSK3 _SFR_MEM8(0x71)
513#define TOIE3 0
514#define OCIE3A 1
515#define OCIE3B 2
516#define OCIE3C 3
517#define ICIE3 5
518
519#define TIMSK4 _SFR_MEM8(0x72)
520#define TOIE4 2
521#define OCIE4B 5
522#define OCIE4A 6
523#define OCIE4D 7
524
525#ifndef __ASSEMBLER__
526#define ADC _SFR_MEM16(0x78)
527#endif
528#define ADCW _SFR_MEM16(0x78)
529
530#define ADCL _SFR_MEM8(0x78)
531#define ADCL0 0
532#define ADCL1 1
533#define ADCL2 2
534#define ADCL3 3
535#define ADCL4 4
536#define ADCL5 5
537#define ADCL6 6
538#define ADCL7 7
539
540#define ADCH _SFR_MEM8(0x79)
541#define ADCH0 0
542#define ADCH1 1
543#define ADCH2 2
544#define ADCH3 3
545#define ADCH4 4
546#define ADCH5 5
547#define ADCH6 6
548#define ADCH7 7
549
550#define ADCSRA _SFR_MEM8(0x7A)
551#define ADPS0 0
552#define ADPS1 1
553#define ADPS2 2
554#define ADIE 3
555#define ADIF 4
556#define ADATE 5
557#define ADSC 6
558#define ADEN 7
559
560#define ADCSRB _SFR_MEM8(0x7B)
561#define ADTS0 0
562#define ADTS1 1
563#define ADTS2 2
564#define ADTS3 4
565#define MUX5 5
566#define ACME 6
567#define ADHSM 7
568
569#define ADMUX _SFR_MEM8(0x7C)
570#define MUX0 0
571#define MUX1 1
572#define MUX2 2
573#define MUX3 3
574#define MUX4 4
575#define ADLAR 5
576#define REFS0 6
577#define REFS1 7
578
579#define DIDR2 _SFR_MEM8(0x7D)
580#define ADC8D 0
581#define ADC9D 1
582#define ADC10D 2
583#define ADC11D 3
584#define ADC12D 4
585#define ADC13D 5
586
587#define DIDR0 _SFR_MEM8(0x7E)
588#define ADC0D 0
589#define ADC1D 1
590#define ADC2D 2
591#define ADC3D 3
592#define ADC4D 4
593#define ADC5D 5
594#define ADC6D 6
595#define ADC7D 7
596
597#define DIDR1 _SFR_MEM8(0x7F)
598#define AIN0D 0
599#define AIN1D 1
600
601#define TCCR1A _SFR_MEM8(0x80)
602#define WGM10 0
603#define WGM11 1
604#define COM1C0 2
605#define COM1C1 3
606#define COM1B0 4
607#define COM1B1 5
608#define COM1A0 6
609#define COM1A1 7
610
611#define TCCR1B _SFR_MEM8(0x81)
612#define CS10 0
613#define CS11 1
614#define CS12 2
615#define WGM12 3
616#define WGM13 4
617#define ICES1 6
618#define ICNC1 7
619
620#define TCCR1C _SFR_MEM8(0x82)
621#define FOC1C 5
622#define FOC1B 6
623#define FOC1A 7
624
625#define TCNT1 _SFR_MEM16(0x84)
626
627#define TCNT1L _SFR_MEM8(0x84)
628#define TCNT1L0 0
629#define TCNT1L1 1
630#define TCNT1L2 2
631#define TCNT1L3 3
632#define TCNT1L4 4
633#define TCNT1L5 5
634#define TCNT1L6 6
635#define TCNT1L7 7
636
637#define TCNT1H _SFR_MEM8(0x85)
638#define TCNT1H0 0
639#define TCNT1H1 1
640#define TCNT1H2 2
641#define TCNT1H3 3
642#define TCNT1H4 4
643#define TCNT1H5 5
644#define TCNT1H6 6
645#define TCNT1H7 7
646
647#define ICR1 _SFR_MEM16(0x86)
648
649#define ICR1L _SFR_MEM8(0x86)
650#define ICR1L0 0
651#define ICR1L1 1
652#define ICR1L2 2
653#define ICR1L3 3
654#define ICR1L4 4
655#define ICR1L5 5
656#define ICR1L6 6
657#define ICR1L7 7
658
659#define ICR1H _SFR_MEM8(0x87)
660#define ICR1H0 0
661#define ICR1H1 1
662#define ICR1H2 2
663#define ICR1H3 3
664#define ICR1H4 4
665#define ICR1H5 5
666#define ICR1H6 6
667#define ICR1H7 7
668
669#define OCR1A _SFR_MEM16(0x88)
670
671#define OCR1AL _SFR_MEM8(0x88)
672#define OCR1AL0 0
673#define OCR1AL1 1
674#define OCR1AL2 2
675#define OCR1AL3 3
676#define OCR1AL4 4
677#define OCR1AL5 5
678#define OCR1AL6 6
679#define OCR1AL7 7
680
681#define OCR1AH _SFR_MEM8(0x89)
682#define OCR1AH0 0
683#define OCR1AH1 1
684#define OCR1AH2 2
685#define OCR1AH3 3
686#define OCR1AH4 4
687#define OCR1AH5 5
688#define OCR1AH6 6
689#define OCR1AH7 7
690
691#define OCR1B _SFR_MEM16(0x8A)
692
693#define OCR1BL _SFR_MEM8(0x8A)
694#define OCR1BL0 0
695#define OCR1BL1 1
696#define OCR1BL2 2
697#define OCR1BL3 3
698#define OCR1BL4 4
699#define OCR1BL5 5
700#define OCR1BL6 6
701#define OCR1BL7 7
702
703#define OCR1BH _SFR_MEM8(0x8B)
704#define OCR1BH0 0
705#define OCR1BH1 1
706#define OCR1BH2 2
707#define OCR1BH3 3
708#define OCR1BH4 4
709#define OCR1BH5 5
710#define OCR1BH6 6
711#define OCR1BH7 7
712
713#define OCR1C _SFR_MEM16(0x8C)
714
715#define OCR1CL _SFR_MEM8(0x8C)
716#define OCR1CL0 0
717#define OCR1CL1 1
718#define OCR1CL2 2
719#define OCR1CL3 3
720#define OCR1CL4 4
721#define OCR1CL5 5
722#define OCR1CL6 6
723#define OCR1CL7 7
724
725#define OCR1CH _SFR_MEM8(0x8D)
726#define OCR1CH0 0
727#define OCR1CH1 1
728#define OCR1CH2 2
729#define OCR1CH3 3
730#define OCR1CH4 4
731#define OCR1CH5 5
732#define OCR1CH6 6
733#define OCR1CH7 7
734
735#define TCCR3A _SFR_MEM8(0x90)
736#define WGM30 0
737#define WGM31 1
738#define COM3C0 2
739#define COM3C1 3
740#define COM3B0 4
741#define COM3B1 5
742#define COM3A0 6
743#define COM3A1 7
744
745#define TCCR3B _SFR_MEM8(0x91)
746#define CS30 0
747#define CS31 1
748#define CS32 2
749#define WGM32 3
750#define WGM33 4
751#define ICES3 6
752#define ICNC3 7
753
754#define TCCR3C _SFR_MEM8(0x92)
755#define FOC3C 5
756#define FOC3B 6
757#define FOC3A 7
758
759#define TCNT3 _SFR_MEM16(0x94)
760
761#define TCNT3L _SFR_MEM8(0x94)
762#define TCNT3L0 0
763#define TCNT3L1 1
764#define TCNT3L2 2
765#define TCNT3L3 3
766#define TCNT3L4 4
767#define TCNT3L5 5
768#define TCNT3L6 6
769#define TCNT3L7 7
770
771#define TCNT3H _SFR_MEM8(0x95)
772#define TCNT3H0 0
773#define TCNT3H1 1
774#define TCNT3H2 2
775#define TCNT3H3 3
776#define TCNT3H4 4
777#define TCNT3H5 5
778#define TCNT3H6 6
779#define TCNT3H7 7
780
781#define ICR3 _SFR_MEM16(0x96)
782
783#define ICR3L _SFR_MEM8(0x96)
784#define ICR3L0 0
785#define ICR3L1 1
786#define ICR3L2 2
787#define ICR3L3 3
788#define ICR3L4 4
789#define ICR3L5 5
790#define ICR3L6 6
791#define ICR3L7 7
792
793#define ICR3H _SFR_MEM8(0x97)
794#define ICR3H0 0
795#define ICR3H1 1
796#define ICR3H2 2
797#define ICR3H3 3
798#define ICR3H4 4
799#define ICR3H5 5
800#define ICR3H6 6
801#define ICR3H7 7
802
803#define OCR3A _SFR_MEM16(0x98)
804
805#define OCR3AL _SFR_MEM8(0x98)
806#define OCR3AL0 0
807#define OCR3AL1 1
808#define OCR3AL2 2
809#define OCR3AL3 3
810#define OCR3AL4 4
811#define OCR3AL5 5
812#define OCR3AL6 6
813#define OCR3AL7 7
814
815#define OCR3AH _SFR_MEM8(0x99)
816#define OCR3AH0 0
817#define OCR3AH1 1
818#define OCR3AH2 2
819#define OCR3AH3 3
820#define OCR3AH4 4
821#define OCR3AH5 5
822#define OCR3AH6 6
823#define OCR3AH7 7
824
825#define OCR3B _SFR_MEM16(0x9A)
826
827#define OCR3BL _SFR_MEM8(0x9A)
828#define OCR3BL0 0
829#define OCR3BL1 1
830#define OCR3BL2 2
831#define OCR3BL3 3
832#define OCR3BL4 4
833#define OCR3BL5 5
834#define OCR3BL6 6
835#define OCR3BL7 7
836
837#define OCR3BH _SFR_MEM8(0x9B)
838#define OCR3BH0 0
839#define OCR3BH1 1
840#define OCR3BH2 2
841#define OCR3BH3 3
842#define OCR3BH4 4
843#define OCR3BH5 5
844#define OCR3BH6 6
845#define OCR3BH7 7
846
847#define OCR3C _SFR_MEM16(0x9C)
848
849#define OCR3CL _SFR_MEM8(0x9C)
850#define OCR3CL0 0
851#define OCR3CL1 1
852#define OCR3CL2 2
853#define OCR3CL3 3
854#define OCR3CL4 4
855#define OCR3CL5 5
856#define OCR3CL6 6
857#define OCR3CL7 7
858
859#define OCR3CH _SFR_MEM8(0x9D)
860#define OCR3CH0 0
861#define OCR3CH1 1
862#define OCR3CH2 2
863#define OCR3CH3 3
864#define OCR3CH4 4
865#define OCR3CH5 5
866#define OCR3CH6 6
867#define OCR3CH7 7
868
869#define TCNT4 _SFR_MEM8(0xBE)
870#define TC40 0
871#define TC41 1
872#define TC42 2
873#define TC43 3
874#define TC44 4
875#define TC45 5
876#define TC46 6
877#define TC47 7
878
879#define TC4H _SFR_MEM8(0xBF)
880#define TC48 0
881#define TC49 1
882#define TC410 2
883
884#define TCCR4A _SFR_MEM8(0xC0)
885#define PWM4B 0
886#define PWM4A 1
887#define FOC4B 2
888#define FOC4A 3
889#define COM4B0 4
890#define COM4B1 5
891#define COM4A0 6
892#define COM4A1 7
893
894#define TCCR4B _SFR_MEM8(0xC1)
895#define CS40 0
896#define CS41 1
897#define CS42 2
898#define CS43 3
899#define DTPS40 4
900#define DTPS41 5
901#define PSR4 6
902#define PWM4X 7
903
904#define TCCR4C _SFR_MEM8(0xC2)
905#define PWM4D 0
906#define FOC4D 1
907#define COM4D0 2
908#define COM4D1 3
909#define COM4B0S 4
910#define COM4B1S 5
911#define COM4A0S 6
912#define COM4A1S 7
913
914#define TCCR4D _SFR_MEM8(0xC3)
915#define WGM40 0
916#define WGM41 1
917#define FPF4 2
918#define FPAC4 3
919#define FPES4 4
920#define FPNC4 5
921#define FPEN4 6
922#define FPIE4 7
923
924#define TCCR4E _SFR_MEM8(0xC4)
925#define OC4OE0 0
926#define OC4OE1 1
927#define OC4OE2 2
928#define OC4OE3 3
929#define OC4OE4 4
930#define OC4OE5 5
931#define ENHC4 6
932#define TLOCK4 7
933
934#define CLKSEL0 _SFR_MEM8(0xC5)
935#define CLKS 0
936#define EXTE 2
937#define RCE 3
938#define EXSUT0 4
939#define EXSUT1 5
940#define RCSUT0 6
941#define RCSUT1 7
942
943#define CLKSEL1 _SFR_MEM8(0xC6)
944#define EXCKSEL0 0
945#define EXCKSEL1 1
946#define EXCKSEL2 2
947#define EXCKSEL3 3
948#define RCCKSEL0 4
949#define RCCKSEL1 5
950#define RCCKSEL2 6
951#define RCCKSEL3 7
952
953#define CLKSTA _SFR_MEM8(0xC7)
954#define EXTON 0
955#define RCON 1
956
957#define UCSR1A _SFR_MEM8(0xC8)
958#define MPCM1 0
959#define U2X1 1
960#define UPE1 2
961#define DOR1 3
962#define FE1 4
963#define UDRE1 5
964#define TXC1 6
965#define RXC1 7
966
967#define UCSR1B _SFR_MEM8(0xC9)
968#define TXB81 0
969#define RXB81 1
970#define UCSZ12 2
971#define TXEN1 3
972#define RXEN1 4
973#define UDRIE1 5
974#define TXCIE1 6
975#define RXCIE1 7
976
977#define UCSR1C _SFR_MEM8(0xCA)
978#define UCPOL1 0
979#define UCSZ10 1
980#define UCSZ11 2
981#define USBS1 3
982#define UPM10 4
983#define UPM11 5
984#define UMSEL10 6
985#define UMSEL11 7
986
987#define UBRR1 _SFR_MEM16(0xCC)
988
989#define UBRR1L _SFR_MEM8(0xCC)
990
991#define UBRR1H _SFR_MEM8(0xCD)
992
993#define UDR1 _SFR_MEM8(0xCE)
994#define UDR1_0 0
995#define UDR1_1 1
996#define UDR1_2 2
997#define UDR1_3 3
998#define UDR1_4 4
999#define UDR1_5 5
1000#define UDR1_6 6
1001#define UDR1_7 7
1002
1003#define OCR4A _SFR_MEM8(0xCF)
1004#define OCR4A0 0
1005#define OCR4A1 1
1006#define OCR4A2 2
1007#define OCR4A3 3
1008#define OCR4A4 4
1009#define OCR4A5 5
1010#define OCR4A6 6
1011#define OCR4A7 7
1012
1013#define OCR4B _SFR_MEM8(0xD0)
1014#define OCR4B0 0
1015#define OCR4B1 1
1016#define OCR4B2 2
1017#define OCR4B3 3
1018#define OCR4B4 4
1019#define OCR4B5 5
1020#define OCR4B6 6
1021#define OCR4B7 7
1022
1023#define OCR4C _SFR_MEM8(0xD1)
1024#define OCR4C0 0
1025#define OCR4C1 1
1026#define OCR4C2 2
1027#define OCR4C3 3
1028#define OCR4C4 4
1029#define OCR4C5 5
1030#define OCR4C6 6
1031#define OCR4C7 7
1032
1033#define OCR4D _SFR_MEM8(0xD2)
1034#define OCR4D0 0
1035#define OCR4D1 1
1036#define OCR4D2 2
1037#define OCR4D3 3
1038#define OCR4D4 4
1039#define OCR4D5 5
1040#define OCR4D6 6
1041#define OCR4D7 7
1042
1043#define DT4 _SFR_MEM8(0xD4)
1044#define DT4L0 0
1045#define DT4L1 1
1046#define DT4L2 2
1047#define DT4L3 3
1048#define DT4L4 4
1049#define DT4L5 5
1050#define DT4L6 6
1051#define DT4L7 7
1052
1053#define UHWCON _SFR_MEM8(0xD7)
1054#define UVREGE 0
1055
1056#define USBCON _SFR_MEM8(0xD8)
1057#define VBUSTE 0
1058#define OTGPADE 4
1059#define FRZCLK 5
1060#define USBE 7
1061
1062#define USBSTA _SFR_MEM8(0xD9)
1063#define VBUS 0
1064#define SPEED 3
1065
1066#define USBINT _SFR_MEM8(0xDA)
1067#define VBUSTI 0
1068
1069#define UDCON _SFR_MEM8(0xE0)
1070#define DETACH 0
1071#define RMWKUP 1
1072#define LSM 2
1073#define RSTCPU 3
1074
1075#define UDINT _SFR_MEM8(0xE1)
1076#define SUSPI 0
1077#define SOFI 2
1078#define EORSTI 3
1079#define WAKEUPI 4
1080#define EORSMI 5
1081#define UPRSMI 6
1082
1083#define UDIEN _SFR_MEM8(0xE2)
1084#define SUSPE 0
1085#define SOFE 2
1086#define EORSTE 3
1087#define WAKEUPE 4
1088#define EORSME 5
1089#define UPRSME 6
1090
1091#define UDADDR _SFR_MEM8(0xE3)
1092#define UADD0 0
1093#define UADD1 1
1094#define UADD2 2
1095#define UADD3 3
1096#define UADD4 4
1097#define UADD5 5
1098#define UADD6 6
1099#define ADDEN 7
1100
1101#define UDFNUM _SFR_MEM16(0xE4)
1102
1103#define UDFNUML _SFR_MEM8(0xE4)
1104#define FNUM0 0
1105#define FNUM1 1
1106#define FNUM2 2
1107#define FNUM3 3
1108#define FNUM4 4
1109#define FNUM5 5
1110#define FNUM6 6
1111#define FNUM7 7
1112
1113#define UDFNUMH _SFR_MEM8(0xE5)
1114#define FNUM8 0
1115#define FNUM9 1
1116#define FNUM10 2
1117
1118#define UDMFN _SFR_MEM8(0xE6)
1119#define FNCERR 4
1120
1121#define UEINTX _SFR_MEM8(0xE8)
1122#define TXINI 0
1123#define STALLEDI 1
1124#define RXOUTI 2
1125#define RXSTPI 3
1126#define NAKOUTI 4
1127#define RWAL 5
1128#define NAKINI 6
1129#define FIFOCON 7
1130
1131#define UENUM _SFR_MEM8(0xE9)
1132#define UENUM_0 0
1133#define UENUM_1 1
1134#define UENUM_2 2
1135
1136#define UERST _SFR_MEM8(0xEA)
1137#define EPRST0 0
1138#define EPRST1 1
1139#define EPRST2 2
1140#define EPRST3 3
1141#define EPRST4 4
1142#define EPRST5 5
1143#define EPRST6 6
1144
1145#define UECONX _SFR_MEM8(0xEB)
1146#define EPEN 0
1147#define RSTDT 3
1148#define STALLRQC 4
1149#define STALLRQ 5
1150
1151#define UECFG0X _SFR_MEM8(0xEC)
1152#define EPDIR 0
1153#define EPTYPE0 6
1154#define EPTYPE1 7
1155
1156#define UECFG1X _SFR_MEM8(0xED)
1157#define ALLOC 1
1158#define EPBK0 2
1159#define EPBK1 3
1160#define EPSIZE0 4
1161#define EPSIZE1 5
1162#define EPSIZE2 6
1163
1164#define UESTA0X _SFR_MEM8(0xEE)
1165#define NBUSYBK0 0
1166#define NBUSYBK1 1
1167#define DTSEQ0 2
1168#define DTSEQ1 3
1169#define UNDERFI 5
1170#define OVERFI 6
1171#define CFGOK 7
1172
1173#define UESTA1X _SFR_MEM8(0xEF)
1174#define CURRBK0 0
1175#define CURRBK1 1
1176#define CTRLDIR 2
1177
1178#define UEIENX _SFR_MEM8(0xF0)
1179#define TXINE 0
1180#define STALLEDE 1
1181#define RXOUTE 2
1182#define RXSTPE 3
1183#define NAKOUTE 4
1184#define NAKINE 6
1185#define FLERRE 7
1186
1187#define UEDATX _SFR_MEM8(0xF1)
1188#define DAT0 0
1189#define DAT1 1
1190#define DAT2 2
1191#define DAT3 3
1192#define DAT4 4
1193#define DAT5 5
1194#define DAT6 6
1195#define DAT7 7
1196
1197#define UEBCLX _SFR_MEM8(0xF2)
1198#define BYCT0 0
1199#define BYCT1 1
1200#define BYCT2 2
1201#define BYCT3 3
1202#define BYCT4 4
1203#define BYCT5 5
1204#define BYCT6 6
1205#define BYCT7 7
1206
1207#define UEBCHX _SFR_MEM8(0xF3)
1208
1209#define UEINT _SFR_MEM8(0xF4)
1210#define EPINT0 0
1211#define EPINT1 1
1212#define EPINT2 2
1213#define EPINT3 3
1214#define EPINT4 4
1215#define EPINT5 5
1216#define EPINT6 6
1217
1218
1219/* Interrupt vectors */
1220/* Vector 0 is the reset vector */
1221#define INT0_vect_num  1
1222#define INT0_vect      _VECTOR(1)  /* External Interrupt Request 0 */
1223#define INT1_vect_num  2
1224#define INT1_vect      _VECTOR(2)  /* External Interrupt Request 1 */
1225#define INT2_vect_num  3
1226#define INT2_vect      _VECTOR(3)  /* External Interrupt Request 2 */
1227#define INT3_vect_num  4
1228#define INT3_vect      _VECTOR(4)  /* External Interrupt Request 3 */
1229#define INT6_vect_num  7
1230#define INT6_vect      _VECTOR(7)  /* External Interrupt Request 6 */
1231#define PCINT0_vect_num  9
1232#define PCINT0_vect      _VECTOR(9)  /* Pin Change Interrupt Request 0 */
1233#define USB_GEN_vect_num  10
1234#define USB_GEN_vect      _VECTOR(10)  /* USB General Interrupt Request */
1235#define USB_COM_vect_num  11
1236#define USB_COM_vect      _VECTOR(11)  /* USB Endpoint/Pipe Interrupt Communication Request */
1237#define WDT_vect_num  12
1238#define WDT_vect      _VECTOR(12)  /* Watchdog Time-out Interrupt */
1239#define TIMER1_CAPT_vect_num  16
1240#define TIMER1_CAPT_vect      _VECTOR(16)  /* Timer/Counter1 Capture Event */
1241#define TIMER1_COMPA_vect_num  17
1242#define TIMER1_COMPA_vect      _VECTOR(17)  /* Timer/Counter1 Compare Match A */
1243#define TIMER1_COMPB_vect_num  18
1244#define TIMER1_COMPB_vect      _VECTOR(18)  /* Timer/Counter1 Compare Match B */
1245#define TIMER1_COMPC_vect_num  19
1246#define TIMER1_COMPC_vect      _VECTOR(19)  /* Timer/Counter1 Compare Match C */
1247#define TIMER1_OVF_vect_num  20
1248#define TIMER1_OVF_vect      _VECTOR(20)  /* Timer/Counter1 Overflow */
1249#define TIMER0_COMPA_vect_num  21
1250#define TIMER0_COMPA_vect      _VECTOR(21)  /* Timer/Counter0 Compare Match A */
1251#define TIMER0_COMPB_vect_num  22
1252#define TIMER0_COMPB_vect      _VECTOR(22)  /* Timer/Counter0 Compare Match B */
1253#define TIMER0_OVF_vect_num  23
1254#define TIMER0_OVF_vect      _VECTOR(23)  /* Timer/Counter0 Overflow */
1255#define SPI_STC_vect_num  24
1256#define SPI_STC_vect      _VECTOR(24)  /* SPI Serial Transfer Complete */
1257#define USART1_RX_vect_num  25
1258#define USART1_RX_vect      _VECTOR(25)  /* USART1, Rx Complete */
1259#define USART1_UDRE_vect_num  26
1260#define USART1_UDRE_vect      _VECTOR(26)  /* USART1 Data register Empty */
1261#define USART1_TX_vect_num  27
1262#define USART1_TX_vect      _VECTOR(27)  /* USART1, Tx Complete */
1263#define ANALOG_COMP_vect_num  28
1264#define ANALOG_COMP_vect      _VECTOR(28)  /* Analog Comparator */
1265#define ADC_vect_num  29
1266#define ADC_vect      _VECTOR(29)  /* ADC Conversion Complete */
1267#define EE_READY_vect_num  30
1268#define EE_READY_vect      _VECTOR(30)  /* EEPROM Ready */
1269#define TIMER3_CAPT_vect_num  31
1270#define TIMER3_CAPT_vect      _VECTOR(31)  /* Timer/Counter3 Capture Event */
1271#define TIMER3_COMPA_vect_num  32
1272#define TIMER3_COMPA_vect      _VECTOR(32)  /* Timer/Counter3 Compare Match A */
1273#define TIMER3_COMPB_vect_num  33
1274#define TIMER3_COMPB_vect      _VECTOR(33)  /* Timer/Counter3 Compare Match B */
1275#define TIMER3_COMPC_vect_num  34
1276#define TIMER3_COMPC_vect      _VECTOR(34)  /* Timer/Counter3 Compare Match C */
1277#define TIMER3_OVF_vect_num  35
1278#define TIMER3_OVF_vect      _VECTOR(35)  /* Timer/Counter3 Overflow */
1279#define TWI_vect_num  36
1280#define TWI_vect      _VECTOR(36)  /* 2-wire Serial Interface         */
1281#define SPM_READY_vect_num  37
1282#define SPM_READY_vect      _VECTOR(37)  /* Store Program Memory Read */
1283#define TIMER4_COMPA_vect_num  38
1284#define TIMER4_COMPA_vect      _VECTOR(38)  /* Timer/Counter4 Compare Match A */
1285#define TIMER4_COMPB_vect_num  39
1286#define TIMER4_COMPB_vect      _VECTOR(39)  /* Timer/Counter4 Compare Match B */
1287#define TIMER4_COMPD_vect_num  40
1288#define TIMER4_COMPD_vect      _VECTOR(40)  /* Timer/Counter4 Compare Match D */
1289#define TIMER4_OVF_vect_num  41
1290#define TIMER4_OVF_vect      _VECTOR(41)  /* Timer/Counter4 Overflow */
1291#define TIMER4_FPF_vect_num  42
1292#define TIMER4_FPF_vect      _VECTOR(42)  /* Timer/Counter4 Fault Protection Interrupt */
1293
1294#define _VECTOR_SIZE 4 /* Size of individual vector. */
1295#define _VECTORS_SIZE (43 * _VECTOR_SIZE)
1296
1297
1298/* Constants */
1299#define SPM_PAGESIZE (128)
1300#define RAMSTART     (0x100)
1301#define RAMSIZE      (1280)
1302#define RAMEND       (RAMSTART + RAMSIZE - 1)
1303#define XRAMSTART    (NA)
1304#define XRAMSIZE     (0)
1305#define XRAMEND      (RAMEND)
1306#define E2END        (0x1FF)
1307#define E2PAGESIZE   (4)
1308#define FLASHEND     (0x3FFF)
1309
1310
1311/* Fuses */
1312#define FUSE_MEMORY_SIZE 3
1313
1314/* Low Fuse Byte */
1315#define FUSE_CKSEL0  (unsigned char)~_BV(0)  /* Select Clock Source */
1316#define FUSE_CKSEL1  (unsigned char)~_BV(1)  /* Select Clock Source */
1317#define FUSE_CKSEL2  (unsigned char)~_BV(2)  /* Select Clock Source */
1318#define FUSE_CKSEL3  (unsigned char)~_BV(3)  /* Select Clock Source */
1319#define FUSE_SUT0  (unsigned char)~_BV(4)  /* Select start-up time */
1320#define FUSE_SUT1  (unsigned char)~_BV(5)  /* Select start-up time */
1321#define FUSE_CKOUT  (unsigned char)~_BV(6)  /* Oscillator options */
1322#define FUSE_CKDIV8  (unsigned char)~_BV(7)  /* Divide clock by 8 */
1323#define LFUSE_DEFAULT (FUSE_CKDIV8 & FUSE_SUT1 & FUSE_SUT0 & FUSE_CKSEL3 & FUSE_CKSEL2 & FUSE_CKSEL1)
1324
1325/* High Fuse Byte */
1326#define FUSE_BOOTRST  (unsigned char)~_BV(0)  /* Select Reset Vector */
1327#define FUSE_BOOTSZ0  (unsigned char)~_BV(1)  /* Select Boot Size */
1328#define FUSE_BOOTSZ1  (unsigned char)~_BV(2)  /* Select Boot Size */
1329#define FUSE_EESAVE  (unsigned char)~_BV(3)  /* EEPROM memory is preserved through chip erase */
1330#define FUSE_WDTON  (unsigned char)~_BV(4)  /* Watchdog timer always on */
1331#define FUSE_SPIEN  (unsigned char)~_BV(5)  /* Enable Serial programming and Data Downloading */
1332#define FUSE_JTAGEN  (unsigned char)~_BV(6)  /* Enable JTAG */
1333#define FUSE_OCDEN  (unsigned char)~_BV(7)  /* Enable OCD */
1334#define HFUSE_DEFAULT (FUSE_JTAGEN & FUSE_SPIEN & FUSE_BOOTSZ1 & FUSE_BOOTSZ0)
1335
1336/* Extended Fuse Byte */
1337#define FUSE_BODLEVEL0  (unsigned char)~_BV(0)  /* Brown-out Detector trigger level */
1338#define FUSE_BODLEVEL1  (unsigned char)~_BV(1)  /* Brown-out Detector trigger level */
1339#define FUSE_BODLEVEL2  (unsigned char)~_BV(2)  /* Brown-out Detector trigger level */
1340#define FUSE_HWBE  (unsigned char)~_BV(3)  /* Hardware Boot Enable */
1341#define EFUSE_DEFAULT (0xFF)
1342
1343
1344/* Lock Bits */
1345#define __LOCK_BITS_EXIST
1346#define __BOOT_LOCK_BITS_0_EXIST
1347#define __BOOT_LOCK_BITS_1_EXIST
1348
1349
1350/* Signature */
1351#define SIGNATURE_0 0x1E
1352#define SIGNATURE_1 0x94
1353#define SIGNATURE_2 0x88
1354
1355
1356#endif /* _AVR_ATmega16U4_H_ */
1357
Note: See TracBrowser for help on using the repository browser.