RTEMS CPU Kit with SuperCore
4.11.3
Main Page
Related Pages
Modules
+
Data Structures
Data Structures
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
q
r
s
t
u
v
w
+
Variables
_
b
c
d
i
r
+
Typedefs
a
b
c
d
f
h
i
m
o
p
q
r
s
t
u
w
x
+
Enumerations
b
c
d
e
h
i
m
o
p
r
s
t
w
+
Enumerator
c
i
m
p
r
s
t
w
+
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
mnt
data0
chrisj
rtems
releases
rtems-release.git
4.11.3
ws-rtems
rtems-4.11.3
cpukit
score
cpu
avr
avr
iom8.h
Go to the documentation of this file.
1
9
/* Copyright (c) 2002, Marek Michalkiewicz
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/iom8.h - definitions for ATmega8 */
41
42
#ifndef _AVR_IOM8_H_
43
#define _AVR_IOM8_H_ 1
44
45
/* This file should only be included from <avr/io.h>, never directly. */
46
47
#ifndef _AVR_IO_H_
48
# error "Include <avr/io.h> instead of this file."
49
#endif
50
51
#ifndef _AVR_IOXXX_H_
52
# define _AVR_IOXXX_H_ "iom8.h"
53
#else
54
# error "Attempt to include more than one <avr/ioXXX.h> file."
55
#endif
56
65
/* I/O registers */
66
67
/* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
68
#define TWBR _SFR_IO8(0x00)
69
#define TWSR _SFR_IO8(0x01)
70
#define TWAR _SFR_IO8(0x02)
71
#define TWDR _SFR_IO8(0x03)
72
73
/* ADC */
74
#define ADCW _SFR_IO16(0x04)
75
#ifndef __ASSEMBLER__
76
#define ADC _SFR_IO16(0x04)
77
#endif
78
#define ADCL _SFR_IO8(0x04)
79
#define ADCH _SFR_IO8(0x05)
80
#define ADCSR _SFR_IO8(0x06)
81
#define ADCSRA _SFR_IO8(0x06)
/* Changed in 2486H-AVR-09/02 */
82
#define ADMUX _SFR_IO8(0x07)
83
84
/* analog comparator */
85
#define ACSR _SFR_IO8(0x08)
86
87
/* USART */
88
#define UBRRL _SFR_IO8(0x09)
89
#define UCSRB _SFR_IO8(0x0A)
90
#define UCSRA _SFR_IO8(0x0B)
91
#define UDR _SFR_IO8(0x0C)
92
93
/* SPI */
94
#define SPCR _SFR_IO8(0x0D)
95
#define SPSR _SFR_IO8(0x0E)
96
#define SPDR _SFR_IO8(0x0F)
97
98
/* Port D */
99
#define PIND _SFR_IO8(0x10)
100
#define DDRD _SFR_IO8(0x11)
101
#define PORTD _SFR_IO8(0x12)
102
103
/* Port C */
104
#define PINC _SFR_IO8(0x13)
105
#define DDRC _SFR_IO8(0x14)
106
#define PORTC _SFR_IO8(0x15)
107
108
/* Port B */
109
#define PINB _SFR_IO8(0x16)
110
#define DDRB _SFR_IO8(0x17)
111
#define PORTB _SFR_IO8(0x18)
112
113
/* EEPROM Control Register */
114
#define EECR _SFR_IO8(0x1C)
115
116
/* EEPROM Data Register */
117
#define EEDR _SFR_IO8(0x1D)
118
119
/* EEPROM Address Register */
120
#define EEAR _SFR_IO16(0x1E)
121
#define EEARL _SFR_IO8(0x1E)
122
#define EEARH _SFR_IO8(0x1F)
123
124
#define UCSRC _SFR_IO8(0x20)
125
#define UBRRH _SFR_IO8(0x20)
126
127
#define WDTCR _SFR_IO8(0x21)
128
#define ASSR _SFR_IO8(0x22)
129
130
/* Timer 2 */
131
#define OCR2 _SFR_IO8(0x23)
132
#define TCNT2 _SFR_IO8(0x24)
133
#define TCCR2 _SFR_IO8(0x25)
134
135
/* Timer 1 */
136
#define ICR1 _SFR_IO16(0x26)
137
#define ICR1L _SFR_IO8(0x26)
138
#define ICR1H _SFR_IO8(0x27)
139
#define OCR1B _SFR_IO16(0x28)
140
#define OCR1BL _SFR_IO8(0x28)
141
#define OCR1BH _SFR_IO8(0x29)
142
#define OCR1A _SFR_IO16(0x2A)
143
#define OCR1AL _SFR_IO8(0x2A)
144
#define OCR1AH _SFR_IO8(0x2B)
145
#define TCNT1 _SFR_IO16(0x2C)
146
#define TCNT1L _SFR_IO8(0x2C)
147
#define TCNT1H _SFR_IO8(0x2D)
148
#define TCCR1B _SFR_IO8(0x2E)
149
#define TCCR1A _SFR_IO8(0x2F)
150
151
#define SFIOR _SFR_IO8(0x30)
152
153
#define OSCCAL _SFR_IO8(0x31)
154
155
/* Timer 0 */
156
#define TCNT0 _SFR_IO8(0x32)
157
#define TCCR0 _SFR_IO8(0x33)
158
159
#define MCUCSR _SFR_IO8(0x34)
160
#define MCUSR _SFR_IO8(0x34)
/* Defined as an alias for MCUCSR. */
161
162
#define MCUCR _SFR_IO8(0x35)
163
164
#define TWCR _SFR_IO8(0x36)
165
166
#define SPMCR _SFR_IO8(0x37)
167
168
#define TIFR _SFR_IO8(0x38)
169
#define TIMSK _SFR_IO8(0x39)
170
171
#define GIFR _SFR_IO8(0x3A)
172
#define GIMSK _SFR_IO8(0x3B)
173
#define GICR _SFR_IO8(0x3B)
/* Changed in 2486H-AVR-09/02 */
174
175
/* 0x3C reserved (OCR0?) */
176
177
/* 0x3D..0x3E SP */
178
179
/* 0x3F SREG */
180
181
/* Interrupt vectors */
182
183
/* External Interrupt Request 0 */
184
#define INT0_vect _VECTOR(1)
185
#define SIG_INTERRUPT0 _VECTOR(1)
186
187
/* External Interrupt Request 1 */
188
#define INT1_vect _VECTOR(2)
189
#define SIG_INTERRUPT1 _VECTOR(2)
190
191
/* Timer/Counter2 Compare Match */
192
#define TIMER2_COMP_vect _VECTOR(3)
193
#define SIG_OUTPUT_COMPARE2 _VECTOR(3)
194
195
/* Timer/Counter2 Overflow */
196
#define TIMER2_OVF_vect _VECTOR(4)
197
#define SIG_OVERFLOW2 _VECTOR(4)
198
199
/* Timer/Counter1 Capture Event */
200
#define TIMER1_CAPT_vect _VECTOR(5)
201
#define SIG_INPUT_CAPTURE1 _VECTOR(5)
202
203
/* Timer/Counter1 Compare Match A */
204
#define TIMER1_COMPA_vect _VECTOR(6)
205
#define SIG_OUTPUT_COMPARE1A _VECTOR(6)
206
207
/* Timer/Counter1 Compare Match B */
208
#define TIMER1_COMPB_vect _VECTOR(7)
209
#define SIG_OUTPUT_COMPARE1B _VECTOR(7)
210
211
/* Timer/Counter1 Overflow */
212
#define TIMER1_OVF_vect _VECTOR(8)
213
#define SIG_OVERFLOW1 _VECTOR(8)
214
215
/* Timer/Counter0 Overflow */
216
#define TIMER0_OVF_vect _VECTOR(9)
217
#define SIG_OVERFLOW0 _VECTOR(9)
218
219
/* Serial Transfer Complete */
220
#define SPI_STC_vect _VECTOR(10)
221
#define SIG_SPI _VECTOR(10)
222
223
/* USART, Rx Complete */
224
#define USART_RXC_vect _VECTOR(11)
225
#define SIG_UART_RECV _VECTOR(11)
226
227
/* USART Data Register Empty */
228
#define USART_UDRE_vect _VECTOR(12)
229
#define SIG_UART_DATA _VECTOR(12)
230
231
/* USART, Tx Complete */
232
#define USART_TXC_vect _VECTOR(13)
233
#define SIG_UART_TRANS _VECTOR(13)
234
235
/* ADC Conversion Complete */
236
#define ADC_vect _VECTOR(14)
237
#define SIG_ADC _VECTOR(14)
238
239
/* EEPROM Ready */
240
#define EE_RDY_vect _VECTOR(15)
241
#define SIG_EEPROM_READY _VECTOR(15)
242
243
/* Analog Comparator */
244
#define ANA_COMP_vect _VECTOR(16)
245
#define SIG_COMPARATOR _VECTOR(16)
246
247
/* 2-wire Serial Interface */
248
#define TWI_vect _VECTOR(17)
249
#define SIG_2WIRE_SERIAL _VECTOR(17)
250
251
/* Store Program Memory Ready */
252
#define SPM_RDY_vect _VECTOR(18)
253
#define SIG_SPM_READY _VECTOR(18)
254
255
#define _VECTORS_SIZE 38
256
257
/* Bit numbers */
258
259
/* GIMSK / GICR */
260
#define INT1 7
261
#define INT0 6
262
#define IVSEL 1
263
#define IVCE 0
264
265
/* GIFR */
266
#define INTF1 7
267
#define INTF0 6
268
269
/* TIMSK */
270
#define OCIE2 7
271
#define TOIE2 6
272
#define TICIE1 5
273
#define OCIE1A 4
274
#define OCIE1B 3
275
#define TOIE1 2
276
/* bit 1 reserved (OCIE0?) */
277
#define TOIE0 0
278
279
/* TIFR */
280
#define OCF2 7
281
#define TOV2 6
282
#define ICF1 5
283
#define OCF1A 4
284
#define OCF1B 3
285
#define TOV1 2
286
/* bit 1 reserved (OCF0?) */
287
#define TOV0 0
288
289
/* SPMCR */
290
#define SPMIE 7
291
#define RWWSB 6
292
/* bit 5 reserved */
293
#define RWWSRE 4
294
#define BLBSET 3
295
#define PGWRT 2
296
#define PGERS 1
297
#define SPMEN 0
298
299
/* TWCR */
300
#define TWINT 7
301
#define TWEA 6
302
#define TWSTA 5
303
#define TWSTO 4
304
#define TWWC 3
305
#define TWEN 2
306
/* bit 1 reserved (TWI_TST?) */
307
#define TWIE 0
308
309
/* TWAR */
310
#define TWA6 7
311
#define TWA5 6
312
#define TWA4 5
313
#define TWA3 4
314
#define TWA2 3
315
#define TWA1 2
316
#define TWA0 1
317
#define TWGCE 0
318
319
/* TWSR */
320
#define TWS7 7
321
#define TWS6 6
322
#define TWS5 5
323
#define TWS4 4
324
#define TWS3 3
325
/* bit 2 reserved */
326
#define TWPS1 1
327
#define TWPS0 0
328
329
/* MCUCR */
330
#define SE 7
331
#define SM2 6
332
#define SM1 5
333
#define SM0 4
334
#define ISC11 3
335
#define ISC10 2
336
#define ISC01 1
337
#define ISC00 0
338
339
/* MCUCSR */
340
/* bits 7-4 reserved */
341
#define WDRF 3
342
#define BORF 2
343
#define EXTRF 1
344
#define PORF 0
345
346
/*
347
The ADHSM bit has been removed from all documentation,
348
as being not needed at all since the comparator has proven
349
to be fast enough even without feeding it more power.
350
*/
351
352
/* SFIOR */
353
/* bits 7-5 reserved */
354
#define ACME 3
355
#define PUD 2
356
#define PSR2 1
357
#define PSR10 0
358
359
/* TCCR0 */
360
/* bits 7-3 reserved */
361
#define CS02 2
362
#define CS01 1
363
#define CS00 0
364
365
/* TCCR2 */
366
#define FOC2 7
367
#define WGM20 6
368
#define COM21 5
369
#define COM20 4
370
#define WGM21 3
371
#define CS22 2
372
#define CS21 1
373
#define CS20 0
374
375
/* ASSR */
376
/* bits 7-4 reserved */
377
#define AS2 3
378
#define TCN2UB 2
379
#define OCR2UB 1
380
#define TCR2UB 0
381
382
/* TCCR1A */
383
#define COM1A1 7
384
#define COM1A0 6
385
#define COM1B1 5
386
#define COM1B0 4
387
#define FOC1A 3
388
#define FOC1B 2
389
#define WGM11 1
390
#define WGM10 0
391
392
/* TCCR1B */
393
#define ICNC1 7
394
#define ICES1 6
395
/* bit 5 reserved */
396
#define WGM13 4
397
#define WGM12 3
398
#define CS12 2
399
#define CS11 1
400
#define CS10 0
401
402
/* WDTCR */
403
/* bits 7-5 reserved */
404
#define WDCE 4
405
#define WDE 3
406
#define WDP2 2
407
#define WDP1 1
408
#define WDP0 0
409
410
/* UBRRH */
411
#define URSEL 7
412
413
/* UCSRC */
414
#define URSEL 7
415
#define UMSEL 6
416
#define UPM1 5
417
#define UPM0 4
418
#define USBS 3
419
#define UCSZ1 2
420
#define UCSZ0 1
421
#define UCPOL 0
422
423
/* PORTB */
424
#define PB7 7
425
#define PB6 6
426
#define PB5 5
427
#define PB4 4
428
#define PB3 3
429
#define PB2 2
430
#define PB1 1
431
#define PB0 0
432
433
/* DDRB */
434
#define DDB7 7
435
#define DDB6 6
436
#define DDB5 5
437
#define DDB4 4
438
#define DDB3 3
439
#define DDB2 2
440
#define DDB1 1
441
#define DDB0 0
442
443
/* PINB */
444
#define PINB7 7
445
#define PINB6 6
446
#define PINB5 5
447
#define PINB4 4
448
#define PINB3 3
449
#define PINB2 2
450
#define PINB1 1
451
#define PINB0 0
452
453
/* PORTC */
454
#define PC6 6
455
#define PC5 5
456
#define PC4 4
457
#define PC3 3
458
#define PC2 2
459
#define PC1 1
460
#define PC0 0
461
462
/* DDRC */
463
#define DDC6 6
464
#define DDC5 5
465
#define DDC4 4
466
#define DDC3 3
467
#define DDC2 2
468
#define DDC1 1
469
#define DDC0 0
470
471
/* PINC */
472
#define PINC6 6
473
#define PINC5 5
474
#define PINC4 4
475
#define PINC3 3
476
#define PINC2 2
477
#define PINC1 1
478
#define PINC0 0
479
480
/* PORTD */
481
#define PD7 7
482
#define PD6 6
483
#define PD5 5
484
#define PD4 4
485
#define PD3 3
486
#define PD2 2
487
#define PD1 1
488
#define PD0 0
489
490
/* DDRD */
491
#define DDD7 7
492
#define DDD6 6
493
#define DDD5 5
494
#define DDD4 4
495
#define DDD3 3
496
#define DDD2 2
497
#define DDD1 1
498
#define DDD0 0
499
500
/* PIND */
501
#define PIND7 7
502
#define PIND6 6
503
#define PIND5 5
504
#define PIND4 4
505
#define PIND3 3
506
#define PIND2 2
507
#define PIND1 1
508
#define PIND0 0
509
510
/* SPSR */
511
#define SPIF 7
512
#define WCOL 6
513
#define SPI2X 0
514
515
/* SPCR */
516
#define SPIE 7
517
#define SPE 6
518
#define DORD 5
519
#define MSTR 4
520
#define CPOL 3
521
#define CPHA 2
522
#define SPR1 1
523
#define SPR0 0
524
525
/* UCSRA */
526
#define RXC 7
527
#define TXC 6
528
#define UDRE 5
529
#define FE 4
530
#define DOR 3
531
#define PE 2
532
#define U2X 1
533
#define MPCM 0
534
535
/* UCSRB */
536
#define RXCIE 7
537
#define TXCIE 6
538
#define UDRIE 5
539
#define RXEN 4
540
#define TXEN 3
541
#define UCSZ2 2
542
#define RXB8 1
543
#define TXB8 0
544
545
/* ACSR */
546
#define ACD 7
547
#define ACBG 6
548
#define ACO 5
549
#define ACI 4
550
#define ACIE 3
551
#define ACIC 2
552
#define ACIS1 1
553
#define ACIS0 0
554
555
/* ADCSR / ADCSRA */
556
#define ADEN 7
557
#define ADSC 6
558
#define ADFR 5
559
#define ADIF 4
560
#define ADIE 3
561
#define ADPS2 2
562
#define ADPS1 1
563
#define ADPS0 0
564
565
/* ADMUX */
566
#define REFS1 7
567
#define REFS0 6
568
#define ADLAR 5
569
/* bit 4 reserved */
570
#define MUX3 3
571
#define MUX2 2
572
#define MUX1 1
573
#define MUX0 0
574
575
/* EEPROM Control Register */
576
#define EERIE 3
577
#define EEMWE 2
578
#define EEWE 1
579
#define EERE 0
580
581
/* Constants */
582
#define SPM_PAGESIZE 64
583
#define RAMEND 0x45F
584
#define XRAMEND RAMEND
585
#define E2END 0x1FF
586
#define E2PAGESIZE 4
587
#define FLASHEND 0x1FFF
588
589
590
/* Fuses */
591
592
#define FUSE_MEMORY_SIZE 2
593
594
/* Low Fuse Byte */
595
#define FUSE_CKSEL0 (unsigned char)~_BV(0)
596
#define FUSE_CKSEL1 (unsigned char)~_BV(1)
597
#define FUSE_CKSEL2 (unsigned char)~_BV(2)
598
#define FUSE_CKSEL3 (unsigned char)~_BV(3)
599
#define FUSE_SUT0 (unsigned char)~_BV(4)
600
#define FUSE_SUT1 (unsigned char)~_BV(5)
601
#define FUSE_BODEN (unsigned char)~_BV(6)
602
#define FUSE_BODLEVEL (unsigned char)~_BV(7)
603
#define LFUSE_DEFAULT (FUSE_SUT0 & FUSE_CKSEL3 & FUSE_CKSEL2 & FUSE_CKSEL1)
604
605
/* High Fuse Byte */
606
#define FUSE_BOOTRST (unsigned char)~_BV(0)
607
#define FUSE_BOOTSZ0 (unsigned char)~_BV(1)
608
#define FUSE_BOOTSZ1 (unsigned char)~_BV(2)
609
#define FUSE_EESAVE (unsigned char)~_BV(3)
610
#define FUSE_CKOPT (unsigned char)~_BV(4)
611
#define FUSE_SPIEN (unsigned char)~_BV(5)
612
#define FUSE_WDTON (unsigned char)~_BV(6)
613
#define FUSE_RSTDISBL (unsigned char)~_BV(7)
614
#define HFUSE_DEFAULT (FUSE_SPIEN & FUSE_BOOTSZ1 & FUSE_BOOTSZ0)
615
616
617
/* Lock Bits */
618
#define __LOCK_BITS_EXIST
619
#define __BOOT_LOCK_BITS_0_EXIST
620
#define __BOOT_LOCK_BITS_1_EXIST
621
622
623
/* Signature */
624
#define SIGNATURE_0 0x1E
625
#define SIGNATURE_1 0x93
626
#define SIGNATURE_2 0x07
627
630
#endif
/* _AVR_IOM8_H_ */
Generated by
1.8.13