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

iotn28.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/iotn28.h - definitions for ATtiny28 */
00027 
00028 #ifndef _AVR_IOTN28_H_
00029 #define _AVR_IOTN28_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_ "iotn28.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 #include <avr/sfr_defs.h>
00048 
00049 /* I/O registers */
00050 
00051 #define OSCCAL  _SFR_IO8(0x00)
00052 
00053 #define WDTCR   _SFR_IO8(0x01)
00054 
00055 #define MODCR   _SFR_IO8(0x02)
00056 
00057 #define TCNT0   _SFR_IO8(0x03)
00058 #define TCCR0   _SFR_IO8(0x04)
00059 
00060 #define IFR     _SFR_IO8(0x05)
00061 #define ICR     _SFR_IO8(0x06)
00062 
00063 #define MCUCS   _SFR_IO8(0x07)
00064 
00065 #define ACSR    _SFR_IO8(0x08)
00066 
00067 /* 0x09..0x0F reserved */
00068 
00069 #define PIND    _SFR_IO8(0x10)
00070 #define DDRD    _SFR_IO8(0x11)
00071 #define PORTD   _SFR_IO8(0x12)
00072 
00073 /* 0x13..0x15 reserved */
00074 
00075 #define PINB    _SFR_IO8(0x16)
00076 
00077 /* 0x17..0x18 reserved */
00078 
00079 #define PINA    _SFR_IO8(0x19)
00080 #define PACR    _SFR_IO8(0x1A)
00081 #define PORTA   _SFR_IO8(0x1B)
00082 
00083 /* 0x1C..0x3E reserved */
00084 
00085 #define SREG    _SFR_IO8(0x3F)
00086 
00087 
00088 /* Interrupt vectors */
00089 
00090 #define SIG_INTERRUPT0          _VECTOR(1)
00091 #define SIG_INTERRUPT1          _VECTOR(2)
00092 #define SIG_PIN                 _VECTOR(3)
00093 #define SIG_OVERFLOW0           _VECTOR(4)
00094 #define SIG_COMPARATOR          _VECTOR(5)
00095 
00096 #define _VECTORS_SIZE 12
00097 
00098 
00099 /* Bit numbers */
00100 
00101 /* ICR */
00102 #define INT1    7
00103 #define INT0    6
00104 #define LLIE    5
00105 #define TOIE0   4
00106 #define ISC11   3
00107 #define ISC10   2
00108 #define ISC01   1
00109 #define ISC00
00110 
00111 /* IFR */
00112 #define INTF1   7
00113 #define INTF0   6
00114 #define TOV0    4
00115 
00116 /* MCUCS */
00117 #define PLUPB   7
00118 #define SE      5
00119 #define SM      4
00120 #define WDRF    3
00121 #define EXTRF   1
00122 #define PORF    0
00123 
00124 /* TCCR0 */
00125 #define FOV0    7
00126 #define OOM01   4
00127 #define OOM00   3
00128 #define CS02    2
00129 #define CS01    1
00130 #define CS00    0
00131 
00132 /* MODCR */
00133 #define ONTIM4  7
00134 #define ONTIM3  6
00135 #define ONTIM2  5
00136 #define ONTIM1  4
00137 #define ONTIM0  3
00138 #define MCONF2  2
00139 #define MCONF1  1
00140 #define MCONF0  0
00141 
00142 /* WDTCR */
00143 #define WDTOE   4
00144 #define WDE     3
00145 #define WDP2    2
00146 #define WDP1    1
00147 #define WDP0    0
00148 
00149 /* EECR */
00150 #define EERIE   3
00151 #define EEMWE   2
00152 #define EEWE    1
00153 #define EERE    0
00154 
00155 /*
00156    PA2 = IR
00157  */
00158 
00159 /* PORTA */
00160 #define PA3     3
00161 #define PA2     2
00162 #define PA1     1
00163 #define PA0     0
00164 
00165 /* PACR */
00166 #define DDA3    3
00167 #define PA2HC   2
00168 #define DDA1    1
00169 #define DDA0    0
00170 
00171 /* PINA */
00172 #define PINA3   3
00173 #define PINA1   1
00174 #define PINA0   0
00175 
00176 /*
00177    PB4 = INT1
00178    PB3 = INT0
00179    PB2 = T0
00180    PB1 = AIN1
00181    PB0 = AIN0
00182  */
00183 
00184 /* PINB */
00185 #define PINB7   7
00186 #define PINB6   6
00187 #define PINB5   5
00188 #define PINB4   4
00189 #define PINB3   3
00190 #define PINB2   2
00191 #define PINB1   1
00192 #define PINB0   0
00193 
00194 /* PORTD */
00195 #define PD7     7
00196 #define PD6     6
00197 #define PD5     5
00198 #define PD4     4
00199 #define PD3     3
00200 #define PD2     2
00201 #define PD1     1
00202 #define PD0     0
00203 
00204 /* DDRD */
00205 #define DDD7    7
00206 #define DDD6    6
00207 #define DDD5    5
00208 #define DDD4    4
00209 #define DDD3    3
00210 #define DDD2    2
00211 #define DDD1    1
00212 #define DDD0    0
00213 
00214 /* PIND */
00215 #define PIND7   7
00216 #define PIND6   6
00217 #define PIND5   5
00218 #define PIND4   4
00219 #define PIND3   3
00220 #define PIND2   2
00221 #define PIND1   1
00222 #define PIND0   0
00223 
00224 /* ACSR */
00225 #define ACD     7
00226 #define ACO     5
00227 #define ACI     4
00228 #define ACIE    3
00229 #define ACIS1   1
00230 #define ACIS0   0
00231 
00232 #define ZL r30
00233 #define ZH r31
00234 
00235 /* Last memory addresses */
00236 #define RAMEND          0x1F
00237 #define XRAMEND         0x0
00238 #define E2END           0x0
00239 #define FLASHEND        0x7FF
00240 
00241 #endif /* _AVR_IOTN28_H_ */

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