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

Last change on this file since 4837 was 4837, checked in by daduve, 2 years ago

Adding new version

File size: 11.1 KB
Line 
1/* Copyright (c) 2005,2007 Anatoly Sokolov
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: iotnx4.h 2225 2011-03-02 16:27:26Z arcanum $ */
32
33/* avr/iotnx4.h - definitions for ATtiny24, ATtiny44 and ATtiny84 */
34
35#ifndef _AVR_IOTNX4_H_
36#define _AVR_IOTNX4_H_ 1
37
38/* This file should only be included from <avr/io.h>, never directly. */
39
40#ifndef _AVR_IO_H_
41#  error "Include <avr/io.h> instead of this file."
42#endif
43
44#ifndef _AVR_IOXXX_H_
45#  define _AVR_IOXXX_H_ "iotnx4.h"
46#else
47#  error "Attempt to include more than one <avr/ioXXX.h> file."
48#endif
49
50/* I/O registers */
51
52#define PRR     _SFR_IO8 (0x00)
53#define PRTIM1  3
54#define PRTIM0  2
55#define PRUSI   1
56#define PRADC   0
57
58#define __AVR_HAVE_PRR  ((1<<PRADC)|(1<<PRUSI)|(1<<PRTIM0)|(1<<PRTIM1))
59#define __AVR_HAVE_PRR_PRADC
60#define __AVR_HAVE_PRR_PRUSI
61#define __AVR_HAVE_PRR_PRTIM0
62#define __AVR_HAVE_PRR_PRTIM1
63
64#define DIDR0    _SFR_IO8(0x01)
65#define ADC7D   7
66#define ADC6D   6
67#define ADC5D   5
68#define ADC4D   4
69#define ADC3D   3
70#define ADC2D   2
71#define ADC1D   1
72#define ADC0D   0
73
74/* Reserved [0x02] */
75
76#define ADCSRB  _SFR_IO8 (0x03)
77#define BIN     7
78#define ACME    6
79#define ADLAR   4
80#define ADTS2   2
81#define ADTS1   1
82#define ADTS0   0
83
84#ifndef __ASSEMBLER__
85#define ADC     _SFR_IO16(0x04)
86#endif
87#define ADCW    _SFR_IO16(0x04)
88#define ADCL    _SFR_IO8(0x04)
89#define ADCH    _SFR_IO8(0x05)
90
91#define ADCSRA  _SFR_IO8 (0x06)
92#define ADEN    7
93#define ADSC    6
94#define ADATE   5
95#define ADIF    4
96#define ADIE    3
97#define ADPS2   2
98#define ADPS1   1
99#define ADPS0   0
100
101#define ADMUX   _SFR_IO8(0x07)
102#define REFS1   7
103#define REFS0   6
104#define MUX5    5
105#define MUX4    4
106#define MUX3    3
107#define MUX2    2
108#define MUX1    1
109#define MUX0    0
110
111#define ACSR    _SFR_IO8(0x08)
112#define ACD     7
113#define ACBG    6
114#define ACO     5
115#define ACI     4
116#define ACIE    3
117#define ACIC    2
118#define ACIS1   1
119#define ACIS0   0
120
121/* Reserved [0x09..0x0A] */
122
123#define TIFR1   _SFR_IO8(0x0B)
124#define ICF1    5
125#define OCF1B   2
126#define OCF1A   1
127#define TOV1    0
128
129#define TIMSK1   _SFR_IO8(0x0C)
130#define ICIE1   5
131#define OCIE1B  2
132#define OCIE1A  1
133#define TOIE1   0
134
135#define USICR   _SFR_IO8(0x0D)
136#define USISIE  7
137#define USIOIE  6
138#define USIWM1  5
139#define USIWM0  4
140#define USICS1  3
141#define USICS0  2
142#define USICLK  1
143#define USITC   0
144
145#define USISR   _SFR_IO8(0x0E)
146#define USISIF  7
147#define USIOIF  6
148#define USIPF   5
149#define USIDC   4
150#define USICNT3 3
151#define USICNT2 2
152#define USICNT1 1
153#define USICNT0 0
154
155#define USIDR   _SFR_IO8(0x0F)
156
157#define USIBR   _SFR_IO8(0x10)
158
159/* Reserved [0x11] */
160
161#define PCMSK0  _SFR_IO8(0x12)
162#define PCINT7  7
163#define PCINT6  6
164#define PCINT5  5
165#define PCINT4  4
166#define PCINT3  3
167#define PCINT2  2
168#define PCINT1  1
169#define PCINT0  0
170
171#define GPIOR0  _SFR_IO8(0x13)
172
173#define GPIOR1  _SFR_IO8(0x14)
174
175#define GPIOR2  _SFR_IO8(0x15)
176
177#define PINB    _SFR_IO8(0x16)
178#define PINB3   3
179#define PINB2   2
180#define PINB1   1
181#define PINB0   0
182
183#define DDRB    _SFR_IO8(0x17)
184#define DDB3    3
185#define DDB2    2
186#define DDB1    1
187#define DDB0    0
188
189#define PORTB   _SFR_IO8(0x18)
190#define PB3     3
191#define PB2     2
192#define PB1     1
193#define PB0     0
194
195#define PINA    _SFR_IO8(0x19)
196#define PINA7   7
197#define PINA6   6
198#define PINA5   5
199#define PINA4   4
200#define PINA3   3
201#define PINA2   2
202#define PINA1   1
203#define PINA0   0
204
205#define DDRA    _SFR_IO8(0x1A)
206#define DDA7    7
207#define DDA6    6
208#define DDA5    5
209#define DDA4    4
210#define DDA3    3
211#define DDA2    2
212#define DDA1    1
213#define DDA0    0
214
215#define PORTA   _SFR_IO8(0x1B)
216#define PA7     7
217#define PA6     6
218#define PA5     5
219#define PA4     4
220#define PA3     3
221#define PA2     2
222#define PA1     1
223#define PA0     0
224
225/* EEPROM Control Register EECR */
226#define EECR    _SFR_IO8(0x1C)
227#define EEPM1   5
228#define EEPM0   4
229#define EERIE   3
230#define EEMPE   2
231#define EEPE    1
232#define EERE    0
233
234/* EEPROM Data Register */
235#define EEDR    _SFR_IO8(0x1D)
236
237/* EEPROM Address Register */
238#define EEAR    _SFR_IO16(0x1E)
239#define EEARL   _SFR_IO8(0x1E)
240#define EEARH   _SFR_IO8(0x1F)
241
242#define PCMSK1  _SFR_IO8(0x20)
243#define PCINT11 3
244#define PCINT10 2
245#define PCINT9  1
246#define PCINT8  0
247
248#define WDTCSR _SFR_IO8(0x21)
249#define WDIF    7
250#define WDIE    6
251#define WDP3    5
252#define WDCE    4
253#define WDE     3
254#define WDP2    2
255#define WDP1    1
256#define WDP0    0
257
258#define TCCR1C  _SFR_IO8(0x22)
259#define FOC1A   7
260#define FOC1B   6
261
262#define GTCCR   _SFR_IO8(0x23)
263#define TSM     7
264#define PSR10   0
265
266#define ICR1    _SFR_IO16(0x24)
267#define ICR1L   _SFR_IO8(0x24)
268#define ICR1H   _SFR_IO8(0x25)
269
270#define CLKPR   _SFR_IO8(0x26)
271#define CLKPCE  7
272#define CLKPS3  3
273#define CLKPS2  2
274#define CLKPS1  1
275#define CLKPS0  0
276
277#define DWDR    _SFR_IO8(0x27)
278
279#define OCR1B   _SFR_IO16(0x28)
280#define OCR1BL  _SFR_IO8(0x28)
281#define OCR1BH  _SFR_IO8(0x29)
282
283#define OCR1A   _SFR_IO16(0x2A)
284#define OCR1AL  _SFR_IO8(0x2A)
285#define OCR1AH  _SFR_IO8(0x2B)
286
287/* keep misspelled names from avr-libc 1.4.[0..1] for compatibility */
288#define OCRB1   _SFR_IO16(0x28)
289#define OCRB1L  _SFR_IO8(0x28)
290#define OCRB1H  _SFR_IO8(0x29)
291
292#define OCRA1   _SFR_IO16(0x2A)
293#define OCRA1L  _SFR_IO8(0x2A)
294#define OCRA1H  _SFR_IO8(0x2B)
295
296#define TCNT1   _SFR_IO16(0x2C)
297#define TCNT1L  _SFR_IO8(0x2C)
298#define TCNT1H  _SFR_IO8(0x2D)
299
300#define TCCR1B  _SFR_IO8(0x2E)
301#define ICNC1   7
302#define ICES1   6
303#define WGM13   4
304#define WGM12   3
305#define CS12    2
306#define CS11    1
307#define CS10    0
308
309#define TCCR1A  _SFR_IO8(0x2F)
310#define COM1A1  7
311#define COM1A0  6
312#define COM1B1  5
313#define COM1B0  4
314#define WGM11   1
315#define WGM10   0
316
317#define TCCR0A  _SFR_IO8(0x30)
318#define COM0A1  7
319#define COM0A0  6
320#define COM0B1  5
321#define COM0B0  4
322#define WGM01   1
323#define WGM00   0
324
325#define OSCCAL  _SFR_IO8(0x31)
326
327#define TCNT0   _SFR_IO8(0x32)
328
329#define TCCR0B  _SFR_IO8(0x33)
330#define FOC0A   7
331#define FOC0B   6
332#define WGM02   3
333#define CS02    2
334#define CS01    1
335#define CS00    0
336
337#define MCUSR   _SFR_IO8(0x34)
338#define WDRF    3
339#define BORF    2
340#define EXTRF   1
341#define PORF    0
342
343#define MCUCR   _SFR_IO8(0x35)
344#define BODS    7
345#define PUD     6
346#define SE      5
347#define SM1     4
348#define SM0     3
349#define BODSE   2
350#define ISC01   1
351#define ISC00   0
352
353#define OCR0A   _SFR_IO8(0x36)
354
355#define SPMCSR  _SFR_IO8(0x37)
356#define RSIG    5
357#define CTPB    4
358#define RFLB    3
359#define PGWRT   2
360#define PGERS   1
361#define SPMEN   0
362
363#define TIFR0   _SFR_IO8(0x38)
364#define OCF0B   2
365#define OCF0A   1
366#define TOV0    0
367
368#define TIMSK0  _SFR_IO8(0x39)
369#define OCIE0B  2
370#define OCIE0A  1
371#define TOIE0   0
372
373#define GIFR    _SFR_IO8(0x3A)
374#define INTF0   6
375#define PCIF1   5
376#define PCIF0   4
377
378#define GIMSK   _SFR_IO8(0x3B)
379#define INT0    6
380#define PCIE1   5
381#define PCIE0   4
382
383#define OCR0B   _SFR_IO8(0x3C)
384
385/* 0x3D..0x3E SP  [defined in <avr/io.h>] */
386/* 0x3F SREG      [defined in <avr/io.h>] */
387
388///---
389
390/* Interrupt vectors */
391/* Interrupt vector 0 is the reset vector. */
392/* External Interrupt Request 0 */
393#define INT0_vect_num               1
394#define INT0_vect                           _VECTOR(1)
395#define EXT_INT0_vect_num       1
396#define EXT_INT0_vect                   _VECTOR(1)
397#define SIG_INTERRUPT0                  _VECTOR(1)
398
399/* Pin Change Interrupt Request 0 */
400#define PCINT0_vect_num             2
401#define PCINT0_vect                         _VECTOR(2)
402#define SIG_PIN_CHANGE0                 _VECTOR(2)
403
404/* Pin Change Interrupt Request 1 */
405#define PCINT1_vect_num             3
406#define PCINT1_vect                         _VECTOR(3)
407#define SIG_PIN_CHANGE1                 _VECTOR(3)
408
409/* Watchdog Time-out */
410#define WDT_vect_num                    4
411#define WDT_vect                            _VECTOR(4)
412#define WATCHDOG_vect_num               4
413#define WATCHDOG_vect                   _VECTOR(4)
414#define SIG_WATCHDOG_TIMEOUT    _VECTOR(4)
415
416/* Timer/Counter1 Capture Event */
417#define TIMER1_CAPT_vect_num    5
418#define TIMER1_CAPT_vect                _VECTOR(5)
419#define TIM1_CAPT_vect_num              5
420#define TIM1_CAPT_vect                  _VECTOR(5)
421#define SIG_INPUT_CAPTURE1              _VECTOR(5)
422
423/* Timer/Counter1 Compare Match A */
424#define TIM1_COMPA_vect_num             6
425#define TIM1_COMPA_vect                 _VECTOR(6)
426#define SIG_OUTPUT_COMPARE1A    _VECTOR(6)
427
428/* Timer/Counter1 Compare Match B */
429#define TIM1_COMPB_vect_num             7
430#define TIM1_COMPB_vect                 _VECTOR(7)
431#define SIG_OUTPUT_COMPARE1B    _VECTOR(7)
432
433/* Timer/Counter1 Overflow */
434#define TIM1_OVF_vect_num               8
435#define TIM1_OVF_vect                   _VECTOR(8)
436#define SIG_OVERFLOW1                   _VECTOR(8)
437
438/* Timer/Counter0 Compare Match A */
439#define TIM0_COMPA_vect_num             9
440#define TIM0_COMPA_vect                 _VECTOR(9)
441#define SIG_OUTPUT_COMPARE0A    _VECTOR(9)
442
443/* Timer/Counter0 Compare Match B */
444#define TIM0_COMPB_vect_num             10
445#define TIM0_COMPB_vect                 _VECTOR(10)
446#define SIG_OUTPUT_COMPARE0B    _VECTOR(10)
447
448/* Timer/Counter0 Overflow */
449#define TIM0_OVF_vect_num               11
450#define TIM0_OVF_vect                   _VECTOR(11)
451#define SIG_OVERFLOW0                   _VECTOR(11)
452
453/* Analog Comparator */
454#define ANA_COMP_vect_num               12
455#define ANA_COMP_vect                   _VECTOR(12)
456#define SIG_COMPARATOR                  _VECTOR(12)
457
458/* ADC Conversion Complete */
459#define ADC_vect_num                13
460#define ADC_vect                            _VECTOR(13)
461#define SIG_ADC                             _VECTOR(13)
462
463/* EEPROM Ready */
464#define EE_RDY_vect_num             14
465#define EE_RDY_vect                         _VECTOR(14)
466#define SIG_EEPROM_READY                _VECTOR(14)
467
468/* USI START */
469#define USI_START_vect_num              15
470#define USI_START_vect                  _VECTOR(15)
471#define USI_STR_vect_num                15
472#define USI_STR_vect                    _VECTOR(15)
473#define SIG_USI_START                   _VECTOR(15)
474
475/* USI Overflow */
476#define USI_OVF_vect_num                16
477#define USI_OVF_vect                    _VECTOR(16)
478#define SIG_USI_OVERFLOW                _VECTOR(16)
479
480#define _VECTORS_SIZE 34
481
482#endif /* _AVR_IOTNX4_H_ */
Note: See TracBrowser for help on using the repository browser.