1
/* Copyright (c) 2002, Steinar Haugen
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright
10
notice, this list of conditions and the following disclaimer in
11
the documentation and/or other materials provided with the
14
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24
POSSIBILITY OF SUCH DAMAGE. */
26
/* $Id: iom32.h,v 1.5 2003/02/17 09:57:28 marekm Exp $ */
28
/* avr/iom32.h - definitions for ATmega32 */
31
#define _AVR_IOM32_H_ 1
33
/* This file should only be included from <avr/io.h>, never directly. */
36
# error "Include <avr/io.h> instead of this file."
40
# define _AVR_IOXXX_H_ "iom32.h"
42
# error "Attempt to include more than one <avr/ioXXX.h> file."
47
/* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
48
#define TWBR _SFR_IO8(0x00)
49
#define TWSR _SFR_IO8(0x01)
50
#define TWAR _SFR_IO8(0x02)
51
#define TWDR _SFR_IO8(0x03)
55
#define ADC _SFR_IO16(0x04)
57
#define ADCW _SFR_IO16(0x04)
58
#define ADCL _SFR_IO8(0x04)
59
#define ADCH _SFR_IO8(0x05)
60
#define ADCSRA _SFR_IO8(0x06)
61
#define ADMUX _SFR_IO8(0x07)
63
/* analog comparator */
64
#define ACSR _SFR_IO8(0x08)
67
#define UBRRL _SFR_IO8(0x09)
68
#define UCSRB _SFR_IO8(0x0A)
69
#define UCSRA _SFR_IO8(0x0B)
70
#define UDR _SFR_IO8(0x0C)
73
#define SPCR _SFR_IO8(0x0D)
74
#define SPSR _SFR_IO8(0x0E)
75
#define SPDR _SFR_IO8(0x0F)
78
#define PIND _SFR_IO8(0x10)
79
#define DDRD _SFR_IO8(0x11)
80
#define PORTD _SFR_IO8(0x12)
83
#define PINC _SFR_IO8(0x13)
84
#define DDRC _SFR_IO8(0x14)
85
#define PORTC _SFR_IO8(0x15)
88
#define PINB _SFR_IO8(0x16)
89
#define DDRB _SFR_IO8(0x17)
90
#define PORTB _SFR_IO8(0x18)
93
#define PINA _SFR_IO8(0x19)
94
#define DDRA _SFR_IO8(0x1A)
95
#define PORTA _SFR_IO8(0x1B)
97
/* 0x1C..0x1F EEPROM */
99
#define UBRRH _SFR_IO8(0x20)
102
#define WDTCR _SFR_IO8(0x21)
104
#define ASSR _SFR_IO8(0x22)
107
#define OCR2 _SFR_IO8(0x23)
108
#define TCNT2 _SFR_IO8(0x24)
109
#define TCCR2 _SFR_IO8(0x25)
112
#define ICR1 _SFR_IO16(0x26)
113
#define ICR1L _SFR_IO8(0x26)
114
#define ICR1H _SFR_IO8(0x27)
115
#define OCR1B _SFR_IO16(0x28)
116
#define OCR1BL _SFR_IO8(0x28)
117
#define OCR1BH _SFR_IO8(0x29)
118
#define OCR1A _SFR_IO16(0x2A)
119
#define OCR1AL _SFR_IO8(0x2A)
120
#define OCR1AH _SFR_IO8(0x2B)
121
#define TCNT1 _SFR_IO16(0x2C)
122
#define TCNT1L _SFR_IO8(0x2C)
123
#define TCNT1H _SFR_IO8(0x2D)
124
#define TCCR1B _SFR_IO8(0x2E)
125
#define TCCR1A _SFR_IO8(0x2F)
127
#define SFIOR _SFR_IO8(0x30)
129
#define OSCCAL _SFR_IO8(0x31)
133
#define TCNT0 _SFR_IO8(0x32)
134
#define TCCR0 _SFR_IO8(0x33)
136
#define MCUSR _SFR_IO8(0x34)
138
#define MCUCR _SFR_IO8(0x35)
140
#define TWCR _SFR_IO8(0x36)
142
#define SPMCR _SFR_IO8(0x37)
144
#define TIFR _SFR_IO8(0x38)
145
#define TIMSK _SFR_IO8(0x39)
147
#define GIFR _SFR_IO8(0x3A)
148
#define GIMSK _SFR_IO8(0x3B)
151
#define OCR0 _SFR_IO8(0x3C)
157
/* Interrupt vectors */
159
#define SIG_INTERRUPT0 _VECTOR(1)
160
#define SIG_INTERRUPT1 _VECTOR(2)
161
#define SIG_INTERRUPT2 _VECTOR(3)
162
#define SIG_OUTPUT_COMPARE2 _VECTOR(4)
163
#define SIG_OVERFLOW2 _VECTOR(5)
164
#define SIG_INPUT_CAPTURE1 _VECTOR(6)
165
#define SIG_OUTPUT_COMPARE1A _VECTOR(7)
166
#define SIG_OUTPUT_COMPARE1B _VECTOR(8)
167
#define SIG_OVERFLOW1 _VECTOR(9)
168
#define SIG_OUTPUT_COMPARE0 _VECTOR(10)
169
#define SIG_OVERFLOW0 _VECTOR(11)
170
#define SIG_SPI _VECTOR(12)
171
#define SIG_UART_RECV _VECTOR(13)
172
#define SIG_UART_DATA _VECTOR(14)
173
#define SIG_UART_TRANS _VECTOR(15)
174
#define SIG_ADC _VECTOR(16)
175
#define SIG_EEPROM_READY _VECTOR(17)
176
#define SIG_COMPARATOR _VECTOR(18)
177
#define SIG_2WIRE_SERIAL _VECTOR(19)
178
#define SIG_SPM_READY _VECTOR(20)
180
#define _VECTORS_SIZE 84
307
/* bits 7-4 reserved */
334
/* bits 7-5 reserved */
341
/* PA7-PA0 = ADC7-ADC0 */
493
/* bits 5-1 reserved */
567
#define SPM_PAGESIZE 128
569
#define XRAMEND 0x85F
571
#define FLASHEND 0x7FFF
573
#endif /* _AVR_IOM32_H_ */