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

ioat94k.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/ioat94k.h - definitions for AT94K series FPSLIC(tm) */
00027 
00028 #ifndef _AVR_IOAT94K_H_
00029 #define _AVR_IOAT94K_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_ "ioat94k.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 /* UART1 Baud Rate Register */
00048 #define UBRR1   _SFR_IO8(0x00)
00049 
00050 /* UART1 Control and Status Registers */
00051 #define UCSR1B  _SFR_IO8(0x01)
00052 #define UCSR1A  _SFR_IO8(0x02)
00053 
00054 /* UART1 I/O Data Register */
00055 #define UDR1    _SFR_IO8(0x03)
00056 
00057 /* 0x04 reserved */
00058 
00059 /* Input Pins, Port E */
00060 #define PINE    _SFR_IO8(0x05)
00061 
00062 /* Data Direction Register, Port E */
00063 #define DDRE    _SFR_IO8(0x06)
00064 
00065 /* Data Register, Port E */
00066 #define PORTE   _SFR_IO8(0x07)
00067 
00068 /* 0x08 reserved */
00069 
00070 /* UART0 Baud Rate Register */
00071 #define UBRR0   _SFR_IO8(0x09)
00072 
00073 /* UART0 Control and Status Registers */
00074 #define UCSR0B  _SFR_IO8(0x0A)
00075 #define UCSR0A  _SFR_IO8(0x0B)
00076 
00077 /* UART0 I/O Data Register */
00078 #define UDR0    _SFR_IO8(0x0C)
00079 
00080 /* 0x0D..0x0F reserved */
00081 
00082 /* Input Pins, Port D */
00083 #define PIND    _SFR_IO8(0x10)
00084 
00085 /* Data Direction Register, Port D */
00086 #define DDRD    _SFR_IO8(0x11)
00087 
00088 /* Data Register, Port D */
00089 #define PORTD   _SFR_IO8(0x12)
00090 
00091 /* FPGA I/O Select Control Register */
00092 #define FISCR   _SFR_IO8(0x13)
00093 
00094 /* FPGA I/O Select Registers A, B, C, D */
00095 #define FISUA   _SFR_IO8(0x14)
00096 #define FISUB   _SFR_IO8(0x15)
00097 #define FISUC   _SFR_IO8(0x16)
00098 #define FISUD   _SFR_IO8(0x17)
00099 
00100 /* FPGA Cache Logic(R) registers (top secret, under NDA) */
00101 #define FPGAX   _SFR_IO8(0x18)
00102 #define FPGAY   _SFR_IO8(0x19)
00103 #define FPGAZ   _SFR_IO8(0x1A)
00104 #define FPGAD   _SFR_IO8(0x1B)
00105 
00106 /* TWI stands for "Two Wire Interface" or "TWI Was I2C(tm)" */
00107 
00108 /* 2-wire Serial Bit Rate Register */
00109 #define TWBR    _SFR_IO8(0x1C)
00110 
00111 /* 2-wire Serial Status Register */
00112 #define TWSR    _SFR_IO8(0x1D)
00113 
00114 /* 2-wire Serial (Slave) Address Register */
00115 #define TWAR    _SFR_IO8(0x1E)
00116 
00117 /* 2-wire Serial Data Register */
00118 #define TWDR    _SFR_IO8(0x1F)
00119 
00120 /* UART Baud Register High */
00121 #define UBRRH   _SFR_IO8(0x20)
00122 
00123 /* Watchdog Timer Control Register */
00124 #define WDTCR   _SFR_IO8(0x21)
00125 
00126 /* Timer/Counter2 Output Compare Register */
00127 #define OCR2    _SFR_IO8(0x22)
00128 
00129 /* Timer/Counter2 (8-bit) */
00130 #define TCNT2   _SFR_IO8(0x23)
00131 
00132 /* Timer/Counter1 Input Capture Register */
00133 #define ICR1    _SFR_IO16(0x24)
00134 #define ICR1L   _SFR_IO8(0x24)
00135 #define ICR1H   _SFR_IO8(0x25)
00136 
00137 /* Asynchronous mode StatuS Register */
00138 #define ASSR    _SFR_IO8(0x26)
00139 
00140 /* Timer/Counter2 Control Register */
00141 #define TCCR2   _SFR_IO8(0x27)
00142 
00143 /* Timer/Counter1 Output Compare RegisterB */
00144 #define OCR1B   _SFR_IO16(0x28)
00145 #define OCR1BL  _SFR_IO8(0x28)
00146 #define OCR1BH  _SFR_IO8(0x29)
00147 
00148 /* Timer/Counter1 Output Compare RegisterA */
00149 #define OCR1A   _SFR_IO16(0x2A)
00150 #define OCR1AL  _SFR_IO8(0x2A)
00151 #define OCR1AH  _SFR_IO8(0x2B)
00152 
00153 /* Timer/Counter1 */
00154 #define TCNT1   _SFR_IO16(0x2C)
00155 #define TCNT1L  _SFR_IO8(0x2C)
00156 #define TCNT1H  _SFR_IO8(0x2D)
00157 
00158 /* Timer/Counter1 Control Register B */
00159 #define TCCR1B  _SFR_IO8(0x2E)
00160 
00161 /* Timer/Counter1 Control Register A */
00162 #define TCCR1A  _SFR_IO8(0x2F)
00163 
00164 /* Special Function IO Register */
00165 #define SFIOR   _SFR_IO8(0x30)
00166 
00167 /* Timer/Counter0 Output Compare Register */
00168 #define OCR0    _SFR_IO8(0x31)
00169 
00170 /* Timer/Counter0 (8-bit) */
00171 #define TCNT0   _SFR_IO8(0x32)
00172 
00173 /* Timer/Counter0 Control Register */
00174 #define TCCR0   _SFR_IO8(0x33)
00175 
00176 /* 0x34 reserved */
00177 
00178 /* MCU Control/Status Register */
00179 #define MCUR    _SFR_IO8(0x35)
00180 
00181 /* 2-wire Serial Control Register */
00182 #define TWCR    _SFR_IO8(0x36)
00183 
00184 /* 0x37 reserved */
00185 
00186 /* Timer/Counter Interrupt Flag Register */
00187 #define TIFR    _SFR_IO8(0x38)
00188 
00189 /* Timer/Counter Interrupt MaSK Register */
00190 #define TIMSK   _SFR_IO8(0x39)
00191 
00192 /* Software Control Register */
00193 #define SFTCR   _SFR_IO8(0x3A)
00194 
00195 /* External Interrupt Mask/Flag Register */
00196 #define EIMF    _SFR_IO8(0x3B)
00197 
00198 /* 0x3C reserved */
00199 
00200 /* Stack Pointer */
00201 #define SPL     _SFR_IO8(0x3D)
00202 #define SPH     _SFR_IO8(0x3E)
00203 
00204 /* Status REGister */
00205 #define SREG    _SFR_IO8(0x3F)
00206 
00207 
00208 /* Interrupt vectors */
00209 
00210 #define SIG_INTERRUPT0          _VECTOR(1)
00211 #define SIG_FPGA_INTERRUPT0     _VECTOR(2)
00212 #define SIG_INTERRUPT1          _VECTOR(3)
00213 #define SIG_FPGA_INTERRUPT1     _VECTOR(4)
00214 #define SIG_INTERRUPT2          _VECTOR(5)
00215 #define SIG_FPGA_INTERRUPT2     _VECTOR(6)
00216 #define SIG_INTERRUPT3          _VECTOR(7)
00217 #define SIG_FPGA_INTERRUPT3     _VECTOR(8)
00218 #define SIG_OUTPUT_COMPARE2     _VECTOR(9)
00219 #define SIG_OVERFLOW2           _VECTOR(10)
00220 #define SIG_INPUT_CAPTURE1      _VECTOR(11)
00221 #define SIG_OUTPUT_COMPARE1A    _VECTOR(12)
00222 #define SIG_OUTPUT_COMPARE1B    _VECTOR(13)
00223 #define SIG_OVERFLOW1           _VECTOR(14)
00224 #define SIG_OUTPUT_COMPARE0     _VECTOR(15)
00225 #define SIG_OVERFLOW0           _VECTOR(16)
00226 #define SIG_FPGA_INTERRUPT4     _VECTOR(17)
00227 #define SIG_FPGA_INTERRUPT5     _VECTOR(18)
00228 #define SIG_FPGA_INTERRUPT6     _VECTOR(19)
00229 #define SIG_FPGA_INTERRUPT7     _VECTOR(20)
00230 #define SIG_UART0_RECV          _VECTOR(21)
00231 #define SIG_UART0_DATA          _VECTOR(22)
00232 #define SIG_UART0_TRANS         _VECTOR(23)
00233 #define SIG_FPGA_INTERRUPT8     _VECTOR(24)
00234 #define SIG_FPGA_INTERRUPT9     _VECTOR(25)
00235 #define SIG_FPGA_INTERRUPT10    _VECTOR(26)
00236 #define SIG_FPGA_INTERRUPT11    _VECTOR(27)
00237 #define SIG_UART1_RECV          _VECTOR(28)
00238 #define SIG_UART1_DATA          _VECTOR(29)
00239 #define SIG_UART1_TRANS         _VECTOR(30)
00240 #define SIG_FPGA_INTERRUPT12    _VECTOR(31)
00241 #define SIG_FPGA_INTERRUPT13    _VECTOR(32)
00242 #define SIG_FPGA_INTERRUPT14    _VECTOR(33)
00243 #define SIG_FPGA_INTERRUPT15    _VECTOR(34)
00244 #define SIG_2WIRE_SERIAL        _VECTOR(35)
00245 
00246 #define _VECTORS_SIZE 144
00247 
00248 /* Bit numbers - XXX not here yet */
00249 
00250 /* Pointer registers (same for all AVR devices so far) */
00251 #define XL r26
00252 #define XH r27
00253 #define YL r28
00254 #define YH r29
00255 #define ZL r30
00256 #define ZH r31
00257 
00258 /*
00259    Last memory addresses - depending on configuration, it is possible
00260    to have 20K-32K of program memory and 4K-16K of data memory
00261    (all in the same 36K total of SRAM, loaded from external EEPROM).
00262  */
00263 
00264 #ifndef RAMEND
00265 #define RAMEND 0x0FFF
00266 #endif
00267 
00268 #define E2END 0
00269 
00270 #ifndef FLASHEND
00271 #define FLASHEND 0x7FFF
00272 #endif
00273 
00274 #endif /* _AVR_IOAT94K_H_ */

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