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

io2313.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/io2313.h - definitions for AT90S2313 */
00027 
00028 #ifndef _AVR_IO2313_H_
00029 #define _AVR_IO2313_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_ "io2313.h"
00039 #else
00040 #  error "Attempt to include more than one <avr/ioXXX.h> file."
00041 #endif 
00042 
00043 #include <avr/sfr_defs.h>
00044 
00045 /* I/O registers */
00046 
00047 /* Analog Comparator Control and Status Register */
00048 #define ACSR    _SFR_IO8(0x08)
00049 
00050 /* UART Baud Rate Register */
00051 #define UBRR    _SFR_IO8(0x09)
00052 
00053 /* UART Control Register */
00054 #define UCR     _SFR_IO8(0x0A)
00055 
00056 /* UART Status Register */
00057 #define USR     _SFR_IO8(0x0B)
00058 
00059 /* UART I/O Data Register */
00060 #define UDR     _SFR_IO8(0x0C)
00061 
00062 /* Input Pins, Port D */
00063 #define PIND    _SFR_IO8(0x10)
00064 
00065 /* Data Direction Register, Port D */
00066 #define DDRD    _SFR_IO8(0x11)
00067 
00068 /* Data Register, Port D */
00069 #define PORTD   _SFR_IO8(0x12)
00070 
00071 /* Input Pins, Port B */
00072 #define PINB    _SFR_IO8(0x16)
00073 
00074 /* Data Direction Register, Port B */
00075 #define DDRB    _SFR_IO8(0x17)
00076 
00077 /* Data Register, Port B */
00078 #define PORTB   _SFR_IO8(0x18)
00079 
00080 /* EEPROM Control Register */
00081 #define EECR    _SFR_IO8(0x1C)
00082 
00083 /* EEPROM Data Register */
00084 #define EEDR    _SFR_IO8(0x1D)
00085 
00086 /* EEPROM Address Register */
00087 #define EEAR    _SFR_IO8(0x1E)
00088 #define EEARL   _SFR_IO8(0x1E)
00089 
00090 /* Watchdog Timer Control Register */
00091 #define WDTCR   _SFR_IO8(0x21)
00092 
00093 /* T/C 1 Input Capture Register */
00094 #define ICR1    _SFR_IO16(0x24)
00095 #define ICR1L   _SFR_IO8(0x24)
00096 #define ICR1H   _SFR_IO8(0x25)
00097 
00098 /* Output Compare Register 1 */
00099 #define OCR1    _SFR_IO16(0x2A)
00100 #define OCR1L   _SFR_IO8(0x2A)
00101 #define OCR1H   _SFR_IO8(0x2B)
00102 
00103 /* Timer/Counter 1 */
00104 #define TCNT1   _SFR_IO16(0x2C)
00105 #define TCNT1L  _SFR_IO8(0x2C)
00106 #define TCNT1H  _SFR_IO8(0x2D)
00107 
00108 /* Timer/Counter 1 Control and Status Register */
00109 #define TCCR1B  _SFR_IO8(0x2E)
00110 
00111 /* Timer/Counter 1 Control Register */
00112 #define TCCR1A  _SFR_IO8(0x2F)
00113 
00114 /* Timer/Counter 0 */
00115 #define TCNT0   _SFR_IO8(0x32)
00116 
00117 /* Timer/Counter 0 Control Register */
00118 #define TCCR0   _SFR_IO8(0x33)
00119 
00120 /* MCU general Control Register */
00121 #define MCUCR   _SFR_IO8(0x35)
00122 
00123 /* Timer/Counter Interrupt Flag register */
00124 #define TIFR    _SFR_IO8(0x38)
00125 
00126 /* Timer/Counter Interrupt MaSK register */
00127 #define TIMSK   _SFR_IO8(0x39)
00128 
00129 /* General Interrupt Flag Register */
00130 #define GIFR    _SFR_IO8(0x3A)
00131 
00132 /* General Interrupt MaSK register */
00133 #define GIMSK   _SFR_IO8(0x3B)
00134 
00135 /* Stack Pointer */
00136 #define SP      _SFR_IO8(0x3D)
00137 #define SPL     _SFR_IO8(0x3D)
00138 
00139 /* Status REGister */
00140 #define SREG    _SFR_IO8(0x3F)
00141 
00142 /* Interrupt vectors */
00143 
00144 #define SIG_INTERRUPT0          _VECTOR(1)
00145 #define SIG_INTERRUPT1          _VECTOR(2)
00146 #define SIG_INPUT_CAPTURE1      _VECTOR(3)
00147 #define SIG_OUTPUT_COMPARE1A    _VECTOR(4)
00148 #define SIG_OVERFLOW1           _VECTOR(5)
00149 #define SIG_OVERFLOW0           _VECTOR(6)
00150 #define SIG_UART_RECV           _VECTOR(7)
00151 #define SIG_UART_DATA           _VECTOR(8)
00152 #define SIG_UART_TRANS          _VECTOR(9)
00153 #define SIG_COMPARATOR          _VECTOR(10)
00154 
00155 #define _VECTORS_SIZE 22
00156 
00157 /*
00158  *  The Register Bit names are represented by their bit number (0-7).
00159  */     
00160  
00161 /* General Interrupt MaSK register */
00162 #define    INT1    7
00163 #define    INT0    6
00164  
00165 /* General Interrupt Flag Register */
00166 #define    INTF1   7
00167 #define    INTF0   6
00168  
00169 /* Timer/Counter Interrupt MaSK register */                 
00170 #define    TOIE1   7
00171 #define    OCIE1A  6
00172 #define    TICIE   3
00173 #define    TOIE0   1
00174  
00175 /* Timer/Counter Interrupt Flag register */                   
00176 #define    TOV1    7
00177 #define    OCF1A   6
00178 #define    ICF1    3
00179 #define    TOV0    1
00180  
00181 /* MCU general Control Register */ 
00182 #define    SE      5
00183 #define    SM      4
00184 #define    ISC11   3
00185 #define    ISC10   2
00186 #define    ISC01   1
00187 #define    ISC00   0
00188  
00189 /* Timer/Counter 0 Control Register */
00190 #define    CS02    2
00191 #define    CS01    1
00192 #define    CS00    0
00193  
00194 /* Timer/Counter 1 Control Register */
00195 #define    COM1A1  7
00196 #define    COM1A0  6
00197 #define    PWM11   1
00198 #define    PWM10   0
00199  
00200 /* Timer/Counter 1 Control and Status Register */
00201 #define    ICNC1   7
00202 #define    ICES1   6
00203 #define    CTC1    3
00204 #define    CS12    2
00205 #define    CS11    1
00206 #define    CS10    0
00207                         
00208 /* Watchdog Timer Control Register */
00209 #define    WDTOE   4
00210 #define    WDE     3
00211 #define    WDP2    2
00212 #define    WDP1    1
00213 #define    WDP0    0
00214  
00215 /* EEPROM Control Register */
00216 #define    EEMWE   2
00217 #define    EEWE    1
00218 #define    EERE    0
00219  
00220 /* Data Register, Port B */  
00221 #define    PB7     7
00222 #define    PB6     6
00223 #define    PB5     5
00224 #define    PB4     4
00225 #define    PB3     3
00226 #define    PB2     2
00227 #define    PB1     1
00228 #define    PB0     0
00229  
00230 /* Data Direction Register, Port B */
00231 #define    DDB7    7
00232 #define    DDB6    6
00233 #define    DDB5    5
00234 #define    DDB4    4
00235 #define    DDB3    3
00236 #define    DDB2    2
00237 #define    DDB1    1
00238 #define    DDB0    0
00239  
00240 /* Input Pins, Port B */
00241 #define    PINB7   7
00242 #define    PINB6   6
00243 #define    PINB5   5
00244 #define    PINB4   4
00245 #define    PINB3   3
00246 #define    PINB2   2
00247 #define    PINB1   1
00248 #define    PINB0   0
00249  
00250 /* Data Register, Port D */
00251 #define    PD6     6
00252 #define    PD5     5
00253 #define    PD4     4
00254 #define    PD3     3
00255 #define    PD2     2
00256 #define    PD1     1
00257 #define    PD0     0
00258  
00259 /* Data Direction Register, Port D */
00260 #define    DDD6    6
00261 #define    DDD5    5
00262 #define    DDD4    4
00263 #define    DDD3    3
00264 #define    DDD2    2
00265 #define    DDD1    1
00266 #define    DDD0    0
00267  
00268 /* Input Pins, Port D */
00269 #define    PIND6   6
00270 #define    PIND5   5
00271 #define    PIND4   4
00272 #define    PIND3   3
00273 #define    PIND2   2
00274 #define    PIND1   1
00275 #define    PIND0   0
00276  
00277 /* UART Status Register */
00278 #define    RXC     7
00279 #define    TXC     6
00280 #define    UDRE    5
00281 #define    FE      4
00282 #define    DOR     3
00283  
00284 /* UART Control Register */
00285 #define    RXCIE   7
00286 #define    TXCIE   6
00287 #define    UDRIE   5
00288 #define    RXEN    4
00289 #define    TXEN    3
00290 #define    CHR9    2
00291 #define    RXB8    1
00292 #define    TXB8    0
00293        
00294 /* Analog Comparator Control and Status Register */ 
00295 #define    ACD     7
00296 #define    ACO     5
00297 #define    ACI     4
00298 #define    ACIE    3
00299 #define    ACIC    2
00300 #define    ACIS1   1
00301 #define    ACIS0   0
00302        
00303 /* Pointer definition   */ 
00304 #define    XL     r26
00305 #define    XH     r27
00306 #define    YL     r28
00307 #define    YH     r29
00308 #define    ZL     r30
00309 #define    ZH     r31
00310        
00311 /* Constants */ 
00312 #define    RAMEND    0xDF
00313 #define    XRAMEND   0xDF
00314 #define    E2END     0x7F
00315 #define    FLASHEND  0x07FF
00316 
00317 #endif  /* _AVR_IO2313_H_ */

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