source: rtems/cpukit/score/cpu/avr/avr/iotn43u.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: 11.2 KB
Line 
1/* Copyright (c) 2007 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
32/* $Id$ */
33
34/* avr/iotn43u.h - definitions for ATtiny43U */
35
36/* This file should only be included from <avr/io.h>, never directly. */
37
38#ifndef _AVR_IO_H_
39#  error "Include <avr/io.h> instead of this file."
40#endif
41
42#ifndef _AVR_IOXXX_H_
43#  define _AVR_IOXXX_H_ "iotn43u.h"
44#else
45#  error "Attempt to include more than one <avr/ioXXX.h> file."
46#endif
47
48
49#ifndef _AVR_IOTN43U_H_
50#define _AVR_IOTN43U_H_ 1
51
52/* Registers and associated bit numbers */
53
54#define PRR _SFR_IO8(0x00)
55#define PRADC  0
56#define PRUSI  1
57#define PRTIM0 2
58#define PRTIM1 3
59
60#define DIDR0 _SFR_IO8(0x01)
61#define ADC0D  0
62#define ADC1D  1
63#define ADC2D  2
64#define ADC3D  3
65#define AIN0D  4
66#define AIN1D  5
67
68/* Reserved [0x02] */
69
70#define ADCSRB _SFR_IO8(0x03)
71#define ADTS0  0
72#define ADTS1  1
73#define ADTS2  2
74#define ADLAR  4
75#define ACME   6
76
77#define ADC _SFR_IO16(0x04)
78
79#define ADCL _SFR_IO8(0x04)
80#define ADCL0  0
81#define ADCL1  1
82#define ADCL2  2
83#define ADCL3  3
84#define ADCL4  4
85#define ADCL5  5
86#define ADCL6  6
87#define ADCL7  7
88
89#define ADCH _SFR_IO8(0x05)
90#define ADCH0  0
91#define ADCH1  1
92#define ADCH2  2
93#define ADCH3  3
94#define ADCH4  4
95#define ADCH5  5
96#define ADCH6  6
97#define ADCH7  7
98
99#define ADCSRA _SFR_IO8(0x06)
100#define ADPS0  0
101#define ADPS1  1
102#define ADPS2  2
103#define ADIE   3
104#define ADIF   4
105#define ADATE  5
106#define ADSC   6
107#define ADEN   7
108
109#define ADMUX _SFR_IO8(0x07)
110#define MUX0   0
111#define MUX1   1
112#define MUX2   2
113#define REFS0  6
114
115#define ACSR _SFR_IO8(0x08)
116#define ACIS0  0
117#define ACIS1  1
118#define ACIE   3
119#define ACI    4
120#define ACO    5
121#define ACBG   6
122#define ACD    7
123
124/* Reserved [0x09], [0x0A] */
125
126#define TIFR1 _SFR_IO8(0x0B)
127#define TOV1   0
128#define OCF1A  1
129#define OCF1B  2
130
131#define TIMSK1 _SFR_IO8(0x0C)
132#define TOIE1  0
133#define OCIE1A 1
134#define OCIE1B 2
135
136#define USICR _SFR_IO8(0x0D)
137#define USITC  0
138#define USICLK 1
139#define USICS0 2
140#define USICS1 3
141#define USIWM0 4
142#define USIWM1 5
143#define USIOIE 6
144#define USISIE 7
145
146#define USISR _SFR_IO8(0x0E)
147#define USICNT0 0
148#define USICNT1 1
149#define USICNT2 2
150#define USICNT3 3
151#define USIDC   4
152#define USIPF   5
153#define USIOIF  6
154#define USISIF  7
155
156#define USIDR _SFR_IO8(0x0F)
157#define USIDR0 0
158#define USIDR1 1
159#define USIDR2 2
160#define USIDR3 3
161#define USIDR4 4
162#define USIDR5 5
163#define USIDR6 6
164#define USIDR7 7
165
166#define USIBR _SFR_IO8(0x10)
167#define USIBR0 0
168#define USIBR1 1
169#define USIBR2 2
170#define USIBR3 3
171#define USIBR4 4
172#define USIBR5 5
173#define USIBR6 6
174#define USIBR7 7
175
176/* Reserved [0x11] */
177
178#define PCMSK0 _SFR_IO8(0x12)
179#define PCINT0 0
180#define PCINT1 1
181#define PCINT2 2
182#define PCINT3 3
183#define PCINT4 4
184#define PCINT5 5
185#define PCINT6 6
186#define PCINT7 7
187
188#define GPIOR0 _SFR_IO8(0x13)
189#define GPIOR00 0
190#define GPIOR01 1
191#define GPIOR02 2
192#define GPIOR03 3
193#define GPIOR04 4
194#define GPIOR05 5
195#define GPIOR06 6
196#define GPIOR07 7
197
198#define GPIOR1 _SFR_IO8(0x14)
199#define GPIOR10 0
200#define GPIOR11 1
201#define GPIOR12 2
202#define GPIOR13 3
203#define GPIOR14 4
204#define GPIOR15 5
205#define GPIOR16 6
206#define GPIOR17 7
207
208#define GPIOR2 _SFR_IO8(0x15)
209#define GPIOR20 0
210#define GPIOR21 1
211#define GPIOR22 2
212#define GPIOR23 3
213#define GPIOR24 4
214#define GPIOR25 5
215#define GPIOR26 6
216#define GPIOR27 7
217
218#define PINB _SFR_IO8(0x16)
219#define PINB0 0
220#define PINB1 1
221#define PINB2 2
222#define PINB3 3
223#define PINB4 4
224#define PINB5 5
225#define PINB6 6
226#define PINB7 7
227
228#define DDRB _SFR_IO8(0x17)
229#define DDB0  0
230#define DDB1  1
231#define DDB2  2
232#define DDB3  3
233#define DDB4  4
234#define DDB5  5
235#define DDB6  6
236#define DDB7  7
237
238#define PORTB _SFR_IO8(0x18)
239#define PORTB0 0
240#define PORTB1 1
241#define PORTB2 2
242#define PORTB3 3
243#define PORTB4 4
244#define PORTB5 5
245#define PORTB6 6
246#define PORTB7 7
247
248#define PINA _SFR_IO8(0x19)
249#define PINA0 0
250#define PINA1 1
251#define PINA2 2
252#define PINA3 3
253#define PINA4 4
254#define PINA5 5
255#define PINA6 6
256#define PINA7 7
257
258#define DDRA _SFR_IO8(0x1A)
259#define DDA0 0
260#define DDA1 1
261#define DDA2 2
262#define DDA3 3
263#define DDA4 4
264#define DDA5 5
265#define DDA6 6
266#define DDA7 7
267
268#define PORTA _SFR_IO8(0x1B)
269#define PORTA0 0
270#define PORTA1 1
271#define PORTA2 2
272#define PORTA3 3
273#define PORTA4 4
274#define PORTA5 5
275#define PORTA6 6
276#define PORTA7 7
277
278/* EEPROM Control Register */
279#define EECR    _SFR_IO8(0x1C)
280#define EERE    0
281#define EEPE    1
282#define EEMPE   2
283#define EERIE   3
284#define EEPM0   4
285#define EEPM1   5
286
287/* EEPROM Data Register */
288#define EEDR    _SFR_IO8(0x1D)
289
290/* EEPROM Address Register */
291#define EEARL   _SFR_IO8(0x1E)
292
293/* Reserved [0x1F] */
294
295#define PCMSK1 _SFR_IO8(0x20)
296#define PCINT8  0
297#define PCINT9  1
298#define PCINT10 2
299#define PCINT11 3
300
301#define WDTCSR _SFR_IO8(0x21)
302#define WDP0 0
303#define WDP1 1
304#define WDP2 2
305#define WDE  3
306#define WDCE 4
307#define WDP3 5
308#define WDIE 6
309#define WDIF 7
310
311/* Reserved [0x22] */
312
313#define GTCCR _SFR_IO8(0x23)
314#define PSR10 0
315#define TSM   7
316
317/* Reserved [0x24], [0x25] */
318
319#define CLKPR _SFR_IO8(0x26)
320#define CLKPS0 0
321#define CLKPS1 1
322#define CLKPS2 2
323#define CLKPS3 3
324#define CLKPCE 7
325
326/* Reserved [0x27],[0x28],[0x29],[0x2A] */
327
328#define OCR1B _SFR_IO8(0x2B)
329#define OCR1B_0 0
330#define OCR1B_1 1
331#define OCR1B_2 2
332#define OCR1B_3 3
333#define OCR1B_4 4
334#define OCR1B_5 5
335#define OCR1B_6 6
336#define OCR1B_7 7
337
338#define OCR1A _SFR_IO8(0x2C)
339#define OCR1A_0 0
340#define OCR1A_1 1
341#define OCRA1_2 2
342#define OCRA1_3 3
343#define OCRA1_4 4
344#define OCRA1_5 5
345#define OCRA1_6 6
346#define OCRA1_7 7
347
348#define TCNT1 _SFR_IO8(0x2D)
349#define TCNT1_0 0
350#define TCNT1_1 1
351#define TCNT1_2 2
352#define TCNT1_3 3
353#define TCNT1_4 4
354#define TCNT1_5 5
355#define TCNT1_6 6
356#define TCNT1_7 7
357
358#define TCCR1B _SFR_IO8(0x2E)
359#define CS10  0
360#define CS11  1
361#define CS12  2
362#define WGM12 3
363#define FOC1B 6
364#define FOC1A 7
365
366#define TCCR1A _SFR_IO8(0x2F)
367#define WGM10  0
368#define WGM11  1
369#define COM1B0 4
370#define COM1B1 5
371#define COM1A0 6
372#define COM1A1 7
373
374#define TCCR0A _SFR_IO8(0x30)
375#define WGM00  0
376#define WGM01  1
377#define COM0B0 4
378#define COM0B1 5
379#define COM0A0 6
380#define COM0A1 7
381
382#define OSCCAL _SFR_IO8(0x31)
383#define CAL0 0
384#define CAL1 1
385#define CAL2 2
386#define CAL3 3
387#define CAL4 4
388#define CAL5 5
389#define CAL6 6
390#define CAL7 7
391
392#define TCNT0 _SFR_IO8(0x32)
393#define TCNT0_0 0
394#define TCNT0_1 1
395#define TCNT0_2 2
396#define TCNT0_3 3
397#define TCNT0_4 4
398#define TCNT0_5 5
399#define TCNT0_6 6
400#define TCNT0_7 7
401
402#define TCCR0B _SFR_IO8(0x33)
403#define CS00  0
404#define CS01  1
405#define CS02  2
406#define WGM02 3
407#define FOC0B 6
408#define FOC0A 7
409
410#define MCUSR _SFR_IO8(0x34)
411#define PORF  0
412#define EXTRF 1
413#define BORF  2
414#define WDRF  3
415
416#define MCUCR _SFR_IO8(0x35)
417#define ISC00 0
418#define ISC01 1
419#define BODSE 2
420#define SM0   3
421#define SM1   4
422#define SE    5
423#define PUD   6
424#define BODS  7
425
426#define OCR0A _SFR_IO8(0x36)
427#define OCR0A_0 0
428#define OCR0A_1 1
429#define OCR0A_2 2
430#define OCR0A_3 3
431#define OCR0A_4 4
432#define OCR0A_5 5
433#define OCR0A_6 6
434#define OCR0A_7 7
435
436#define SPMCSR _SFR_IO8(0x37)
437#define SPMEN 0
438#define PGERS 1
439#define PGWRT 2
440#define RFLB  3
441#define CTPB  4
442
443#define TIFR0 _SFR_IO8(0x38)
444#define TOV0  0
445#define OCF0A 1
446#define OCF0B 2
447
448#define TIMSK0 _SFR_IO8(0x39)
449#define TOIE0  0
450#define OCIE0A 1
451#define OCIE0B 2
452
453#define GIFR _SFR_IO8(0x3A)
454#define PCIF0 4
455#define PCIF1 5
456#define INTF0 6
457
458#define GIMSK _SFR_IO8(0x3B)
459#define PCIE0 4
460#define PCIE1 5
461#define INT0  6
462
463#define OCR0B _SFR_IO8(0x3C)
464#define OCR0B_0 0
465#define OCR0B_1 1
466#define OCR0B_2 2
467#define OCR0B_3 3
468#define OCR0B_4 4
469#define OCR0B_5 5
470#define OCR0B_6 6
471#define OCR0B_7 7
472
473
474
475/* Interrupt Vectors */
476/* Interrupt vector 0 is the reset vector. */
477
478/* External Interrupt Request 0 */
479#define INT0_vect           _VECTOR(1)
480
481/* Pin Change Interrupt Request 0 */
482#define PCINT0_vect         _VECTOR(2)
483
484/* Pin Change Interrupt Request 1 */
485#define PCINT1_vect         _VECTOR(3)
486
487/* Watchdog Time-out */
488#define WDT_vect            _VECTOR(4)
489
490/* Timer/Counter1 Compare Match A */
491#define TIM1_COMPA_vect     _VECTOR(5)
492
493/* Timer/Counter1 Compare Match B */
494#define TIM1_COMPB_vect     _VECTOR(6)
495
496/* Timer/Counter1 Overflow */
497#define TIM1_OVF_vect       _VECTOR(7)
498
499/* Timer/Counter0 Compare Match A */
500#define TIM0_COMPA_vect     _VECTOR(8)
501
502/* Timer/Counter0 Compare Match B */
503#define TIM0_COMPB_vect     _VECTOR(9)
504
505/* Timer/Counter0 Overflow */
506#define TIM0_OVF_vect       _VECTOR(10)
507
508/* Analog Comparator */
509#define ANA_COMP_vect       _VECTOR(11)
510
511/* ADC Conversion Complete */
512#define ADC_vect            _VECTOR(12)
513
514/* EEPROM Ready */
515#define EE_RDY_vect         _VECTOR(13)
516
517/* USI START */
518#define USI_START_vect      _VECTOR(14)
519
520/* USI Overflow */
521#define USI_OVF_vect        _VECTOR(15)
522
523#define _VECTORS_SIZE 32
524
525
526/* Constants */
527#define SPM_PAGESIZE   64
528#define RAMEND         0x15F
529#define XRAMEND        RAMEND
530#define E2END          0x3F
531#define E2PAGESIZE     4
532#define FLASHEND       0xFFF
533
534
535/* Fuse Information */
536#define FUSE_MEMORY_SIZE 3
537
538/* Low Fuse Byte */
539#define FUSE_CKSEL0  (unsigned char)~_BV(0)
540#define FUSE_CKSEL1  (unsigned char)~_BV(1)
541#define FUSE_CKSEL2  (unsigned char)~_BV(2)
542#define FUSE_CKSEL3  (unsigned char)~_BV(3)
543#define FUSE_SUT0    (unsigned char)~_BV(4)
544#define FUSE_SUT1    (unsigned char)~_BV(5)
545#define FUSE_CKOUT   (unsigned char)~_BV(6)
546#define FUSE_CKDIV8  (unsigned char)~_BV(7)
547#define LFUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0 & FUSE_CKDIV8)
548
549/* High Fuse Byte */
550#define FUSE_BODLEVEL0   (unsigned char)~_BV(0)
551#define FUSE_BODLEVEL1   (unsigned char)~_BV(1)
552#define FUSE_BODLEVEL2   (unsigned char)~_BV(2)
553#define FUSE_EESAVE      (unsigned char)~_BV(3)
554#define FUSE_WDTON       (unsigned char)~_BV(4)
555#define FUSE_SPIEN       (unsigned char)~_BV(5)
556#define FUSE_DWEN        (unsigned char)~_BV(6)
557#define FUSE_RSTDISBL    (unsigned char)~_BV(7)
558#define HFUSE_DEFAULT (FUSE_SPIEN)   
559
560/* Extended Fuse Byte */
561#define FUSE_SELFPRGEN   (unsigned char)~_BV(0)
562#define EFUSE_DEFAULT (0xFF)
563
564
565/* Lock Bits */
566#define __LOCK_BITS_EXIST
567
568
569/* Signature */
570#define SIGNATURE_0 0x1E
571#define SIGNATURE_1 0x92
572#define SIGNATURE_2 0x0C
573
574
575#endif /* _AVR_IOTN43U_H_ */
Note: See TracBrowser for help on using the repository browser.