RTEMS CPU Kit with SuperCore  4.11.3
iotn26.h
Go to the documentation of this file.
1 
9 /* Copyright (c) 2004,2005 Eric B. Weddington
10  All rights reserved.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14 
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17 
18  * Redistributions in binary form must reproduce the above copyright
19  notice, this list of conditions and the following disclaimer in
20  the documentation and/or other materials provided with the
21  distribution.
22 
23  * Neither the name of the copyright holders nor the names of
24  contributors may be used to endorse or promote products derived
25  from this software without specific prior written permission.
26 
27  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  POSSIBILITY OF SUCH DAMAGE. */
38 
39 
40 /* avr/iotn26.h - definitions for ATtiny26 */
41 
42 /* This file should only be included from <avr/io.h>, never directly. */
43 
44 #ifndef _AVR_IO_H_
45 # error "Include <avr/io.h> instead of this file."
46 #endif
47 
48 #ifndef _AVR_IOXXX_H_
49 # define _AVR_IOXXX_H_ "iotn26.h"
50 #else
51 # error "Attempt to include more than one <avr/ioXXX.h> file."
52 #endif
53 
54 #ifndef _AVR_IOTN26_H_
55 #define _AVR_IOTN26_H_ 1
56 
65 /* Registers and associated bit numbers */
66 
67 /* Reserved [0x00..0x03] */
68 
69 #define ADCW _SFR_IO16(0x04)
70 #ifndef __ASSEMBLER__
71 #define ADC _SFR_IO16(0x04)
72 #endif
73 
74 #define ADCL _SFR_IO8(0x04)
75 #define ADCH _SFR_IO8(0x05)
76 
77 #define ADCSR _SFR_IO8(0x06)
78 #define ADPS0 0
79 #define ADPS1 1
80 #define ADPS2 2
81 #define ADIE 3
82 #define ADIF 4
83 #define ADFR 5
84 #define ADSC 6
85 #define ADEN 7
86 
87 #define ADMUX _SFR_IO8(0x07)
88 #define MUX0 0
89 #define MUX1 1
90 #define MUX2 2
91 #define MUX3 3
92 #define MUX4 4
93 #define ADLAR 5
94 #define REFS0 6
95 #define REFS1 7
96 
97 #define ACSR _SFR_IO8(0x08)
98 #define ACIS0 0
99 #define ACIS1 1
100 #define ACME 2
101 #define ACIE 3
102 #define ACI 4
103 #define ACO 5
104 #define ACBG 6
105 #define ACD 7
106 
107 /* Reserved [0x09..0x0C] */
108 
109 #define USICR _SFR_IO8(0x0D)
110 #define USITC 0
111 #define USICLK 1
112 #define USICS0 2
113 #define USICS1 3
114 #define USIWM0 4
115 #define USIWM1 5
116 #define USIOIE 6
117 #define USISIE 7
118 
119 #define USISR _SFR_IO8(0x0E)
120 #define USICNT0 0
121 #define USICNT1 1
122 #define USICNT2 2
123 #define USICNT3 3
124 #define USIDC 4
125 #define USIPF 5
126 #define USIOIF 6
127 #define USISIF 7
128 
129 #define USIDR _SFR_IO8(0x0F)
130 
131 /* Reserved [0x10..0x15] */
132 
133 
134 #define PINB _SFR_IO8(0x16)
135 #define PINB0 0
136 #define PINB1 1
137 #define PINB2 2
138 #define PINB3 3
139 #define PINB4 4
140 #define PINB5 5
141 #define PINB6 6
142 #define PINB7 7
143 
144 #define DDRB _SFR_IO8(0x17)
145 #define DDB0 0
146 #define DDB1 1
147 #define DDB2 2
148 #define DDB3 3
149 #define DDB4 4
150 #define DDB5 5
151 #define DDB6 6
152 #define DDB7 7
153 
154 #define PORTB _SFR_IO8(0x18)
155 #define PB0 0
156 #define PB1 1
157 #define PB2 2
158 #define PB3 3
159 #define PB4 4
160 #define PB5 5
161 #define PB6 6
162 #define PB7 7
163 
164 #define PINA _SFR_IO8(0x19)
165 #define PINA0 0
166 #define PINA1 1
167 #define PINA2 2
168 #define PINA3 3
169 #define PINA4 4
170 #define PINA5 5
171 #define PINA6 6
172 #define PINA7 7
173 
174 #define DDRA _SFR_IO8(0x1A)
175 #define DDA0 0
176 #define DDA1 1
177 #define DDA2 2
178 #define DDA3 3
179 #define DDA4 4
180 #define DDA5 5
181 #define DDA6 6
182 #define DDA7 7
183 
184 #define PORTA _SFR_IO8(0x1B)
185 #define PA0 0
186 #define PA1 1
187 #define PA2 2
188 #define PA3 3
189 #define PA4 4
190 #define PA5 5
191 #define PA6 6
192 #define PA7 7
193 
194 /* EEPROM Control Register */
195 #define EECR _SFR_IO8(0x1C)
196 #define EERE 0
197 #define EEWE 1
198 #define EEMWE 2
199 #define EERIE 3
200 
201 /* EEPROM Data Register */
202 #define EEDR _SFR_IO8(0x1D)
203 
204 /* EEPROM Address Register */
205 #define EEAR _SFR_IO8(0x1E)
206 #define EEARL _SFR_IO8(0x1E)
207 
208 /* Reserved [0x1F..0x20] */
209 
210 #define WDTCR _SFR_IO8(0x21)
211 #define WDP0 0
212 #define WDP1 1
213 #define WDP2 2
214 #define WDE 3
215 #define WDCE 4
216 
217 /* Reserved [0x22..0x28] */
218 
219 #define PLLCSR _SFR_IO8(0x29)
220 #define PLOCK 0
221 #define PLLE 1
222 #define PCKE 2
223 
224 /* Reserved [0x2A] */
225 
226 #define OCR1C _SFR_IO8(0x2B)
227 
228 #define OCR1B _SFR_IO8(0x2C)
229 
230 #define OCR1A _SFR_IO8(0x2D)
231 
232 #define TCNT1 _SFR_IO8(0x2E)
233 
234 #define TCCR1B _SFR_IO8(0x2F)
235 #define CS10 0
236 #define CS11 1
237 #define CS12 2
238 #define CS13 3
239 #define PSR1 6
240 #define CTC1 7
241 
242 #define TCCR1A _SFR_IO8(0x30)
243 #define PWM1B 0
244 #define PWM1A 1
245 #define FOC1B 2
246 #define FOC1A 3
247 #define COM1B0 4
248 #define COM1B1 5
249 #define COM1A0 6
250 #define COM1A1 7
251 
252 #define OSCCAL _SFR_IO8(0x31)
253 
254 #define TCNT0 _SFR_IO8(0x32)
255 
256 #define TCCR0 _SFR_IO8(0x33)
257 #define CS00 0
258 #define CS01 1
259 #define CS02 2
260 #define PSR0 3
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 /* Reserved [0x36..0x37] */
277 
278 #define TIFR _SFR_IO8(0x38)
279 #define TOV0 1
280 #define TOV1 2
281 #define OCF1B 5
282 #define OCF1A 6
283 
284 #define TIMSK _SFR_IO8(0x39)
285 #define TOIE0 1
286 #define TOIE1 2
287 #define OCIE1B 5
288 #define OCIE1A 6
289 
290 #define GIFR _SFR_IO8(0x3A)
291 #define PCIF 5
292 #define INTF0 6
293 
294 #define GIMSK _SFR_IO8(0x3B)
295 #define PCIE0 4
296 #define PCIE1 5
297 #define INT0 6
298 
299 /* Reserved [0x3C] */
300 
301 /* SP [0x3D] */
302 
303 /* Reserved [0x3E] */
304 
305 /* SREG [0x3F] */
306 
307 
308 /* Interrupt vectors */
309 /* Interrupt vector 0 is the reset vector. */
310 /* External Interrupt 0 */
311 #define INT0_vect _VECTOR(1)
312 #define SIG_INTERRUPT0 _VECTOR(1)
313 
314 /* External Interrupt Request 0 */
315 #define IO_PINS_vect _VECTOR(2)
316 #define SIG_PIN_CHANGE _VECTOR(2)
317 
318 /* Timer/Counter1 Compare Match 1A */
319 #define TIMER1_CMPA_vect _VECTOR(3)
320 #define SIG_OUTPUT_COMPARE1A _VECTOR(3)
321 
322 /* Timer/Counter1 Compare Match 1B */
323 #define TIMER1_CMPB_vect _VECTOR(4)
324 #define SIG_OUTPUT_COMPARE1B _VECTOR(4)
325 
326 /* Timer/Counter1 Overflow */
327 #define TIMER1_OVF1_vect _VECTOR(5)
328 #define SIG_OVERFLOW1 _VECTOR(5)
329 
330 /* Timer/Counter0 Overflow */
331 #define TIMER0_OVF0_vect _VECTOR(6)
332 #define SIG_OVERFLOW0 _VECTOR(6)
333 
334 /* USI Start */
335 #define USI_STRT_vect _VECTOR(7)
336 #define SIG_USI_START _VECTOR(7)
337 
338 /* USI Overflow */
339 #define USI_OVF_vect _VECTOR(8)
340 #define SIG_USI_OVERFLOW _VECTOR(8)
341 
342 /* EEPROM Ready */
343 #define EE_RDY_vect _VECTOR(9)
344 #define SIG_EEPROM_READY _VECTOR(9)
345 
346 /* Analog Comparator */
347 #define ANA_COMP_vect _VECTOR(10)
348 #define SIG_ANA_COMP _VECTOR(10)
349 #define SIG_COMPARATOR _VECTOR(10)
350 
351 /* ADC Conversion Complete */
352 #define ADC_vect _VECTOR(11)
353 #define SIG_ADC _VECTOR(11)
354 
355 #define _VECTORS_SIZE 24
356 
357 
358 /* Constants */
359 #define RAMEND 0xDF
360 #define XRAMEND RAMEND
361 #define E2END 0x7F
362 #define E2PAGESIZE 4
363 #define FLASHEND 0x07FF
364 
365 
366 /* Fuses */
367 
368 #define FUSE_MEMORY_SIZE 2
369 
370 /* Low Fuse Byte */
371 #define FUSE_CKSEL0 (unsigned char)~_BV(0)
372 #define FUSE_CKSEL1 (unsigned char)~_BV(1)
373 #define FUSE_CKSEL2 (unsigned char)~_BV(2)
374 #define FUSE_CKSEL3 (unsigned char)~_BV(3)
375 #define FUSE_SUT0 (unsigned char)~_BV(4)
376 #define FUSE_SUT1 (unsigned char)~_BV(5)
377 #define FUSE_CKOPT (unsigned char)~_BV(6)
378 #define FUSE_PLLCK (unsigned char)~_BV(7)
379 #define LFUSE_DEFAULT (FUSE_CKSEL1 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0)
380 
381 /* High Fuse Byte */
382 #define FUSE_BODEN (unsigned char)~_BV(0)
383 #define FUSE_BODLEVEL (unsigned char)~_BV(1)
384 #define FUSE_EESAVE (unsigned char)~_BV(2)
385 #define FUSE_SPIEN (unsigned char)~_BV(3)
386 #define FUSE_RSTDISBL (unsigned char)~_BV(4)
387 #define HFUSE_DEFAULT (FUSE_SPIEN)
388 
389 
390 /* Lock Bits */
391 #define __LOCK_BITS_EXIST
392 
393 
394 /* Signature */
395 #define SIGNATURE_0 0x1E
396 #define SIGNATURE_1 0x91
397 #define SIGNATURE_2 0x09
398 
401 #endif /* _AVR_IOTN26_H_ */