RTEMS CPU Kit with SuperCore  4.11.3
iotn11.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2002, 2005 Marek Michalkiewicz
11  * All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions are met:
15  *
16  * * Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  *
19  * * Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in
21  * the documentation and/or other materials provided with the
22  * distribution.
23  *
24  * * Neither the name of the copyright holders nor the names of
25  * contributors may be used to endorse or promote products derived
26  * from this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38  * POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #ifndef _AVR_IOTN11_H_
42 #define _AVR_IOTN11_H_ 1
43 
51 #ifndef _AVR_IO_H_
52 # error "Include <avr/io.h> instead of this file."
53 #endif
54 
55 #ifndef _AVR_IOXXX_H_
56 # define _AVR_IOXXX_H_ "iotn11.h"
57 #else
58 # error "Attempt to include more than one <avr/ioXXX.h> file."
59 #endif
60 
61 #ifndef __ASSEMBLER__
62 # warning "MCU not supported by the C compiler"
63 #endif
64 
65 /* I/O registers */
66 
67 /* 0x00..0x07 reserved */
68 
69 /* Analog Comparator Control and Status Register */
70 #define ACSR _SFR_IO8(0x08)
71 
72 /* 0x09..0x15 reserved */
73 
74 /* Input Pins, Port B */
75 #define PINB _SFR_IO8(0x16)
76 
77 /* Data Direction Register, Port B */
78 #define DDRB _SFR_IO8(0x17)
79 
80 /* Data Register, Port B */
81 #define PORTB _SFR_IO8(0x18)
82 
83 /* 0x19..0x20 reserved */
84 
85 /* Watchdog Timer Control Register */
86 #define WDTCR _SFR_IO8(0x21)
87 
88 /* 0x22..0x31 reserved */
89 
90 /* Timer/Counter0 (8-bit) */
91 #define TCNT0 _SFR_IO8(0x32)
92 
93 /* Timer/Counter0 Control Register */
94 #define TCCR0 _SFR_IO8(0x33)
95 
96 /* MCU general Status Register */
97 #define MCUSR _SFR_IO8(0x34)
98 
99 /* MCU general Control Register */
100 #define MCUCR _SFR_IO8(0x35)
101 
102 /* 0x36..0x37 reserved */
103 
104 /* Timer/Counter Interrupt Flag Register */
105 #define TIFR _SFR_IO8(0x38)
106 
107 /* Timer/Counter Interrupt MaSK Register */
108 #define TIMSK _SFR_IO8(0x39)
109 
110 /* General Interrupt Flag Register */
111 #define GIFR _SFR_IO8(0x3A)
112 
113 /* General Interrupt MaSK register */
114 #define GIMSK _SFR_IO8(0x3B)
115 
116 /* 0x3C..0x3E reserved */
117 
118 /* 0x3F SREG */
119 
120 /* Interrupt vectors */
121 
122 /* External Interrupt 0 */
123 #define INT0_vect _VECTOR(1)
124 #define SIG_INTERRUPT0 _VECTOR(1)
125 
126 /* External Interrupt Request 0 */
127 #define IO_PINS_vect _VECTOR(2)
128 #define SIG_PIN _VECTOR(2)
129 #define SIG_PIN_CHANGE _VECTOR(2)
130 
131 /* Timer/Counter0 Overflow */
132 #define TIMER0_OVF_vect _VECTOR(3)
133 #define SIG_OVERFLOW0 _VECTOR(3)
134 
135 /* Analog Comparator */
136 #define ANA_COMP_vect _VECTOR(4)
137 #define SIG_COMPARATOR _VECTOR(4)
138 
139 #define _VECTORS_SIZE 10
140 
141 /* Bit numbers */
142 
143 /* GIMSK */
144 #define INT0 6
145 #define PCIE 5
146 
147 /* GIFR */
148 #define INTF0 6
149 #define PCIF 5
150 
151 /* TIMSK */
152 #define TOIE0 1
153 
154 /* TIFR */
155 #define TOV0 1
156 
157 /* MCUCR */
158 #define SE 5
159 #define SM 4
160 #define ISC01 1
161 #define ISC00 0
162 
163 /* TCCR0 */
164 #define CS02 2
165 #define CS01 1
166 #define CS00 0
167 
168 /* WDTCR */
169 #define WDTOE 4
170 #define WDE 3
171 #define WDP2 2
172 #define WDP1 1
173 #define WDP0 0
174 
175 /*
176  PB5 = RESET#
177  PB4 = XTAL2
178  PB3 = XTAL1
179  PB2 = T0
180  PB1 = INT0 / AIN1
181  PB0 = AIN0
182  */
183 
184 /* PORTB */
185 #define PB4 4
186 #define PB3 3
187 #define PB2 2
188 #define PB1 1
189 #define PB0 0
190 
191 /* DDRB */
192 #define DDB4 4
193 #define DDB3 3
194 #define DDB2 2
195 #define DDB1 1
196 #define DDB0 0
197 
198 /* PINB */
199 #define PINB5 5
200 #define PINB4 4
201 #define PINB3 3
202 #define PINB2 2
203 #define PINB1 1
204 #define PINB0 0
205 
206 /* ACSR */
207 #define ACD 7
208 #define ACO 5
209 #define ACI 4
210 #define ACIE 3
211 #define ACIS1 1
212 #define ACIS0 0
213 
214 /* Last memory addresses */
215 #define RAMEND 0x1F
216 #define XRAMEND 0x0
217 #define E2END 0x0
218 #define E2PAGESIZE 2
219 #define FLASHEND 0x3FF
220 
221 
222 /* Fuses */
223 
224 #define FUSE_MEMORY_SIZE 1
225 
226 /* Low Fuse Byte */
227 #define FUSE_CKSEL0 (unsigned char)~_BV(0)
228 #define FUSE_CKSEL1 (unsigned char)~_BV(1)
229 #define FUSE_CKSEL2 (unsigned char)~_BV(2)
230 #define FUSE_RSTDISBL (unsigned char)~_BV(3)
231 #define FUSE_FSTRT (unsigned char)~_BV(4)
232 #define FUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL1)
233 
234 
235 /* Lock Bits */
236 #define __LOCK_BITS_EXIST
237 
238 
239 /* Signature */
240 #define SIGNATURE_0 0x1E
241 #define SIGNATURE_1 0x90
242 #define SIGNATURE_2 0x04
243 
244 
246 #endif /* _AVR_IOTN11_H_ */