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

iotn26.h

00001 /* Copyright (c) 2002, Stefan Swanepoel
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/iotn26.h - definitions for ATtiny26 */
00027 
00028 /* This file should only be included from <avr/io.h>, never directly. */
00029 
00030 #ifndef _AVR_IO_H_
00031 #  error "Include <avr/io.h> instead of this file."
00032 #endif
00033 
00034 #ifndef _AVR_IOXXX_H_
00035 #  define _AVR_IOXXX_H_ "iotn26.h"
00036 #else
00037 #  error "Attempt to include more than one <avr/ioXXX.h> file."
00038 #endif 
00039 
00040 #ifndef _AVR_IOTN26_H_
00041 #define _AVR_IOTN26_H_ 1
00042 
00043 #include <avr/sfr_defs.h>
00044 
00045 /* I/O registers */
00046 
00047 /* Input Pins, Port A */
00048 #define PINA    _SFR_IO8(0x19)
00049 
00050 /* Data Direction Register, Port A */
00051 #define DDRA    _SFR_IO8(0x1A)
00052 
00053 /* Data Register, Port A */
00054 #define PORTA   _SFR_IO8(0x1B)
00055 
00056 /* Input Pins, Port B */
00057 #define PINB    _SFR_IO8(0x16)
00058 
00059 /* Data Direction Register, Port B */
00060 #define DDRB    _SFR_IO8(0x17)
00061 
00062 /* Data Register, Port B */
00063 #define PORTB   _SFR_IO8(0x18)
00064 
00065 /* EEPROM Control Register */
00066 #define EECR    _SFR_IO8(0x1C)
00067 
00068 /* EEPROM Data Register */
00069 #define EEDR    _SFR_IO8(0x1D)
00070 
00071 /* EEPROM Address Register Low */
00072 #define EEAR    _SFR_IO8(0x1E)
00073 #define EEARL   _SFR_IO8(0x1E)
00074 
00075 /* Watchdog Timer Control Register */
00076 #define WDTCR   _SFR_IO8(0x21)
00077 
00078 /* Timer/Counter 0 */
00079 #define TCNT0   _SFR_IO8(0x32)
00080 
00081 /* Timer/Counter 0 Control Register */
00082 #define TCCR0   _SFR_IO8(0x33)
00083 
00084 /* Timer/Counter 1 Control Register A */
00085 #define TCCR1A _SFR_IO8(0x30)
00086 
00087 /* Timer/Counter 1 Control Register A */
00088 #define TCCR1B _SFR_IO8(0x2F)
00089 
00090 /* Timer/Counter 1 */
00091 #define TCNT1 _SFR_IO8(0x2E)
00092 
00093 /* Timer/Counter 1 Output Compare Register A */
00094 #define OCR1A   _SFR_IO8(0x2D)
00095 
00096 /* Timer/Counter 1 Output Compare Register B */
00097 #define OCR1B   _SFR_IO8(0x2C)
00098 
00099 /* Timer/Counter 1 Output Compare Register C */
00100 #define OCR1C   _SFR_IO8(0x2B)
00101 
00102 /* MCU Status Register */
00103 #define MCUSR   _SFR_IO8(0x34)
00104 
00105 /* MCU general Control Register */
00106 #define MCUCR   _SFR_IO8(0x35)
00107 
00108 /* Timer/Counter Interrupt Flag register */
00109 #define TIFR    _SFR_IO8(0x38)
00110 
00111 /* Timer/Counter Interrupt MaSK register */
00112 #define TIMSK   _SFR_IO8(0x39)
00113 
00114 /* General Interrupt Flag register */
00115 #define GIFR    _SFR_IO8(0x3A)
00116 
00117 /* General Interrupt MaSK register */
00118 #define GIMSK   _SFR_IO8(0x3B)
00119 
00120 /* Stack Pointer */
00121 #define SP      _SFR_IO8(0x3D)
00122 #define SPL     _SFR_IO8(0x3D)
00123 
00124 /* Status REGister */
00125 #define SREG    _SFR_IO8(0x3F)
00126 
00127 /* Interrupt vectors */
00128 
00129 #define SIG_INTERRUPT0              _VECTOR(1)
00130 #define SIG_INTERRUPT1              _VECTOR(2)
00131 #define SIG_OUTPUT_COMPARE1A  _VECTOR(3)
00132 #define SIG_OUTPUT_COMPARE1B  _VECTOR(4)
00133 #define SIG_OVERFLOW1           _VECTOR(5)
00134 #define SIG_OVERFLOW0           _VECTOR(6)
00135 #define SIG_USI_START           _VECTOR(7)
00136 #define SIG_USI_OVERFLOW      _VECTOR(8)
00137 #define SIG_EPROM_READY       _VECTOR(9)
00138 #define SIG_ANA_COMP          _VECTOR(10)
00139 #define SIG_ADC                       _VECTOR(11)
00140 
00141 #define _VECTORS_SIZE 24
00142 
00143 /*
00144    The Register Bit names are represented by their bit number (0-7).
00145  */
00146 
00147 /* General Interrupt MaSK register */
00148 #define    INT0    6
00149 #define    INTF0   6
00150 
00151 /* General Interrupt Flag Register */
00152 #define    TOIE0   1
00153 #define    TOV0    1
00154 
00155 /* MCU general Control Register */
00156 #define    SE      5
00157 #define    SM      4
00158 #define    ISC01   1
00159 #define    ISC00   0
00160 
00161 /* Timer/Counter 0 Control Register */
00162 #define    CS02    2
00163 #define    CS01    1
00164 #define    CS00    0
00165 
00166 /* Watchdog Timer Control Register */
00167 #define    WDTOE   4
00168 #define    WDE     3
00169 #define    WDP2    2
00170 #define    WDP1    1
00171 #define    WDP0    0
00172 
00173 /* EEPROM Control Register */
00174 #define    EEMWE   2
00175 #define    EEWE    1
00176 #define    EERE    0
00177 
00178 /* Data Register, Port A */
00179 #define    PA7     7
00180 #define    PA6     6
00181 #define    PA5     5
00182 #define    PA4     4
00183 #define    PA3     3
00184 #define    PA2     2
00185 #define    PA1     1
00186 #define    PA0     0
00187 
00188 /* Data Direction Register, Port A */
00189 #define    DDA7    7
00190 #define    DDA6    6
00191 #define    DDA5    5
00192 #define    DDA4    4
00193 #define    DDA3    3
00194 #define    DDA2    2
00195 #define    DDA1    1
00196 #define    DDA0    0
00197 
00198 /* Input Pins, Port A */
00199 #define    PINA7   7
00200 #define    PINA6   6
00201 #define    PINA5   5
00202 #define    PINA4   4
00203 #define    PINA3   3
00204 #define    PINA2   2
00205 #define    PINA1   1
00206 #define    PINA0   0
00207 
00208 /* Data Register, Port B */
00209 #define    PB7     7
00210 #define    PB6     6
00211 #define    PB5     5
00212 #define    PB4     4
00213 #define    PB3     3
00214 #define    PB2     2
00215 #define    PB1     1
00216 #define    PB0     0
00217 
00218 /* Data Direction Register, Port B */
00219 #define    DDB7    7
00220 #define    DDB6    6
00221 #define    DDB5    5
00222 #define    DDB4    4
00223 #define    DDB3    3
00224 #define    DDB2    2
00225 #define    DDB1    1
00226 #define    DDB0    0
00227 
00228 /* Input Pins, Port B */
00229 #define    PINB7   7
00230 #define    PINB6   6
00231 #define    PINB5   5
00232 #define    PINB4   4
00233 #define    PINB3   3
00234 #define    PINB2   2
00235 #define    PINB1   1
00236 #define    PINB0   0
00237 
00238 /* Pointer definition   */
00239 #define    XL     r26
00240 #define    XH     r27
00241 #define    YL     r28
00242 #define    YH     r29
00243 #define    ZL     r30
00244 #define    ZH     r31
00245 
00246 /* Constants */
00247 #define    RAMEND    0xDF
00248 #define    XRAMEND   0xDF
00249 #define    E2END     0x7F
00250 #define    FLASHEND  0x07FF
00251 
00252 #endif  /* _AVR_IOTN26_H_ */

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