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

io8534.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/io8534.h - definitions for AT90C8534 */
00027 
00028 #ifndef _AVR_IO8534_
00029 #define _AVR_IO8534_ 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_ "io8534.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 /* 0x00..0x03 reserved */
00048 
00049 /* ADC Data Register */
00050 #define ADCW    _SFR_IO16(0x04)
00051 #define ADCL    _SFR_IO8(0x04)
00052 #define ADCH    _SFR_IO8(0x05)
00053 
00054 /* ADC Control and Status Register */
00055 #define ADCSR   _SFR_IO8(0x06)
00056 
00057 /* ADC Multiplexer Select Register */
00058 #define ADMUX   _SFR_IO8(0x07)
00059 
00060 /* 0x08..0x0F reserved */
00061 
00062 /* General Interrupt Pin Register */
00063 #define GIPR    _SFR_IO8(0x10)
00064 
00065 /* 0x11..0x19 reserved */
00066 
00067 /* Data Direction Register, Port A */
00068 #define DDRA    _SFR_IO8(0x1A)
00069 
00070 /* Data Register, Port A */
00071 #define PORTA   _SFR_IO8(0x1B)
00072 
00073 /* EEPROM Control Register */
00074 #define EECR    _SFR_IO8(0x1C)
00075 
00076 /* EEPROM Data Register */
00077 #define EEDR    _SFR_IO8(0x1D)
00078 
00079 /* EEPROM Address Register */
00080 #define EEAR    _SFR_IO16(0x1E)
00081 #define EEARL   _SFR_IO8(0x1E)
00082 #define EEARH   _SFR_IO8(0x1F)
00083 
00084 /* 0x20..0x2B reserved */
00085 
00086 /* Timer/Counter1 */
00087 #define TCNT1   _SFR_IO16(0x2C)
00088 #define TCNT1L  _SFR_IO8(0x2C)
00089 #define TCNT1H  _SFR_IO8(0x2D)
00090 
00091 /* Timer/Counter1 Control Register */
00092 #define TCCR1   _SFR_IO8(0x2E)
00093 
00094 /* 0x2F..0x31 reserved */
00095 
00096 /* Timer/Counter0 (8-bit) */
00097 #define TCNT0   _SFR_IO8(0x32)
00098 
00099 /* Timer/Counter0 Control Register */
00100 #define TCCR0   _SFR_IO8(0x33)
00101 
00102 /* 0x34 reserved */
00103 
00104 /* MCU general Control Register */
00105 #define MCUCR   _SFR_IO8(0x35)
00106 
00107 /* 0x36..0x37 reserved */
00108 
00109 /* Timer/Counter Interrupt Flag Register */
00110 #define TIFR    _SFR_IO8(0x38)
00111 
00112 /* Timer/Counter Interrupt MaSK Register */
00113 #define TIMSK   _SFR_IO8(0x39)
00114 
00115 /* General Interrupt Flag Register */
00116 #define GIFR    _SFR_IO8(0x3A)
00117 
00118 /* General Interrupt MaSK register */
00119 #define GIMSK   _SFR_IO8(0x3B)
00120 
00121 /* 0x3C reserved */
00122 
00123 /* Stack Pointer */
00124 #define SP      _SFR_IO16(0x3D)
00125 #define SPL     _SFR_IO8(0x3D)
00126 #define SPH     _SFR_IO8(0x3E)
00127 
00128 /* Status REGister */
00129 #define SREG    _SFR_IO8(0x3F)
00130 
00131 /* Interrupt vectors */
00132 
00133 #define SIG_INTERRUPT0          _VECTOR(1)
00134 #define SIG_INTERRUPT1          _VECTOR(2)
00135 #define SIG_OVERFLOW1           _VECTOR(3)
00136 #define SIG_OVERFLOW0           _VECTOR(4)
00137 #define SIG_ADC                 _VECTOR(5)
00138 #define SIG_EEPROM_READY        _VECTOR(6)
00139 
00140 #define _VECTORS_SIZE 14
00141 
00142 /* Bit numbers */
00143 
00144 /* GIMSK */
00145 #define INT1    7
00146 #define INT0    6
00147 
00148 /* GIFR */
00149 #define INTF1   7
00150 #define INTF0   6
00151 
00152 /* GIPR */
00153 #define IPIN1   3
00154 #define IPIN0   2
00155 
00156 /* TIMSK */
00157 #define TOIE1   2
00158 #define TOIE0   0
00159 
00160 /* TIFR */
00161 #define TOV1    2
00162 #define TOV0    0
00163 
00164 /* MCUCR */
00165 #define SE      6
00166 #define SM      5
00167 #define ISC1    2
00168 #define ISC0    0
00169 
00170 /* TCCR0 */
00171 #define CS02    2
00172 #define CS01    1
00173 #define CS00    0
00174 
00175 /* TCCR1 */
00176 #define CS12    2
00177 #define CS11    1
00178 #define CS10    0
00179 
00180 /* EECR */
00181 #define EERIE   3
00182 #define EEMWE   2
00183 #define EEWE    1
00184 #define EERE    0
00185 
00186 /* PORTA */
00187 #define PA7     7
00188 #define PA6     6
00189 #define PA5     5
00190 #define PA4     4
00191 #define PA3     3
00192 #define PA2     2
00193 #define PA1     1
00194 #define PA0     0
00195 
00196 /* DDRA */
00197 #define DDA7    7
00198 #define DDA6    6
00199 #define DDA5    5
00200 #define DDA4    4
00201 #define DDA3    3
00202 #define DDA2    2
00203 #define DDA1    1
00204 #define DDA0    0
00205 
00206 /* Pointer registers (same for all AVR devices so far) */
00207 #define XL r26
00208 #define XH r27
00209 #define YL r28
00210 #define YH r29
00211 #define ZL r30
00212 #define ZH r31
00213 
00214 /* Last memory addresses */
00215 #define RAMEND          0x15F
00216 #define XRAMEND         0x15F
00217 #define E2END           0x1FF
00218 #define FLASHEND        0x1FFF
00219 
00220 #endif /* _AVR_IO8534_H_ */

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