RTEMS CPU Kit with SuperCore  4.11.3
iotnx5.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2005, 2007, 2009 Anatoly Sokolov
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_IOTNX5_H_
42 #define _AVR_IOTNX5_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_ "iotnx5.h"
57 #else
58 # error "Attempt to include more than one <avr/ioXXX.h> file."
59 #endif
60 
61 /* I/O registers */
62 
63 /* Reserved [0x00..0x02] */
64 
65 #define ADCSRB _SFR_IO8 (0x03)
66 #define BIN 7
67 #define ACME 6
68 #define IPR 5
69 #define ADTS2 2
70 #define ADTS1 1
71 #define ADTS0 0
72 
73 #ifndef __ASSEMBLER__
74 #define ADC _SFR_IO16(0x04)
75 #endif
76 #define ADCW _SFR_IO16(0x04)
77 #define ADCL _SFR_IO8(0x04)
78 #define ADCH _SFR_IO8(0x05)
79 
80 #define ADCSRA _SFR_IO8 (0x06)
81 #define ADEN 7
82 #define ADSC 6
83 #define ADATE 5
84 #define ADIF 4
85 #define ADIE 3
86 #define ADPS2 2
87 #define ADPS1 1
88 #define ADPS0 0
89 
90 #define ADMUX _SFR_IO8(0x07)
91 #define REFS1 7
92 #define REFS0 6
93 #define ADLAR 5
94 #define REFS2 4
95 #define MUX3 3
96 #define MUX2 2
97 #define MUX1 1
98 #define MUX0 0
99 
100 #define ACSR _SFR_IO8(0x08)
101 #define ACD 7
102 #define ACBG 6
103 #define ACO 5
104 #define ACI 4
105 #define ACIE 3
106 #define ACIS1 1
107 #define ACIS0 0
108 
109 /* Reserved [0x09..0x0C] */
110 
111 #define USICR _SFR_IO8(0x0D)
112 #define USISIE 7
113 #define USIOIE 6
114 #define USIWM1 5
115 #define USIWM0 4
116 #define USICS1 3
117 #define USICS0 2
118 #define USICLK 1
119 #define USITC 0
120 
121 #define USISR _SFR_IO8(0x0E)
122 #define USISIF 7
123 #define USIOIF 6
124 #define USIPF 5
125 #define USIDC 4
126 #define USICNT3 3
127 #define USICNT2 2
128 #define USICNT1 1
129 #define USICNT0 0
130 
131 #define USIDR _SFR_IO8(0x0F)
132 #define USIBR _SFR_IO8(0x10)
133 
134 #define GPIOR0 _SFR_IO8(0x11)
135 #define GPIOR1 _SFR_IO8(0x12)
136 #define GPIOR2 _SFR_IO8(0x13)
137 
138 #define DIDR0 _SFR_IO8(0x14)
139 #define ADC0D 5
140 #define ADC2D 4
141 #define ADC3D 3
142 #define ADC1D 2
143 #define AIN1D 1
144 #define AIN0D 0
145 
146 #define PCMSK _SFR_IO8(0x15)
147 #define PCINT5 5
148 #define PCINT4 4
149 #define PCINT3 3
150 #define PCINT2 2
151 #define PCINT1 1
152 #define PCINT0 0
153 
154 #define PINB _SFR_IO8(0x16)
155 #define PINB5 5
156 #define PINB4 4
157 #define PINB3 3
158 #define PINB2 2
159 #define PINB1 1
160 #define PINB0 0
161 
162 #define DDRB _SFR_IO8(0x17)
163 #define DDB5 5
164 #define DDB4 4
165 #define DDB3 3
166 #define DDB2 2
167 #define DDB1 1
168 #define DDB0 0
169 
170 #define PORTB _SFR_IO8(0x18)
171 #define PB5 5
172 #define PB4 4
173 #define PB3 3
174 #define PB2 2
175 #define PB1 1
176 #define PB0 0
177 
178 /* Reserved [0x19..0x1B] */
179 
180 /* EEPROM Control Register EECR */
181 #define EECR _SFR_IO8(0x1C)
182 #define EEPM1 5
183 #define EEPM0 4
184 #define EERIE 3
185 #define EEMPE 2
186 #define EEPE 1
187 #define EERE 0
188 
189 /* EEPROM Data Register */
190 #define EEDR _SFR_IO8(0x1D)
191 
192 /* EEPROM Address Register */
193 #define EEAR _SFR_IO16(0x1E)
194 #define EEARL _SFR_IO8(0x1E)
195 #define EEARH _SFR_IO8(0x1F)
196 
197 #define PRR _SFR_IO8(0x20)
198 #define PRTIM1 3
199 #define PRTIM0 2
200 #define PRUSI 1
201 #define PRADC 0
202 
203 #define WDTCR _SFR_IO8(0x21)
204 #define WDIF 7
205 #define WDIE 6
206 #define WDP3 5
207 #define WDCE 4
208 #define WDE 3
209 #define WDP2 2
210 #define WDP1 1
211 #define WDP0 0
212 
213 #define DWDR _SFR_IO8(0x22)
214 
215 #define DTPS1 _SFR_IO8(0x23)
216 #define DTPS11 1
217 #define DTPS10 0
218 
219 #define DT1B _SFR_IO8(0x24)
220 #define DT1BH3 7
221 #define DT1BH2 6
222 #define DT1BH1 5
223 #define DT1BH0 4
224 #define DT1BL3 3
225 #define DT1BL2 2
226 #define DT1BL1 1
227 #define DT1BL0 0
228 
229 #define DT1A _SFR_IO8(0x25)
230 #define DT1AH3 7
231 #define DT1AH2 6
232 #define DT1AH1 5
233 #define DT1AH0 4
234 #define DT1AL3 3
235 #define DT1AL2 2
236 #define DT1AL1 1
237 #define DT1AL0 0
238 
239 #define CLKPR _SFR_IO8(0x26)
240 #define CLKPCE 7
241 #define CLKPS3 3
242 #define CLKPS2 2
243 #define CLKPS1 1
244 #define CLKPS0 0
245 
246 #define PLLCSR _SFR_IO8(0x27)
247 #define LSM 7
248 #define PCKE 2
249 #define PLLE 1
250 #define PLOCK 0
251 
252 #define OCR0B _SFR_IO8(0x28)
253 
254 #define OCR0A _SFR_IO8(0x29)
255 
256 #define TCCR0A _SFR_IO8(0x2A)
257 #define COM0A1 7
258 #define COM0A0 6
259 #define COM0B1 5
260 #define COM0B0 4
261 #define WGM01 1
262 #define WGM00 0
263 
264 #define OCR1B _SFR_IO8(0x2B)
265 
266 #define GTCCR _SFR_IO8(0x2C)
267 #define TSM 7
268 #define PWM1B 6
269 #define COM1B1 5
270 #define COM1B0 4
271 #define FOC1B 3
272 #define FOC1A 2
273 #define PSR1 1
274 #define PSR0 0
275 
276 #define OCR1C _SFR_IO8(0x2D)
277 
278 #define OCR1A _SFR_IO8(0x2E)
279 
280 #define TCNT1 _SFR_IO8(0x2F)
281 
282 #define TCCR1 _SFR_IO8(0x30)
283 #define CTC1 7
284 #define PWM1A 6
285 #define COM1A1 5
286 #define COM1A0 4
287 #define CS13 3
288 #define CS12 2
289 #define CS11 1
290 #define CS10 0
291 
292 #define OSCCAL _SFR_IO8(0x31)
293 
294 #define TCNT0 _SFR_IO8(0x32)
295 
296 #define TCCR0B _SFR_IO8(0x33)
297 #define FOC0A 7
298 #define FOC0B 6
299 #define WGM02 3
300 #define CS02 2
301 #define CS01 1
302 #define CS00 0
303 
304 #define MCUSR _SFR_IO8(0x34)
305 #define WDRF 3
306 #define BORF 2
307 #define EXTRF 1
308 #define PORF 0
309 
310 #define MCUCR _SFR_IO8(0x35)
311 #define BODS 7
312 #define PUD 6
313 #define SE 5
314 #define SM1 4
315 #define SM0 3
316 #define BODSE 2
317 #define ISC01 1
318 #define ISC00 0
319 
320 /* Reserved [0x36] */
321 
322 #define SPMCSR _SFR_IO8(0x37)
323 #define RSIG 5
324 #define CTPB 4
325 #define RFLB 3
326 #define PGWRT 2
327 #define PGERS 1
328 #define SPMEN 0
329 
330 #define TIFR _SFR_IO8(0x38)
331 #define OCF1A 6
332 #define OCF1B 5
333 #define OCF0A 4
334 #define OCF0B 3
335 #define TOV1 2
336 #define TOV0 1
337 
338 #define TIMSK _SFR_IO8(0x39)
339 #define OCIE1A 6
340 #define OCIE1B 5
341 #define OCIE0A 4
342 #define OCIE0B 3
343 #define TOIE1 2
344 #define TOIE0 1
345 
346 #define GIFR _SFR_IO8(0x3A)
347 #define INTF0 6
348 #define PCIF 5
349 
350 #define GIMSK _SFR_IO8(0x3B)
351 #define INT0 6
352 #define PCIE 5
353 
354 /* Reserved [0x3C] */
355 
356 /* 0x3D..0x3E SP [defined in <avr/io.h>] */
357 /* 0x3F SREG [defined in <avr/io.h>] */
358 
360 
361 /* Interrupt vectors */
362 /* Interrupt vector 0 is the reset vector. */
363 /* External Interrupt 0 */
364 #define INT0_vect _VECTOR(1)
365 #define SIG_INTERRUPT0 _VECTOR(1)
366 
367 /* Pin change Interrupt Request 0 */
368 #define PCINT0_vect _VECTOR(2)
369 #define SIG_PIN_CHANGE _VECTOR(2)
370 
371 /* Timer/Counter1 Compare Match 1A */
372 #define TIM1_COMPA_vect _VECTOR(3)
373 #define TIMER1_COMPA_vect _VECTOR(3)
374 #define SIG_OUTPUT_COMPARE1A _VECTOR(3)
375 
376 /* Timer/Counter1 Overflow */
377 #define TIM1_OVF_vect _VECTOR(4)
378 #define TIMER1_OVF_vect _VECTOR(4)
379 #define SIG_OVERFLOW1 _VECTOR(4)
380 
381 /* Timer/Counter0 Overflow */
382 #define TIM0_OVF_vect _VECTOR(5)
383 #define TIMER0_OVF_vect _VECTOR(5)
384 #define SIG_OVERFLOW0 _VECTOR(5)
385 
386 /* EEPROM Ready */
387 #define EE_RDY_vect _VECTOR(6)
388 #define SIG_EEPROM_READY _VECTOR(6)
389 
390 /* Analog comparator */
391 #define ANA_COMP_vect _VECTOR(7)
392 #define SIG_COMPARATOR _VECTOR(7)
393 
394 /* ADC Conversion ready */
395 #define ADC_vect _VECTOR(8)
396 #define SIG_ADC _VECTOR(8)
397 
398 /* Timer/Counter1 Compare Match B */
399 #define TIM1_COMPB_vect _VECTOR(9)
400 #define TIMER1_COMPB_vect _VECTOR(9)
401 #define SIG_OUTPUT_COMPARE1B _VECTOR(9)
402 
403 /* Timer/Counter0 Compare Match A */
404 #define TIM0_COMPA_vect _VECTOR(10)
405 #define TIMER0_COMPA_vect _VECTOR(10)
406 #define SIG_OUTPUT_COMPARE0A _VECTOR(10)
407 
408 /* Timer/Counter0 Compare Match B */
409 #define TIM0_COMPB_vect _VECTOR(11)
410 #define TIMER0_COMPB_vect _VECTOR(11)
411 #define SIG_OUTPUT_COMPARE0B _VECTOR(11)
412 
413 /* Watchdog Time-out */
414 #define WDT_vect _VECTOR(12)
415 #define SIG_WATCHDOG_TIMEOUT _VECTOR(12)
416 
417 /* USI START */
418 #define USI_START_vect _VECTOR(13)
419 #define SIG_USI_START _VECTOR(13)
420 
421 /* USI Overflow */
422 #define USI_OVF_vect _VECTOR(14)
423 #define SIG_USI_OVERFLOW _VECTOR(14)
424 
425 #define _VECTORS_SIZE 30
426 
428 #endif /* _AVR_IOTNX5_H_ */