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

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

Adding new version

File size: 6.6 KB
Line 
1/* Copyright (c) 2002,2005 Marek Michalkiewicz
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: iotn12.h 2236 2011-03-17 21:53:39Z arcanum $ */
32
33/* avr/iotn12.h - definitions for ATtiny12 */
34
35#ifndef _AVR_IOTN12_H_
36#define _AVR_IOTN12_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_ "iotn12.h"
46#else
47#  error "Attempt to include more than one <avr/ioXXX.h> file."
48#endif
49
50#ifndef __ASSEMBLER__
51#  warning "MCU not supported by the C compiler"
52#endif
53
54/* I/O registers */
55
56/* 0x00..0x07 reserved */
57
58/* Analog Comparator Control and Status Register */
59#define ACSR    _SFR_IO8(0x08)
60
61/* 0x09..0x15 reserved */
62
63/* Input Pins, Port B */
64#define PINB    _SFR_IO8(0x16)
65
66/* Data Direction Register, Port B */
67#define DDRB    _SFR_IO8(0x17)
68
69/* Data Register, Port B */
70#define PORTB   _SFR_IO8(0x18)
71
72/* 0x19..0x1B reserved */
73
74/* EEPROM Control Register */
75#define EECR    _SFR_IO8(0x1C)
76
77/* EEPROM Data Register */
78#define EEDR    _SFR_IO8(0x1D)
79
80/* EEPROM Address Register */
81#define EEAR    _SFR_IO8(0x1E)
82#define EEARL   _SFR_IO8(0x1E)
83
84/* 0x1F..0x20 reserved */
85
86/* Watchdog Timer Control Register */
87#define WDTCR   _SFR_IO8(0x21)
88
89/* 0x22..0x30 reserved */
90
91/* Oscillator Calibration Register */
92#define OSCCAL  _SFR_IO8(0x31)
93
94/* Timer/Counter0 (8-bit) */
95#define TCNT0   _SFR_IO8(0x32)
96
97/* Timer/Counter0 Control Register */
98#define TCCR0   _SFR_IO8(0x33)
99
100/* MCU general Status Register */
101#define MCUSR   _SFR_IO8(0x34)
102
103/* MCU general Control Register */
104#define MCUCR   _SFR_IO8(0x35)
105
106/* 0x36..0x37 reserved */
107
108/* Timer/Counter Interrupt Flag Register */
109#define TIFR    _SFR_IO8(0x38)
110
111/* Timer/Counter Interrupt MaSK Register */
112#define TIMSK   _SFR_IO8(0x39)
113
114/* General Interrupt Flag Register */
115#define GIFR    _SFR_IO8(0x3A)
116
117/* General Interrupt MaSK register */
118#define GIMSK   _SFR_IO8(0x3B)
119
120/* 0x3C..0x3E reserved */
121
122/* 0x3F SREG */
123
124/* Interrupt vectors */
125
126/* External Interrupt 0 */
127#define INT0_vect_num                   1
128#define INT0_vect                       _VECTOR(1)
129#define SIG_INTERRUPT0                  _VECTOR(1)
130
131/* External Interrupt Request 0 */
132#define IO_PINS_vect_num                2
133#define IO_PINS_vect                    _VECTOR(2)
134#define SIG_PIN                         _VECTOR(2)
135#define SIG_PIN_CHANGE                  _VECTOR(2)
136
137/* Timer/Counter0 Overflow */
138#define TIMER0_OVF_vect_num             3
139#define TIMER0_OVF_vect                 _VECTOR(3)
140#define SIG_OVERFLOW0                   _VECTOR(3)
141
142/* EEPROM Ready */
143#define EE_RDY_vect_num                 4
144#define EE_RDY_vect                     _VECTOR(4)
145#define SIG_EEPROM_READY                _VECTOR(4)
146
147/* Analog Comparator */
148#define ANA_COMP_vect_num               5
149#define ANA_COMP_vect                   _VECTOR(5)
150#define SIG_COMPARATOR                  _VECTOR(5)
151
152#define _VECTORS_SIZE 12
153
154/* Bit numbers */
155
156/* GIMSK */
157#define INT0    6
158#define PCIE    5
159
160/* GIFR */
161#define INTF0   6
162#define PCIF    5
163
164/* TIMSK */
165#define TOIE0   1
166
167/* TIFR */
168#define TOV0    1
169
170/* MCUCR */
171#define PUD     6
172#define SE      5
173#define SM      4
174#define ISC01   1
175#define ISC00   0
176
177/* TCCR0 */
178#define CS02    2
179#define CS01    1
180#define CS00    0
181
182/* WDTCR */
183#define WDTOE   4
184#define WDE     3
185#define WDP2    2
186#define WDP1    1
187#define WDP0    0
188
189/*
190   PB5 = RESET#
191   PB4 = XTAL2
192   PB3 = XTAL1
193   PB2 = T0 / SCK
194   PB1 = INT0 / AIN1 / MISO
195   PB0 = AIN0 / MOSI
196 */
197
198/* PORTB */
199#define PB4     4
200#define PB3     3
201#define PB2     2
202#define PB1     1
203#define PB0     0
204
205/* DDRB */
206#define DDB5    5
207#define DDB4    4
208#define DDB3    3
209#define DDB2    2
210#define DDB1    1
211#define DDB0    0
212
213/* PINB */
214#define PINB5   5
215#define PINB4   4
216#define PINB3   3
217#define PINB2   2
218#define PINB1   1
219#define PINB0   0
220
221/* ACSR */
222#define ACD     7
223#define AINBG   6
224#define ACO     5
225#define ACI     4
226#define ACIE    3
227#define ACIS1   1
228#define ACIS0   0
229
230/* EEPROM Control Register */
231#define EERIE   3
232#define EEMWE   2
233#define EEWE    1
234#define EERE    0
235
236#define RAMSTART    0x60
237/* Last memory addresses */
238#define RAMEND          0x1F
239#define XRAMEND         0x0
240#define E2END           0x3F
241#define E2PAGESIZE  2
242#define FLASHEND        0x3FF
243
244
245/* Fuses */
246
247#define FUSE_MEMORY_SIZE 1
248
249/* Low Fuse Byte */
250#define FUSE_CKSEL0      (unsigned char)~_BV(0)
251#define FUSE_CKSEL1      (unsigned char)~_BV(1)
252#define FUSE_CKSEL2      (unsigned char)~_BV(2)
253#define FUSE_CKSEL3      (unsigned char)~_BV(3)
254#define FUSE_RSTDISBL    (unsigned char)~_BV(4)
255#define FUSE_SPIEN       (unsigned char)~_BV(5)
256#define FUSE_BODEN       (unsigned char)~_BV(6)
257#define FUSE_BODLEVEL    (unsigned char)~_BV(7)
258#define FUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SPIEN & FUSE_BODLEVEL)
259
260
261/* Lock Bits */
262#define __LOCK_BITS_EXIST
263
264
265/* Signature */
266#define SIGNATURE_0 0x1E
267#define SIGNATURE_1 0x90
268#define SIGNATURE_2 0x05
269
270
271/* Deprecated items */
272#if !defined(__AVR_LIBC_DEPRECATED_ENABLE__)
273
274#pragma GCC system_header
275
276#pragma GCC poison SIG_INTERRUPT0
277#pragma GCC poison SIG_PIN
278#pragma GCC poison SIG_PIN_CHANGE
279#pragma GCC poison SIG_OVERFLOW0
280#pragma GCC poison SIG_EEPROM_READY
281#pragma GCC poison SIG_COMPARATOR
282
283#endif  /* !defined(__AVR_LIBC_DEPRECATED_ENABLE__) */
284
285#define SLEEP_MODE_IDLE (0x00<<4)
286#define SLEEP_MODE_PWR_DOWN (0x01<<4)
287
288#endif /* _AVR_IOTN12_H_ */
Note: See TracBrowser for help on using the repository browser.