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

iotn15.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/iotn15.h - definitions for ATtiny15 */
00027 
00028 #ifndef _AVR_IOTN15_H_
00029 #define _AVR_IOTN15_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_ "iotn15.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 /* I/O registers */
00048 
00049 /* 0x00..0x03 reserved */
00050 
00051 #define ADCW    _SFR_IO16(0x04)
00052 #define ADCL    _SFR_IO8(0x04)
00053 #define ADCH    _SFR_IO8(0x05)
00054 #define ADCSR   _SFR_IO8(0x06)
00055 #define ADMUX   _SFR_IO8(0x07)
00056 
00057 /* Analog Comparator Control and Status Register */
00058 #define ACSR    _SFR_IO8(0x08)
00059 
00060 /* 0x09..0x15 reserved */
00061 
00062 /* Input Pins, Port B */
00063 #define PINB    _SFR_IO8(0x16)
00064 
00065 /* Data Direction Register, Port B */
00066 #define DDRB    _SFR_IO8(0x17)
00067 
00068 /* Data Register, Port B */
00069 #define PORTB   _SFR_IO8(0x18)
00070 
00071 /* 0x19..0x1B reserved */
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_IO8(0x1E)
00081 #define EEARL   _SFR_IO8(0x1E)
00082 
00083 /* 0x1F..0x20 reserved */
00084 
00085 /* Watchdog Timer Control Register */
00086 #define WDTCR   _SFR_IO8(0x21)
00087 
00088 /* 0x22..0x2B reserved */
00089 #define SFIOR   _SFR_IO8(0x2C)
00090 
00091 #define OCR1B   _SFR_IO8(0x2D)
00092 #define OCR1A   _SFR_IO8(0x2E)
00093 #define TCNT1   _SFR_IO8(0x2F)
00094 #define TCCR1   _SFR_IO8(0x30)
00095 
00096 /* Oscillator Calibration Register */
00097 #define OSCCAL  _SFR_IO8(0x31)
00098 
00099 /* Timer/Counter0 (8-bit) */
00100 #define TCNT0   _SFR_IO8(0x32)
00101 
00102 /* Timer/Counter0 Control Register */
00103 #define TCCR0   _SFR_IO8(0x33)
00104 
00105 /* MCU general Status Register */
00106 #define MCUSR   _SFR_IO8(0x34)
00107 
00108 /* MCU general Control Register */
00109 #define MCUCR   _SFR_IO8(0x35)
00110 
00111 /* 0x36..0x37 reserved */
00112 
00113 /* Timer/Counter Interrupt Flag Register */
00114 #define TIFR    _SFR_IO8(0x38)
00115 
00116 /* Timer/Counter Interrupt MaSK Register */
00117 #define TIMSK   _SFR_IO8(0x39)
00118 
00119 /* General Interrupt Flag Register */
00120 #define GIFR    _SFR_IO8(0x3A)
00121 
00122 /* General Interrupt MaSK register */
00123 #define GIMSK   _SFR_IO8(0x3B)
00124 
00125 /* 0x3C..0x3E reserved */
00126 
00127 /* Status REGister */
00128 #define SREG    _SFR_IO8(0x3F)
00129 
00130 /* Interrupt vectors */
00131 
00132 #define SIG_INTERRUPT0          _VECTOR(1)
00133 #define SIG_PIN                 _VECTOR(2)
00134 #define SIG_OUTPUT_COMPARE1A    _VECTOR(3)
00135 #define SIG_OVERFLOW1           _VECTOR(4)
00136 #define SIG_OVERFLOW0           _VECTOR(5)
00137 #define SIG_EEPROM_READY        _VECTOR(6)
00138 #define SIG_COMPARATOR          _VECTOR(7)
00139 #define SIG_ADC                 _VECTOR(8)
00140 
00141 #define _VECTORS_SIZE 18
00142 
00143 /* Bit numbers */
00144 
00145 /* GIMSK */
00146 #define INT0    6
00147 #define PCIE    5
00148 
00149 /* GIFR */
00150 #define INTF0   6
00151 #define PCIF    5
00152 
00153 /* TIMSK */
00154 #define OCIE1   6
00155 #define TOIE1   2
00156 #define TOIE0   1
00157 
00158 /* TIFR */
00159 #define OCF1    6
00160 #define TOV1    2
00161 #define TOV0    1
00162 
00163 /* MCUCR */
00164 #define PUD     6
00165 #define SE      5
00166 #define SM1     4
00167 #define SM0     3
00168 #define ISC01   1
00169 #define ISC00   0
00170 
00171 /* MCUSR */
00172 #define WDRF    3
00173 #define BORF    2
00174 #define EXTRF   1
00175 #define PORF    0
00176 
00177 /* TCCR0 */
00178 #define CS02    2
00179 #define CS01    1
00180 #define CS00    0
00181 
00182 /* TCCR1 */
00183 #define CTC1    7
00184 #define PWM1    6
00185 #define COM1A1  5
00186 #define COM1A0  4
00187 #define CS13    3
00188 #define CS12    2
00189 #define CS11    1
00190 #define CS10    0
00191 
00192 /* SFIOR */
00193 #define FOC1A   2
00194 #define PSR1    1
00195 #define PSR0    0
00196 
00197 /* WDTCR */
00198 #define WDTOE   4
00199 #define WDE     3
00200 #define WDP2    2
00201 #define WDP1    1
00202 #define WDP0    0
00203 
00204 /* EECR */
00205 #define EERIE   3
00206 #define EEMWE   2
00207 #define EEWE    1
00208 #define EERE    0
00209 
00210 /*
00211    PB5 = RESET# / ADC0
00212    PB4 = ADC3
00213    PB3 = ADC2
00214    PB2 = SCK / ADC1 / T0 / INT0
00215    PB1 = MISO / AIN1 / OCP
00216    PB0 = MOSI / AIN0 / AREF
00217  */
00218 
00219 /* PORTB */
00220 #define PORTB4  4
00221 #define PORTB3  3
00222 #define PORTB2  2
00223 #define PORTB1  1
00224 #define PORTB0  0
00225 
00226 /* DDRB */
00227 #define DDB4    4
00228 #define DDB3    3
00229 #define DDB2    2
00230 #define DDB1    1
00231 #define DDB0    0
00232 
00233 /* PINB */
00234 #define PINB5   5
00235 #define PINB4   4
00236 #define PINB3   3
00237 #define PINB2   2
00238 #define PINB1   1
00239 #define PINB0   0
00240 
00241 /* ACSR */
00242 #define ACD     7
00243 #define GREF    6
00244 #define ACO     5
00245 #define ACI     4
00246 #define ACIE    3
00247 #define ACIS1   1
00248 #define ACIS0   0
00249 
00250 /* ADMUX */
00251 #define REFS1   7
00252 #define REFS0   6
00253 #define ADLAR   5
00254 #define MUX2    2
00255 #define MUX1    1
00256 #define MUX0    0
00257 
00258 /* ADCSR */
00259 #define ADEN    7
00260 #define ADSC    6
00261 #define ADFR    5
00262 #define ADIF    4
00263 #define ADIE    3
00264 #define ADPS2   2
00265 #define ADPS1   1
00266 #define ADPS0   0
00267 
00268 #define ZL r30
00269 #define ZH r31
00270 
00271 /* Last memory addresses */
00272 #define RAMEND          0x1F
00273 #define XRAMEND         0x0
00274 #define E2END           0x3F
00275 #define FLASHEND        0x3FF
00276 
00277 #endif /* _AVR_IOTN15_H_ */

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