Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

io1200.h

00001 /* Copyright (c) 2002, Marek Michalkiewicz
00002    All rights reserved.
00003 
00004    Redistribution and use in source and binary forms, with or without
00005    modification, are permitted provided that the following conditions are met:
00006 
00007    * Redistributions of source code must retain the above copyright
00008      notice, this list of conditions and the following disclaimer.
00009    * Redistributions in binary form must reproduce the above copyright
00010      notice, this list of conditions and the following disclaimer in
00011      the documentation and/or other materials provided with the
00012      distribution.
00013 
00014   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00015   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00017   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00018   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00019   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00020   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00021   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00022   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00023   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00024   POSSIBILITY OF SUCH DAMAGE. */
00025 
00026 /* avr/io1200.h - definitions for AT90S1200 */
00027 
00028 #ifndef _AVR_IO1200_H_
00029 #define _AVR_IO1200_H_ 1
00030 
00031 /* This file should only be included from <avr/io.h>, never directly. */
00032 
00033 #ifndef _AVR_IO_H_
00034 #  error "Include <avr/io.h> instead of this file."
00035 #endif
00036 
00037 #ifndef _AVR_IOXXX_H_
00038 #  define _AVR_IOXXX_H_ "io1200.h"
00039 #else
00040 #  error "Attempt to include more than one <avr/ioXXX.h> file."
00041 #endif 
00042 
00043 #ifndef __ASSEMBLER__
00044 #  warning "MCU not supported by the C compiler"
00045 #endif
00046 
00047 #include <avr/sfr_defs.h>
00048 
00049 /* I/O registers */
00050 
00051 /* 0x00..0x07 reserved */
00052 
00053 /* Analog Comparator Control and Status Register */
00054 #define ACSR    _SFR_IO8(0x08)
00055 
00056 /* 0x09..0x0F reserved */
00057 
00058 #define PIND    _SFR_IO8(0x10)
00059 #define DDRD    _SFR_IO8(0x11)
00060 #define PORTD   _SFR_IO8(0x12)
00061 
00062 /* 0x13..0x15 reserved */
00063 
00064 #define PINB    _SFR_IO8(0x16)
00065 #define DDRB    _SFR_IO8(0x17)
00066 #define PORTB   _SFR_IO8(0x18)
00067 
00068 /* 0x19..0x1B reserved */
00069 
00070 #define EECR    _SFR_IO8(0x1C)
00071 #define EEDR    _SFR_IO8(0x1D)
00072 #define EEARL   _SFR_IO8(0x1E)
00073 
00074 /* 0x1F..0x20 reserved */
00075 
00076 /* Watchdog Timer Control Register */
00077 #define WDTCR   _SFR_IO8(0x21)
00078 
00079 /* 0x22..0x31 reserved */
00080 
00081 #define TCNT0   _SFR_IO8(0x32)
00082 #define TCCR0   _SFR_IO8(0x33)
00083 
00084 /* 0x34 reserved */
00085 
00086 #define MCUCR   _SFR_IO8(0x35)
00087 
00088 /* 0x36..0x37 reserved */
00089 
00090 /* Timer/Counter Interrupt Flag Register */
00091 #define TIFR    _SFR_IO8(0x38)
00092 
00093 /* Timer/Counter Interrupt MaSK Register */
00094 #define TIMSK   _SFR_IO8(0x39)
00095 
00096 /* 0x3A reserved */
00097 
00098 #define GIMSK   _SFR_IO8(0x3B)
00099 
00100 /* 0x3C..0x3E reserved */
00101 
00102 #define SREG    _SFR_IO8(0x3F)
00103 
00104 /* Interrupt vectors */
00105 
00106 #define SIG_INTERRUPT0          _VECTOR(1)
00107 #define SIG_OVERFLOW0           _VECTOR(2)
00108 #define SIG_COMPARATOR          _VECTOR(3)
00109 
00110 #define _VECTORS_SIZE 8
00111 
00112 /* Bit numbers */
00113 
00114 /* GIMSK */
00115 #define INT0    6
00116 
00117 /* TIMSK */
00118 #define TOIE0   1
00119 
00120 /* TIFR */
00121 #define TOV0    1
00122 
00123 /* MCUCR */
00124 #define SE      5
00125 #define SM      4
00126 #define ISC01   1
00127 #define ISC00   0
00128 
00129 /* TCCR0 */
00130 #define CS02    2
00131 #define CS01    1
00132 #define CS00    0
00133 
00134 /* WDTCR */
00135 #define WDE     3
00136 #define WDP2    2
00137 #define WDP1    1
00138 #define WDP0    0
00139 
00140 /* EECR */
00141 #define EEWE    1
00142 #define EERE    0
00143 
00144 /*
00145    PB7 = SCK
00146    PB6 = MISO
00147    PB5 = MOSI
00148    PB1 = AIN1
00149    PB0 = AIN0
00150  */
00151 
00152 /* PORTB */
00153 #define PB7     7
00154 #define PB6     6
00155 #define PB5     5
00156 #define PB4     4
00157 #define PB3     3
00158 #define PB2     2
00159 #define PB1     1
00160 #define PB0     0
00161 
00162 /* DDRB */
00163 #define DDB7    7
00164 #define DDB6    6
00165 #define DDB5    5
00166 #define DDB4    4
00167 #define DDB3    3
00168 #define DDB2    2
00169 #define DDB1    1
00170 #define DDB0    0
00171 
00172 /* PINB */
00173 #define PINB7   7
00174 #define PINB6   6
00175 #define PINB5   5
00176 #define PINB4   4
00177 #define PINB3   3
00178 #define PINB2   2
00179 #define PINB1   1
00180 #define PINB0   0
00181 
00182 /* PORTD */
00183 #define PD6     6
00184 #define PD5     5
00185 #define PD4     4
00186 #define PD3     3
00187 #define PD2     2
00188 #define PD1     1
00189 #define PD0     0
00190 
00191 /* DDRD */
00192 #define DDD6    6
00193 #define DDD5    5
00194 #define DDD4    4
00195 #define DDD3    3
00196 #define DDD2    2
00197 #define DDD1    1
00198 #define DDD0    0
00199 
00200 /* PIND */
00201 #define PIND6   6
00202 #define PIND5   5
00203 #define PIND4   4
00204 #define PIND3   3
00205 #define PIND2   2
00206 #define PIND1   1
00207 #define PIND0   0
00208 
00209 /* ACSR */
00210 #define ACD     7
00211 #define ACO     5
00212 #define ACI     4
00213 #define ACIE    3
00214 #define ACIS1   1
00215 #define ACIS0   0
00216 
00217 #define ZL r30
00218 
00219 /* Last memory addresses */
00220 #define RAMEND          0x1F
00221 #define XRAMEND         0x0
00222 #define E2END           0x3F
00223 #define FLASHEND        0x3FF
00224 
00225 #endif  /* _AVR_IO1200_H_ */

Generated on Thu Jan 30 22:30:45 2003 for EduNet by doxygen1.2.18