source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/tools/avr/avr/include/avr/iotn13a.h @ 46

Last change on this file since 46 was 46, checked in by jrpelegrina, 4 years ago

First release to Xenial

File size: 8.9 KB
Line 
1/* Copyright (c) 2008 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: iotn13a.h 1955 2009-04-28 08:51:16Z arcanum $ */
32
33/* avr/iotn13a.h - definitions for ATtiny13 */
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_ "iotn13a.h"
43#else
44#  error "Attempt to include more than one <avr/ioXXX.h> file."
45#endif
46
47
48#ifndef _AVR_ATTINY13A_H_
49#define _AVR_ATTINY13A_H_ 1
50
51
52/* Registers and associated bit numbers. */
53
54#define ADCSRB _SFR_IO8(0x03)
55#define ADTS0 0
56#define ADTS1 1
57#define ADTS2 2
58#define ACME 6
59
60#ifndef __ASSEMBLER__
61#define ADC _SFR_IO16(0x04)
62#endif
63#define ADCW _SFR_IO16(0x04)
64
65#define ADCL _SFR_IO8(0x04)
66#define ADCL0 0
67#define ADCL1 1
68#define ADCL2 2
69#define ADCL3 3
70#define ADCL4 4
71#define ADCL5 5
72#define ADCL6 6
73#define ADCL7 7
74
75#define ADCH _SFR_IO8(0x05)
76#define ADCH0 0
77#define ADCH1 1
78#define ADCH2 2
79#define ADCH3 3
80#define ADCH4 4
81#define ADCH5 5
82#define ADCH6 6
83#define ADCH7 7
84
85#define ADCSRA _SFR_IO8(0x06)
86#define ADPS0 0
87#define ADPS1 1
88#define ADPS2 2
89#define ADIE 3
90#define ADIF 4
91#define ADATE 5
92#define ADSC 6
93#define ADEN 7
94
95#define ADMUX _SFR_IO8(0x07)
96#define MUX0 0
97#define MUX1 1
98#define ADLAR 5
99#define REFS0 6
100
101#define ACSR _SFR_IO8(0x08)
102#define ACIS0 0
103#define ACIS1 1
104#define ACIE 3
105#define ACI 4
106#define ACO 5
107#define ACBG 6
108#define ACD 7
109
110#define DIDR0 _SFR_IO8(0x14)
111#define AIN0D 0
112#define AIN1D 1
113#define ADC1D 2
114#define ADC3D 3
115#define ADC2D 4
116#define ADC0D 5
117
118#define PCMSK _SFR_IO8(0x15)
119#define PCINT0 0
120#define PCINT1 1
121#define PCINT2 2
122#define PCINT3 3
123#define PCINT4 4
124#define PCINT5 5
125
126#define PINB _SFR_IO8(0x16)
127#define PINB0 0
128#define PINB1 1
129#define PINB2 2
130#define PINB3 3
131#define PINB4 4
132#define PINB5 5
133
134#define DDRB _SFR_IO8(0x17)
135#define DDB0 0
136#define DDB1 1
137#define DDB2 2
138#define DDB3 3
139#define DDB4 4
140#define DDB5 5
141
142#define PORTB _SFR_IO8(0x18)
143#define PORTB0 0
144#define PORTB1 1
145#define PORTB2 2
146#define PORTB3 3
147#define PORTB4 4
148#define PORTB5 5
149
150#define EECR _SFR_IO8(0x1C)
151#define EERE 0
152#define EEWE 1
153#define EEMWE 2
154#define EERIE 3
155#define EEPM0 4
156#define EEPM1 5
157
158#define EEDR _SFR_IO8(0x1D)
159#define EEDR0 0
160#define EEDR1 1
161#define EEDR2 2
162#define EEDR3 3
163#define EEDR4 4
164#define EEDR5 5
165#define EEDR6 6
166#define EEDR7 7
167
168#define EEARL _SFR_IO8(0x1E)
169
170#define EEAR _SFR_IO8(0x1E)
171#define EEAR0 0
172#define EEAR1 1
173#define EEAR2 2
174#define EEAR3 3
175#define EEAR4 4
176#define EEAR5 5
177
178#define WDTCR _SFR_IO8(0x21)
179#define WDP0 0
180#define WDP1 1
181#define WDP2 2
182#define WDE 3
183#define WDCE 4
184#define WDP3 5
185#define WDTIE 6
186#define WDTIF 7
187
188#define PRR _SFR_IO8(0x25)
189#define PRADC 0
190#define PRTIM0 1
191
192#define CLKPR _SFR_IO8(0x26)
193#define CLKPS0 0
194#define CLKPS1 1
195#define CLKPS2 2
196#define CLKPS3 3
197#define CLKPCE 7
198
199#define GTCCR _SFR_IO8(0x28)
200#define PSR10 0
201#define TSM 7
202
203#define OCR0B _SFR_IO8(0x29)
204#define OCR0B_0 0
205#define OCR0B_1 1
206#define OCR0B_2 2
207#define OCR0B_3 3
208#define OCR0B_4 4
209#define OCR0B_5 5
210#define OCR0B_6 6
211#define OCR0B_7 7
212
213#define DWDR _SFR_IO8(0x2E)
214#define DWDR0 0
215#define DWDR1 1
216#define DWDR2 2
217#define DWDR3 3
218#define DWDR4 4
219#define DWDR5 5
220#define DWDR6 6
221#define DWDR7 7
222
223#define TCCR0A _SFR_IO8(0x2F)
224#define WGM00 0
225#define WGM01 1
226#define COM0B0 4
227#define COM0B1 5
228#define COM0A0 6
229#define COM0A1 7
230
231#define BODCR _SFR_IO8(0x30)
232#define BODSE 0
233#define BODS 1
234
235#define OSCCAL _SFR_IO8(0x31)
236#define CAL0 0
237#define CAL1 1
238#define CAL2 2
239#define CAL3 3
240#define CAL4 4
241#define CAL5 5
242#define CAL6 6
243
244#define TCNT0 _SFR_IO8(0x32)
245#define TCNT0_0 0
246#define TCNT0_1 1
247#define TCNT0_2 2
248#define TCNT0_3 3
249#define TCNT0_4 4
250#define TCNT0_5 5
251#define TCNT0_6 6
252#define TCNT0_7 7
253
254#define TCCR0B _SFR_IO8(0x33)
255#define CS00 0
256#define CS01 1
257#define CS02 2
258#define WGM02 3
259#define FOC0B 6
260#define FOC0A 7
261
262#define MCUSR _SFR_IO8(0x34)
263#define PORF 0
264#define EXTRF 1
265#define BORF 2
266#define WDRF 3
267
268#define MCUCR _SFR_IO8(0x35)
269#define ISC00 0
270#define ISC01 1
271#define SM0 3
272#define SM1 4
273#define SE 5
274#define PUD 6
275
276#define OCR0A _SFR_IO8(0x36)
277#define OCR0A_0 0
278#define OCR0A_1 1
279#define OCR0A_2 2
280#define OCR0A_3 3
281#define OCR0A_4 4
282#define OCR0A_5 5
283#define OCR0A_6 6
284#define OCR0A_7 7
285
286#define SPMCSR _SFR_IO8(0x37)
287#define SPMEN 0
288#define PGERS 1
289#define PGWRT 2
290#define RFLB 3
291#define CTPB 4
292
293#define TIFR0 _SFR_IO8(0x38)
294#define TOV0 1
295#define OCF0A 2
296#define OCF0B 3
297
298#define TIMSK0 _SFR_IO8(0x39)
299#define TOIE0 1
300#define OCIE0A 2
301#define OCIE0B 3
302
303#define GIFR _SFR_IO8(0x3A)
304#define PCIF 5
305#define INTF0 6
306
307#define GIMSK _SFR_IO8(0x3B)
308#define PCIE 5
309#define INT0 6
310
311
312/* Interrupt vectors */
313/* Vector 0 is the reset vector */
314#define INT0_vect_num  1
315#define INT0_vect      _VECTOR(1)  /* External Interrupt 0 */
316#define PCINT0_vect_num  2
317#define PCINT0_vect      _VECTOR(2)  /* External Interrupt Request 0 */
318#define TIM0_OVF_vect_num  3
319#define TIM0_OVF_vect      _VECTOR(3)  /* Timer/Counter0 Overflow */
320#define EE_RDY_vect_num  4
321#define EE_RDY_vect      _VECTOR(4)  /* EEPROM Ready */
322#define ANA_COMP_vect_num  5
323#define ANA_COMP_vect      _VECTOR(5)  /* Analog Comparator */
324#define TIM0_COMPA_vect_num  6
325#define TIM0_COMPA_vect      _VECTOR(6)  /* Timer/Counter Compare Match A */
326#define TIM0_COMPB_vect_num  7
327#define TIM0_COMPB_vect      _VECTOR(7)  /* Timer/Counter Compare Match B */
328#define WDT_vect_num  8
329#define WDT_vect      _VECTOR(8)  /* Watchdog Time-out */
330#define ADC_vect_num  9
331#define ADC_vect      _VECTOR(9)  /* ADC Conversion Complete */
332
333#define _VECTOR_SIZE 2 /* Size of individual vector. */
334#define _VECTORS_SIZE (10 * _VECTOR_SIZE)
335
336
337/* Constants */
338#define SPM_PAGESIZE (32)
339#define RAMSTART     (0x60)
340#define RAMSIZE      (64)
341#define RAMEND       (RAMSTART + RAMSIZE - 1)
342#define XRAMSTART    (NA)
343#define XRAMSIZE     (0)
344#define XRAMEND      RAMEND
345#define E2END        (64 - 1)
346#define E2PAGESIZE   (4)
347#define FLASHEND     (1024 - 1)
348
349
350/* Fuses */
351#define FUSE_MEMORY_SIZE 2
352
353/* Low Fuse Byte */
354#define FUSE_CKSEL0 (unsigned char)~_BV(0)  /* Select Clock Source */
355#define FUSE_CKSEL1 (unsigned char)~_BV(1)  /* Select Clock Source */
356#define FUSE_SUT0 (unsigned char)~_BV(2)  /* Select start-up time */
357#define FUSE_SUT1 (unsigned char)~_BV(3)  /* Select start-up time */
358#define FUSE_CKDIV8 (unsigned char)~_BV(4)  /* Start up with system clock divided by 8 */
359#define FUSE_WDTON (unsigned char)~_BV(5)  /* Watch dog timer always on */
360#define FUSE_EESAVE (unsigned char)~_BV(6)  /* Keep EEprom contents during chip erase */
361#define FUSE_SPIEN (unsigned char)~_BV(7)  /* SPI programming enable */
362#define LFUSE_DEFAULT (FUSE_SPIEN & FUSE_CKDIV8 & FUSE_SUT0 & FUSE_CKSEL0)
363
364/* High Fuse Byte */
365#define FUSE_RSTDISBL (unsigned char)~_BV(0)  /* Disable external reset */
366#define FUSE_BODLEVEL0 (unsigned char)~_BV(1)  /* Enable BOD and select level */
367#define FUSE_BODLEVEL1 (unsigned char)~_BV(2)  /* Enable BOD and select level */
368#define FUSE_DWEN (unsigned char)~_BV(3)  /* DebugWire Enable */
369#define FUSE_SELFPRGEN (unsigned char)~_BV(4)  /* Self Programming Enable */
370#define HFUSE_DEFAULT (0xFF)
371
372
373/* Lock Bits */
374#define __LOCK_BITS_EXIST
375
376
377/* Signature */
378#define SIGNATURE_0 0x1E
379#define SIGNATURE_1 0x90
380#define SIGNATURE_2 0x07
381
382
383#endif /* _AVR_ATTINY13A_H_ */
384
Note: See TracBrowser for help on using the repository browser.