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
iom162.h
Go to the documentation of this file.
1
9
/*
10
* Copyright (c) 2002, Nils Kristian Strom <nilsst@omegav.ntnu.no>
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_IOM162_H_
42
#define _AVR_IOM162_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_ "iom162.h"
57
#else
58
# error "Attempt to include more than one <avr/ioXXX.h> file."
59
#endif
60
61
/* Memory mapped I/O registers */
62
63
/* Timer/Counter3 Control Register A */
64
#define TCCR3A _SFR_MEM8(0x8B)
65
66
/* Timer/Counter3 Control Register B */
67
#define TCCR3B _SFR_MEM8(0x8A)
68
69
/* Timer/Counter3 - Counter Register */
70
#define TCNT3H _SFR_MEM8(0x89)
71
#define TCNT3L _SFR_MEM8(0x88)
72
#define TCNT3 _SFR_MEM16(0x88)
73
74
/* Timer/Counter3 - Output Compare Register A */
75
#define OCR3AH _SFR_MEM8(0x87)
76
#define OCR3AL _SFR_MEM8(0x86)
77
#define OCR3A _SFR_MEM16(0x86)
78
79
/* Timer/Counter3 - Output Compare Register B */
80
#define OCR3BH _SFR_MEM8(0x85)
81
#define OCR3BL _SFR_MEM8(0x84)
82
#define OCR3B _SFR_MEM16(0x84)
83
84
/* Timer/Counter3 - Input Capture Register */
85
#define ICR3H _SFR_MEM8(0x81)
86
#define ICR3L _SFR_MEM8(0x80)
87
#define ICR3 _SFR_MEM16(0x80)
88
89
/* Extended Timer/Counter Interrupt Mask */
90
#define ETIMSK _SFR_MEM8(0x7D)
91
92
/* Extended Timer/Counter Interrupt Flag Register */
93
#define ETIFR _SFR_MEM8(0x7C)
94
95
/* Pin Change Mask Register 1 */
96
#define PCMSK1 _SFR_MEM8(0x6C)
97
98
/* Pin Change Mask Register 0 */
99
#define PCMSK0 _SFR_MEM8(0x6B)
100
101
/* Clock PRescale */
102
#define CLKPR _SFR_MEM8(0x61)
103
104
105
/* Standard I/O registers */
106
107
/* 0x3F SREG */
108
/* 0x3D..0x3E SP */
109
#define UBRR1H _SFR_IO8(0x3C)
/* USART 1 Baud Rate Register High Byte, Shared with UCSR1C */
110
#define UCSR1C _SFR_IO8(0x3C)
/* USART 1 Control and Status Register, Shared with UBRR1H */
111
#define GICR _SFR_IO8(0x3B)
/* General Interrupt Control Register */
112
#define GIFR _SFR_IO8(0x3A)
/* General Interrupt Flag Register */
113
#define TIMSK _SFR_IO8(0x39)
/* Timer Interrupt Mask */
114
#define TIFR _SFR_IO8(0x38)
/* Timer Interrupt Flag Register */
115
#define SPMCR _SFR_IO8(0x37)
/* Store Program Memory Control Register */
116
#define EMCUCR _SFR_IO8(0x36)
/* Extended MCU Control Register */
117
#define MCUCR _SFR_IO8(0x35)
/* MCU Control Register */
118
#define MCUCSR _SFR_IO8(0x34)
/* MCU Control and Status Register */
119
#define TCCR0 _SFR_IO8(0x33)
/* Timer/Counter 0 Control Register */
120
#define TCNT0 _SFR_IO8(0x32)
/* TImer/Counter 0 */
121
#define OCR0 _SFR_IO8(0x31)
/* Output Compare Register 0 */
122
#define SFIOR _SFR_IO8(0x30)
/* Special Function I/O Register */
123
#define TCCR1A _SFR_IO8(0x2F)
/* Timer/Counter 1 Control Register A */
124
#define TCCR1B _SFR_IO8(0x2E)
/* Timer/Counter 1 Control Register A */
125
#define TCNT1H _SFR_IO8(0x2D)
/* Timer/Counter 1 High Byte */
126
#define TCNT1L _SFR_IO8(0x2C)
/* Timer/Counter 1 Low Byte */
127
#define TCNT1 _SFR_IO16(0x2C)
/* Timer/Counter 1 */
128
#define OCR1AH _SFR_IO8(0x2B)
/* Timer/Counter 1 Output Compare Register A High Byte */
129
#define OCR1AL _SFR_IO8(0x2A)
/* Timer/Counter 1 Output Compare Register A Low Byte */
130
#define OCR1A _SFR_IO16(0x2A)
/* Timer/Counter 1 Output Compare Register A */
131
#define OCR1BH _SFR_IO8(0x29)
/* Timer/Counter 1 Output Compare Register B High Byte */
132
#define OCR1BL _SFR_IO8(0x28)
/* Timer/Counter 1 Output Compare Register B Low Byte */
133
#define OCR1B _SFR_IO16(0x28)
/* Timer/Counter 1 Output Compare Register B */
134
#define TCCR2 _SFR_IO8(0x27)
/* Timer/Counter 2 Control Register */
135
#define ASSR _SFR_IO8(0x26)
/* Asynchronous Status Register */
136
#define ICR1H _SFR_IO8(0x25)
/* Input Capture Register 1 High Byte */
137
#define ICR1L _SFR_IO8(0x24)
/* Input Capture Register 1 Low Byte */
138
#define ICR1 _SFR_IO16(0x24)
/* Input Capture Register 1 */
139
#define TCNT2 _SFR_IO8(0x23)
/* Timer/Counter 2 */
140
#define OCR2 _SFR_IO8(0x22)
/* Timer/Counter 2 Output Compare Register */
141
#define WDTCR _SFR_IO8(0x21)
/* Watchdow Timer Control Register */
142
#define UBRR0H _SFR_IO8(0x20)
/* USART 0 Baud-Rate Register High Byte, Shared with UCSR0C */
143
#define UCSR0C _SFR_IO8(0x20)
/* USART 0 Control and Status Register C, Shared with UBRR0H */
144
#define EEARH _SFR_IO8(0x1F)
/* EEPROM Address Register High Byte */
145
#define EEARL _SFR_IO8(0x1E)
/* EEPROM Address Register Low Byte */
146
#define EEAR _SFR_IO16(0x1E)
/* EEPROM Address Register */
147
#define EEDR _SFR_IO8(0x1D)
/* EEPROM Data Register */
148
#define EECR _SFR_IO8(0x1C)
/* EEPROM Control Register */
149
#define PORTA _SFR_IO8(0x1B)
/* Port A */
150
#define DDRA _SFR_IO8(0x1A)
/* Port A Data Direction Register */
151
#define PINA _SFR_IO8(0x19)
/* Port A Pin Register */
152
#define PORTB _SFR_IO8(0x18)
/* Port B */
153
#define DDRB _SFR_IO8(0x17)
/* Port B Data Direction Register */
154
#define PINB _SFR_IO8(0x16)
/* Port B Pin Register */
155
#define PORTC _SFR_IO8(0x15)
/* Port C */
156
#define DDRC _SFR_IO8(0x14)
/* Port C Data Direction Register */
157
#define PINC _SFR_IO8(0x13)
/* Port C Pin Register */
158
#define PORTD _SFR_IO8(0x12)
/* Port D */
159
#define DDRD _SFR_IO8(0x11)
/* Port D Data Direction Register */
160
#define PIND _SFR_IO8(0x10)
/* Port D Pin Register */
161
#define SPDR _SFR_IO8(0x0F)
/* SPI Data Register */
162
#define SPSR _SFR_IO8(0x0E)
/* SPI Status Register */
163
#define SPCR _SFR_IO8(0x0D)
/* SPI Control Register */
164
#define UDR0 _SFR_IO8(0x0C)
/* USART 0 Data Register */
165
#define UCSR0A _SFR_IO8(0x0B)
/* USART 0 Control and Status Register A */
166
#define UCSR0B _SFR_IO8(0x0A)
/* USART 0 Control and Status Register B */
167
#define UBRR0L _SFR_IO8(0x09)
/* USART 0 Baud-Rate Register Low Byte */
168
#define ACSR _SFR_IO8(0x08)
/* Analog Comparator Status Register */
169
#define PORTE _SFR_IO8(0x07)
/* Port E */
170
#define DDRE _SFR_IO8(0x06)
/* Port E Data Direction Register */
171
#define PINE _SFR_IO8(0x05)
/* Port E Pin Register */
172
#define OSCCAL _SFR_IO8(0x04)
/* Oscillator Calibration, Shared with OCDR */
173
#define OCDR _SFR_IO8(0x04)
/* On-Chip Debug Register, Shared with OSCCAL */
174
#define UDR1 _SFR_IO8(0x03)
/* USART 1 Data Register */
175
#define UCSR1A _SFR_IO8(0x02)
/* USART 1 Control and Status Register A */
176
#define UCSR1B _SFR_IO8(0x01)
/* USART 1 Control and Status Register B */
177
#define UBRR1L _SFR_IO8(0x00)
/* USART 0 Baud Rate Register High Byte */
178
179
180
/* Interrupt vectors (byte addresses) */
181
182
/* External Interrupt Request 0 */
183
#define INT0_vect _VECTOR(1)
184
#define SIG_INTERRUPT0 _VECTOR(1)
185
186
/* External Interrupt Request 1 */
187
#define INT1_vect _VECTOR(2)
188
#define SIG_INTERRUPT1 _VECTOR(2)
189
190
/* External Interrupt Request 2 */
191
#define INT2_vect _VECTOR(3)
192
#define SIG_INTERRUPT2 _VECTOR(3)
193
194
/* Pin Change Interrupt Request 0 */
195
#define PCINT0_vect _VECTOR(4)
196
#define SIG_PIN_CHANGE0 _VECTOR(4)
197
198
/* Pin Change Interrupt Request 1 */
199
#define PCINT1_vect _VECTOR(5)
200
#define SIG_PIN_CHANGE1 _VECTOR(5)
201
202
/* Timer/Counter3 Capture Event */
203
#define TIMER3_CAPT_vect _VECTOR(6)
204
#define SIG_INPUT_CAPTURE3 _VECTOR(6)
205
206
/* Timer/Counter3 Compare Match A */
207
#define TIMER3_COMPA_vect _VECTOR(7)
208
#define SIG_OUTPUT_COMPARE3A _VECTOR(7)
209
210
/* Timer/Counter3 Compare Match B */
211
#define TIMER3_COMPB_vect _VECTOR(8)
212
#define SIG_OUTPUT_COMPARE3B _VECTOR(8)
213
214
/* Timer/Counter3 Overflow */
215
#define TIMER3_OVF_vect _VECTOR(9)
216
#define SIG_OVERFLOW3 _VECTOR(9)
217
218
/* Timer/Counter2 Compare Match */
219
#define TIMER2_COMP_vect _VECTOR(10)
220
#define SIG_OUTPUT_COMPARE2 _VECTOR(10)
221
222
/* Timer/Counter2 Overflow */
223
#define TIMER2_OVF_vect _VECTOR(11)
224
#define SIG_OVERFLOW2 _VECTOR(11)
225
226
/* Timer/Counter1 Capture Event */
227
#define TIMER1_CAPT_vect _VECTOR(12)
228
#define SIG_INPUT_CAPTURE1 _VECTOR(12)
229
230
/* Timer/Counter1 Compare Match A */
231
#define TIMER1_COMPA_vect _VECTOR(13)
232
#define SIG_OUTPUT_COMPARE1A _VECTOR(13)
233
234
/* Timer/Counter Compare Match B */
235
#define TIMER1_COMPB_vect _VECTOR(14)
236
#define SIG_OUTPUT_COMPARE1B _VECTOR(14)
237
238
/* Timer/Counter1 Overflow */
239
#define TIMER1_OVF_vect _VECTOR(15)
240
#define SIG_OVERFLOW1 _VECTOR(15)
241
242
/* Timer/Counter0 Compare Match */
243
#define TIMER0_COMP_vect _VECTOR(16)
244
#define SIG_OUTPUT_COMPARE0 _VECTOR(16)
245
246
/* Timer/Counter0 Overflow */
247
#define TIMER0_OVF_vect _VECTOR(17)
248
#define SIG_OVERFLOW0 _VECTOR(17)
249
250
/* SPI Serial Transfer Complete */
251
#define SPI_STC_vect _VECTOR(18)
252
#define SIG_SPI _VECTOR(18)
253
254
/* USART0, Rx Complete */
255
#define USART0_RXC_vect _VECTOR(19)
256
#define SIG_USART0_RECV _VECTOR(19)
257
258
/* USART1, Rx Complete */
259
#define USART1_RXC_vect _VECTOR(20)
260
#define SIG_USART1_RECV _VECTOR(20)
261
262
/* USART0 Data register Empty */
263
#define USART0_UDRE_vect _VECTOR(21)
264
#define SIG_USART0_DATA _VECTOR(21)
265
266
/* USART1, Data register Empty */
267
#define USART1_UDRE_vect _VECTOR(22)
268
#define SIG_USART1_DATA _VECTOR(22)
269
270
/* USART0, Tx Complete */
271
#define USART0_TXC_vect _VECTOR(23)
272
#define SIG_USART0_TRANS _VECTOR(23)
273
274
/* USART1, Tx Complete */
275
#define USART1_TXC_vect _VECTOR(24)
276
#define SIG_USART1_TRANS _VECTOR(24)
277
278
/* EEPROM Ready */
279
#define EE_RDY_vect _VECTOR(25)
280
#define SIG_EEPROM_READY _VECTOR(25)
281
282
/* Analog Comparator */
283
#define ANA_COMP_vect _VECTOR(26)
284
#define SIG_COMPARATOR _VECTOR(26)
285
286
/* Store Program Memory Read */
287
#define SPM_RDY_vect _VECTOR(27)
288
#define SIG_SPM_READY _VECTOR(27)
289
290
#define _VECTORS_SIZE 112
/* = (num vec+1) * 4 */
291
292
293
294
295
296
/* TCCR3B bit definitions, memory mapped I/O */
297
298
#define ICNC3 7
299
#define ICES3 6
300
#define WGM33 4
301
#define WGM32 3
302
#define CS32 2
303
#define CS31 1
304
#define CS30 0
305
306
307
308
/* TCCR3A bit definitions, memory mapped I/O */
309
310
#define COM3A1 7
311
#define COM3A0 6
312
#define COM3B1 5
313
#define COM3B0 4
314
#define FOC3A 3
315
#define FOC3B 2
316
#define WGM31 1
317
#define WGM30 0
318
319
320
321
/* ETIMSK bit definitions, memory mapped I/O */
322
323
#define TICIE3 5
324
#define OCIE3A 4
325
#define OCIE3B 3
326
#define TOIE3 2
327
328
329
330
/* ETIFR bit definitions, memory mapped I/O */
331
332
#define ICF3 5
333
#define OCF3A 4
334
#define OCF3B 3
335
#define TOV3 2
336
337
338
339
/* PCMSK1 bit definitions, memory mapped I/O */
340
#define PCINT15 7
341
#define PCINT14 6
342
#define PCINT13 5
343
#define PCINT12 4
344
#define PCINT11 3
345
#define PCINT10 2
346
#define PCINT9 1
347
#define PCINT8 0
348
349
350
351
/* PCMSK0 bit definitions, memory mapped I/O */
352
353
#define PCINT7 7
354
#define PCINT6 6
355
#define PCINT5 5
356
#define PCINT4 4
357
#define PCINT3 3
358
#define PCINT2 2
359
#define PCINT1 1
360
#define PCINT0 0
361
362
363
364
/* CLKPR bit definitions, memory mapped I/O */
365
366
#define CLKPCE 7
367
#define CLKPS3 3
368
#define CLKPS2 2
369
#define CLKPS1 1
370
#define CLKPS0 0
371
372
373
374
/* SPH bit definitions */
375
376
#define SP15 15
377
#define SP14 14
378
#define SP13 13
379
#define SP12 12
380
#define SP11 11
381
#define SP10 10
382
#define SP9 9
383
#define SP8 8
384
385
386
387
/* SPL bit definitions */
388
389
#define SP7 7
390
#define SP6 6
391
#define SP5 5
392
#define SP4 4
393
#define SP3 3
394
#define SP2 2
395
#define SP1 1
396
#define SP0 0
397
398
399
400
/* UBRR1H bit definitions */
401
402
#define URSEL1 7
403
#define UBRR111 3
404
#define UBRR110 2
405
#define UBRR19 1
406
#define UBRR18 0
407
408
409
410
/* UCSR1C bit definitions */
411
412
#define URSEL1 7
413
#define UMSEL1 6
414
#define UPM11 5
415
#define UPM10 4
416
#define USBS1 3
417
#define UCSZ11 2
418
#define UCSZ10 1
419
#define UCPOL1 0
420
421
422
423
/* GICR bit definitions */
424
425
#define INT1 7
426
#define INT0 6
427
#define INT2 5
428
#define PCIE1 4
429
#define PCIE0 3
430
#define IVSEL 1
431
#define IVCE 0
432
433
434
435
/* GIFR bit definitions */
436
437
#define INTF1 7
438
#define INTF0 6
439
#define INTF2 5
440
#define PCIF1 4
441
#define PCIF0 3
442
443
444
445
/* TIMSK bit definitions */
446
447
#define TOIE1 7
448
#define OCIE1A 6
449
#define OCIE1B 5
450
#define OCIE2 4
451
#define TICIE1 3
452
#define TOIE2 2
453
#define TOIE0 1
454
#define OCIE0 0
455
456
457
458
/* TIFR bit definitions */
459
460
#define TOV1 7
461
#define OCF1A 6
462
#define OCF1B 5
463
#define OCF2 4
464
#define ICF1 3
465
#define TOV2 2
466
#define TOV0 1
467
#define OCF0 0
468
469
470
471
/* SPMCR bit definitions */
472
473
#define SPMIE 7
474
#define RWWSB 6
475
#define RWWSRE 4
476
#define BLBSET 3
477
#define PGWRT 2
478
#define PGERS 1
479
#define SPMEN 0
480
481
482
483
/* EMCUCR bit definitions */
484
485
#define SM0 7
486
#define SRL2 6
487
#define SRL1 5
488
#define SRL0 4
489
#define SRW01 3
490
#define SRW00 2
491
#define SRW11 1
492
#define ISC2 0
493
494
495
496
/* MCUCR bit definitions */
497
498
#define SRE 7
499
#define SRW10 6
500
#define SE 5
501
#define SM1 4
502
#define ISC11 3
503
#define ISC10 2
504
#define ISC01 1
505
#define ISC00 0
506
507
508
509
/* MCUCSR bit definitions */
510
511
#define JTD 7
512
#define SM2 5
513
#define JTRF 4
514
#define WDRF 3
515
#define BORF 2
516
#define EXTRF 1
517
#define PORF 0
518
519
520
521
/* TCCR0 bit definitions */
522
523
#define FOC0 7
524
#define WGM00 6
525
#define COM01 5
526
#define COM00 4
527
#define WGM01 3
528
#define CS02 2
529
#define CS01 1
530
#define CS00 0
531
532
533
534
/* SFIOR bit definitions */
535
536
#define TSM 7
537
#define XMBK 6
538
#define XMM2 5
539
#define XMM1 4
540
#define XMM0 3
541
#define PUD 2
542
#define PSR2 1
543
#define PSR310 0
544
545
546
547
/* TCCR1A bit definitions */
548
549
#define COM1A1 7
550
#define COM1A0 6
551
#define COM1B1 5
552
#define COM1B0 4
553
#define FOC1A 3
554
#define FOC1B 2
555
#define WGM11 1
556
#define WGM10 0
557
558
559
560
561
/* TCCR1B bit definitions */
562
563
#define ICNC1 7
/* Input Capture Noise Canceler */
564
#define ICES1 6
/* Input Capture Edge Select */
565
#define WGM13 4
/* Waveform Generation Mode 3 */
566
#define WGM12 3
/* Waveform Generation Mode 2 */
567
#define CS12 2
/* Clock Select 2 */
568
#define CS11 1
/* Clock Select 1 */
569
#define CS10 0
/* Clock Select 0 */
570
571
572
573
/* TCCR2 bit definitions */
574
575
#define FOC2 7
576
#define WGM20 6
577
#define COM21 5
578
#define COM20 4
579
#define WGM21 3
580
#define CS22 2
581
#define CS21 1
582
#define CS20 0
583
584
585
586
/* ASSR bit definitions */
587
588
#define AS2 3
589
#define TCN2UB 2
590
#define TCON2UB 2
/* Kept for backwards compatibility. */
591
#define OCR2UB 1
592
#define TCR2UB 0
593
594
595
596
/* WDTCR bit definitions */
597
598
#define WDCE 4
599
#define WDE 3
600
#define WDP2 2
601
#define WDP1 1
602
#define WDP0 0
603
604
605
606
/* UBRR0H bif definitions */
607
608
#define URSEL0 7
609
#define UBRR011 3
610
#define UBRR010 2
611
#define UBRR09 1
612
#define UBRR08 0
613
614
615
616
/* UCSR0C bit definitions */
617
618
#define URSEL0 7
619
#define UMSEL0 6
620
#define UPM01 5
621
#define UPM00 4
622
#define USBS0 3
623
#define UCSZ01 2
624
#define UCSZ00 1
625
#define UCPOL0 0
626
627
628
629
/* EEARH bit definitions */
630
631
#define EEAR8 0
632
633
634
635
/* EECR bit definitions */
636
637
#define EERIE 3
638
#define EEMWE 2
639
#define EEWE 1
640
#define EERE 0
641
642
643
644
/* PORTA bit definitions */
645
646
#define PA7 7
647
#define PA6 6
648
#define PA5 5
649
#define PA4 4
650
#define PA3 3
651
#define PA2 2
652
#define PA1 1
653
#define PA0 0
654
655
656
657
/* DDRA bit definitions */
658
659
#define DDA7 7
660
#define DDA6 6
661
#define DDA5 5
662
#define DDA4 4
663
#define DDA3 3
664
#define DDA2 2
665
#define DDA1 1
666
#define DDA0 0
667
668
669
670
/* PINA bit definitions */
671
672
#define PINA7 7
673
#define PINA6 6
674
#define PINA5 5
675
#define PINA4 4
676
#define PINA3 3
677
#define PINA2 2
678
#define PINA1 1
679
#define PINA0 0
680
681
682
/* PORTB bit definitions */
683
684
#define PB7 7
685
#define PB6 6
686
#define PB5 5
687
#define PB4 4
688
#define PB3 3
689
#define PB2 2
690
#define PB1 1
691
#define PB0 0
692
693
694
695
/* DDRB bit definitions */
696
697
#define DDB7 7
698
#define DDB6 6
699
#define DDB5 5
700
#define DDB4 4
701
#define DDB3 3
702
#define DDB2 2
703
#define DDB1 1
704
#define DDB0 0
705
706
707
708
/* PINB bit definitions */
709
710
#define PINB7 7
711
#define PINB6 6
712
#define PINB5 5
713
#define PINB4 4
714
#define PINB3 3
715
#define PINB2 2
716
#define PINB1 1
717
#define PINB0 0
718
719
720
721
/* PORTC bit definitions */
722
723
#define PC7 7
724
#define PC6 6
725
#define PC5 5
726
#define PC4 4
727
#define PC3 3
728
#define PC2 2
729
#define PC1 1
730
#define PC0 0
731
732
733
734
/* DDRC bit definitions */
735
736
#define DDC7 7
737
#define DDC6 6
738
#define DDC5 5
739
#define DDC4 4
740
#define DDC3 3
741
#define DDC2 2
742
#define DDC1 1
743
#define DDC0 0
744
745
746
747
/* PINC bit definitions */
748
749
#define PINC7 7
750
#define PINC6 6
751
#define PINC5 5
752
#define PINC4 4
753
#define PINC3 3
754
#define PINC2 2
755
#define PINC1 1
756
#define PINC0 0
757
758
759
760
/* PORTD bit definitions */
761
762
#define PD7 7
763
#define PD6 6
764
#define PD5 5
765
#define PD4 4
766
#define PD3 3
767
#define PD2 2
768
#define PD1 1
769
#define PD0 0
770
771
772
773
/* DDRD bit definitions */
774
775
#define DDD7 7
776
#define DDD6 6
777
#define DDD5 5
778
#define DDD4 4
779
#define DDD3 3
780
#define DDD2 2
781
#define DDD1 1
782
#define DDD0 0
783
784
785
786
/* PIND bit definitions */
787
788
#define PIND7 7
789
#define PIND6 6
790
#define PIND5 5
791
#define PIND4 4
792
#define PIND3 3
793
#define PIND2 2
794
#define PIND1 1
795
#define PIND0 0
796
797
798
799
/* SPSR bit definitions */
800
801
#define SPIF 7
802
#define WCOL 6
803
#define SPI2X 0
804
805
806
807
/* SPCR bit definitions */
808
809
#define SPIE 7
810
#define SPE 6
811
#define DORD 5
812
#define MSTR 4
813
#define CPOL 3
814
#define CPHA 2
815
#define SPR1 1
816
#define SPR0 0
817
818
819
820
/* UCSR0A bit definitions */
821
822
#define RXC0 7
823
#define TXC0 6
824
#define UDRE0 5
825
#define FE0 4
826
#define DOR0 3
827
#define UPE0 2
828
#define U2X0 1
829
#define MPCM0 0
830
831
832
833
/* UCSR0B bit definitions */
834
835
#define RXCIE0 7
836
#define TXCIE0 6
837
#define UDRIE0 5
838
#define RXEN0 4
839
#define TXEN0 3
840
#define UCSZ02 2
841
#define RXB80 1
842
#define TXB80 0
843
844
845
846
/* ACSR bit definitions */
847
848
#define ACD 7
849
#define ACBG 6
850
#define ACO 5
851
#define ACI 4
852
#define ACIE 3
853
#define ACIC 2
854
#define ACIS1 1
855
#define ACIS0 0
856
857
858
859
/* PORTE bit definitions */
860
861
#define PE2 2
862
#define PE1 1
863
#define PE0 0
864
865
866
867
/* DDRE bit definitions */
868
869
#define DDE2 2
870
#define DDE1 1
871
#define DDE0 0
872
873
874
875
/* PINE bit definitions */
876
877
#define PINE2 2
878
#define PINE1 1
879
#define PINE0 0
880
881
882
883
/* UCSR1A bit definitions */
884
885
#define RXC1 7
886
#define TXC1 6
887
#define UDRE1 5
888
#define FE1 4
889
#define DOR1 3
890
#define UPE1 2
891
#define U2X1 1
892
#define MPCM1 0
893
894
895
896
/* UCSR1B bit definitions */
897
898
#define RXCIE1 7
899
#define TXCIE1 6
900
#define UDRIE1 5
901
#define RXEN1 4
902
#define TXEN1 3
903
#define UCSZ12 2
904
#define RXB81 1
905
#define TXB81 0
906
907
908
/* Constants */
909
#define SPM_PAGESIZE 128
910
#define RAMEND 0x4FF
911
#define XRAMEND 0xFFFF
912
#define E2END 0x1FF
913
#define E2PAGESIZE 4
914
#define FLASHEND 0x3FFF
915
916
917
/* Fuses */
918
919
#define FUSE_MEMORY_SIZE 3
920
921
/* Low Fuse Byte */
922
#define FUSE_CKSEL0 (unsigned char)~_BV(0)
923
#define FUSE_CKSEL1 (unsigned char)~_BV(1)
924
#define FUSE_CKSEL2 (unsigned char)~_BV(2)
925
#define FUSE_CKSEL3 (unsigned char)~_BV(3)
926
#define FUSE_SUT0 (unsigned char)~_BV(4)
927
#define FUSE_SUT1 (unsigned char)~_BV(5)
928
#define FUSE_CKOUT (unsigned char)~_BV(6)
929
#define FUSE_CKDIV8 (unsigned char)~_BV(7)
930
#define LFUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0 & FUSE_CKDIV8)
931
932
/* High Fuse Byte */
933
#define FUSE_BOOTRST (unsigned char)~_BV(0)
934
#define FUSE_BOOTSZ0 (unsigned char)~_BV(1)
935
#define FUSE_BOOTSZ1 (unsigned char)~_BV(2)
936
#define FUSE_EESAVE (unsigned char)~_BV(3)
937
#define FUSE_WDTON (unsigned char)~_BV(4)
938
#define FUSE_SPIEN (unsigned char)~_BV(5)
939
#define FUSE_JTAGEN (unsigned char)~_BV(6)
940
#define FUSE_OCDEN (unsigned char)~_BV(7)
941
#define HFUSE_DEFAULT (FUSE_BOOTSZ0 & FUSE_BOOTSZ1 & FUSE_SPIEN & FUSE_JTAGEN)
942
943
/* Extended Fuse Byte */
944
#define FUSE_BODLEVEL0 (unsigned char)~_BV(1)
945
#define FUSE_BODLEVEL1 (unsigned char)~_BV(2)
946
#define FUSE_BODLEVEL2 (unsigned char)~_BV(3)
947
#define FUSE_M161C (unsigned char)~_BV(4)
948
#define EFUSE_DEFAULT (0xFF)
949
950
951
/* Lock Bits */
952
#define __LOCK_BITS_EXIST
953
#define __BOOT_LOCK_BITS_0_EXIST
954
#define __BOOT_LOCK_BITS_1_EXIST
955
956
957
/* Signature */
958
#define SIGNATURE_0 0x1E
959
#define SIGNATURE_1 0x94
960
#define SIGNATURE_2 0x04
961
962
964
#endif
/* _AVR_IOM162_H_ */
Generated by
1.8.13