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

io4433.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/io4433.h - definitions for AT90S4433 */
00027 
00028 #ifndef _AVR_IO4433_H_
00029 #define _AVR_IO4433_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_ "io4433.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 /* UART Baud Rate Register high */
00048 #define UBRRH   _SFR_IO8(0x03)
00049 
00050 /* ADC Data register */
00051 #define ADCW    _SFR_IO16(0x04)
00052 #define ADCL    _SFR_IO8(0x04)
00053 #define ADCH    _SFR_IO8(0x05)
00054 
00055 /* ADC Control and Status Register */
00056 #define ADCSR   _SFR_IO8(0x06)
00057 
00058 /* ADC MUX */
00059 #define ADMUX   _SFR_IO8(0x07)
00060 
00061 /* Analog Comparator Control and Status Register */
00062 #define ACSR    _SFR_IO8(0x08)
00063 
00064 /* UART Baud Rate Register */
00065 #define UBRR    _SFR_IO8(0x09)
00066 
00067 /* UART Control/Status Registers */
00068 #define UCSRB   _SFR_IO8(0x0A)
00069 #define UCSRA   _SFR_IO8(0x0B)
00070 
00071 /* UART I/O Data Register */
00072 #define UDR     _SFR_IO8(0x0C)
00073 
00074 /* SPI Control Register */
00075 #define SPCR    _SFR_IO8(0x0D)
00076 
00077 /* SPI Status Register */
00078 #define SPSR    _SFR_IO8(0x0E)
00079 
00080 /* SPI I/O Data Register */
00081 #define SPDR    _SFR_IO8(0x0F)
00082 
00083 /* Input Pins, Port D */
00084 #define PIND    _SFR_IO8(0x10)
00085 
00086 /* Data Direction Register, Port D */
00087 #define DDRD    _SFR_IO8(0x11)
00088 
00089 /* Data Register, Port D */
00090 #define PORTD   _SFR_IO8(0x12)
00091 
00092 /* Input Pins, Port C */
00093 #define PINC    _SFR_IO8(0x13)
00094 
00095 /* Data Direction Register, Port C */
00096 #define DDRC    _SFR_IO8(0x14)
00097 
00098 /* Data Register, Port C */
00099 #define PORTC   _SFR_IO8(0x15)
00100 
00101 /* Input Pins, Port B */
00102 #define PINB    _SFR_IO8(0x16)
00103 
00104 /* Data Direction Register, Port B */
00105 #define DDRB    _SFR_IO8(0x17)
00106 
00107 /* Data Register, Port B */
00108 #define PORTB   _SFR_IO8(0x18)
00109 
00110 /* EEPROM Control Register */
00111 #define EECR    _SFR_IO8(0x1C)
00112 
00113 /* EEPROM Data Register */
00114 #define EEDR    _SFR_IO8(0x1D)
00115 
00116 /* EEPROM Address Register */
00117 #define EEAR    _SFR_IO8(0x1E)
00118 #define EEARL   _SFR_IO8(0x1E)
00119 
00120 /* Watchdog Timer Control Register */
00121 #define WDTCR   _SFR_IO8(0x21)
00122 
00123 /* T/C 1 Input Capture Register */
00124 #define ICR1    _SFR_IO16(0x26)
00125 #define ICR1L   _SFR_IO8(0x26)
00126 #define ICR1H   _SFR_IO8(0x27)
00127 
00128 /* Timer/Counter1 Output Compare Register A */
00129 #define OCR1    _SFR_IO16(0x2A)
00130 #define OCR1L   _SFR_IO8(0x2A)
00131 #define OCR1H   _SFR_IO8(0x2B)
00132 
00133 /* Timer/Counter 1 */
00134 #define TCNT1   _SFR_IO16(0x2C)
00135 #define TCNT1L  _SFR_IO8(0x2C)
00136 #define TCNT1H  _SFR_IO8(0x2D)
00137 
00138 /* Timer/Counter 1 Control and Status Register */
00139 #define TCCR1B  _SFR_IO8(0x2E)
00140 
00141 /* Timer/Counter 1 Control Register */
00142 #define TCCR1A  _SFR_IO8(0x2F)
00143 
00144 /* Timer/Counter 0 */
00145 #define TCNT0   _SFR_IO8(0x32)
00146 
00147 /* Timer/Counter 0 Control Register */
00148 #define TCCR0   _SFR_IO8(0x33)
00149 
00150 /* MCU general Status Register */
00151 #define MCUSR   _SFR_IO8(0x34)
00152 
00153 /* MCU general Control Register */
00154 #define MCUCR   _SFR_IO8(0x35)
00155 
00156 /* Timer/Counter Interrupt Flag register */
00157 #define TIFR    _SFR_IO8(0x38)
00158 
00159 /* Timer/Counter Interrupt MaSK register */
00160 #define TIMSK   _SFR_IO8(0x39)
00161 
00162 /* General Interrupt Flag Register */
00163 #define GIFR    _SFR_IO8(0x3A)
00164 
00165 /* General Interrupt MaSK register */
00166 #define GIMSK   _SFR_IO8(0x3B)
00167 
00168 /* Stack Pointer */
00169 #define SP      _SFR_IO16(0x3D)
00170 #define SPL     _SFR_IO8(0x3D)
00171 #define SPH     _SFR_IO8(0x3E)
00172 
00173 /* Status REGister */
00174 #define SREG    _SFR_IO8(0x3F)
00175 
00176 /* Interrupt vectors */
00177 
00178 #define SIG_INTERRUPT0          _VECTOR(1)
00179 #define SIG_INTERRUPT1          _VECTOR(2)
00180 #define SIG_INPUT_CAPTURE1      _VECTOR(3)
00181 #define SIG_OUTPUT_COMPARE1A    _VECTOR(4)
00182 #define SIG_OVERFLOW1           _VECTOR(5)
00183 #define SIG_OVERFLOW0           _VECTOR(6)
00184 #define SIG_SPI                 _VECTOR(7)
00185 #define SIG_UART_RECV           _VECTOR(8)
00186 #define SIG_UART_DATA           _VECTOR(9)
00187 #define SIG_UART_TRANS          _VECTOR(10)
00188 #define SIG_ADC                 _VECTOR(11)
00189 #define SIG_EEPROM_READY        _VECTOR(12)
00190 #define SIG_COMPARATOR          _VECTOR(13)
00191 
00192 #define _VECTORS_SIZE 28
00193 
00194 /*
00195    The Register Bit names are represented by their bit number (0-7).
00196 */
00197 
00198 /* MCU general Status Register */
00199 #define    WDRF        3
00200 #define    BORF        2
00201 #define    EXTRF       1
00202 #define    PORF        0
00203 
00204 /* General Interrupt MaSK register */
00205 #define    INT1        7
00206 #define    INT0        6
00207 
00208 /* General Interrupt Flag Register */
00209 #define    INTF1       7
00210 #define    INTF0       6
00211 
00212 /* Timer/Counter Interrupt MaSK register */
00213 #define    TOIE1       7
00214 #define    OCIE1       6
00215 #define    TICIE1      3
00216 #define    TOIE0       1
00217 
00218 /* Timer/Counter Interrupt Flag register */
00219 #define    TOV1         7
00220 #define    OCF1         6
00221 #define    ICF1         3
00222 #define    TOV0         1
00223 
00224 /* MCU general Control Register */
00225 #define    SE           5
00226 #define    SM           4
00227 #define    ISC11        3
00228 #define    ISC10        2
00229 #define    ISC01        1
00230 #define    ISC00        0
00231 
00232 /* Timer/Counter 0 Control Register */
00233 #define    CS02         2
00234 #define    CS01         1
00235 #define    CS00         0
00236 
00237 /* Timer/Counter 1 Control Register */
00238 #define    COM11        7
00239 #define    COM10        6
00240 #define    PWM11        1
00241 #define    PWM10        0
00242 
00243 /* Timer/Counter 1 Control and Status Register */
00244 #define    ICNC1        7
00245 #define    ICES1        6
00246 #define    CTC1         3
00247 #define    CS12         2
00248 #define    CS11         1
00249 #define    CS10         0
00250 
00251 /* Watchdog Timer Control Register */
00252 #define    WDTOE        4
00253 #define    WDE          3
00254 #define    WDP2         2
00255 #define    WDP1         1
00256 #define    WDP0         0
00257 
00258 /* EEPROM Control Register */
00259 #define    EERIE        3
00260 #define    EEMWE        2
00261 #define    EEWE         1
00262 #define    EERE         0
00263 
00264 /* SPI Control Register */
00265 #define    SPIE       7
00266 #define    SPE        6
00267 #define    DORD       5
00268 #define    MSTR       4
00269 #define    CPOL       3
00270 #define    CPHA       2
00271 #define    SPR1       1
00272 #define    SPR0       0
00273 
00274 /* SPI Status Register */
00275 #define    SPIF       7
00276 #define    WCOL       6
00277 
00278 /* UART Status Register */
00279 #define    RXC        7
00280 #define    TXC        6
00281 #define    UDRE       5
00282 #define    FE         4
00283 #define    DOR        3
00284 #define    MPCM       0
00285 
00286 /* UART Control Register */
00287 #define    RXCIE      7
00288 #define    TXCIE      6
00289 #define    UDRIE      5
00290 #define    RXEN       4
00291 #define    TXEN       3
00292 #define    CHR9       2
00293 #define    RXB8       1
00294 #define    TXB8       0
00295 
00296 /* Analog Comparator Control and Status Register */
00297 #define    ACD        7
00298 #define    AINBG      6
00299 #define    ACO        5
00300 #define    ACI        4
00301 #define    ACIE       3
00302 #define    ACIC       2
00303 #define    ACIS1      1
00304 #define    ACIS0      0
00305 
00306 /* ADC MUX */
00307 #define    ACDBG      6
00308 #define    MUX2       2
00309 #define    MUX1       1
00310 #define    MUX0       0
00311 
00312 /* ADC Control and Status Register */
00313 #define    ADEN       7
00314 #define    ADSC       6
00315 #define    ADFR       5
00316 #define    ADIF       4
00317 #define    ADIE       3
00318 #define    ADPS2      2
00319 #define    ADPS1      1
00320 #define    ADPS0      0
00321 
00322 /* Data Register, Port B */
00323 #define    PB5      5
00324 #define    PB4      4
00325 #define    PB3      3
00326 #define    PB2      2
00327 #define    PB1      1
00328 #define    PB0      0
00329 
00330 /* Data Direction Register, Port B */
00331 #define    DDB5     5
00332 #define    DDB4     4
00333 #define    DDB3     3
00334 #define    DDB2     2
00335 #define    DDB1     1
00336 #define    DDB0     0
00337 
00338 /* Input Pins, Port B */
00339 #define    PINB5    5
00340 #define    PINB4    4
00341 #define    PINB3    3
00342 #define    PINB2    2
00343 #define    PINB1    1
00344 #define    PINB0    0
00345 
00346 /* Data Register, Port C */
00347 #define    PC5      5
00348 #define    PC4      4
00349 #define    PC3      3
00350 #define    PC2      2
00351 #define    PC1      1
00352 #define    PC0      0
00353 
00354 /* Data Direction Register, Port C */
00355 #define    DDC5     5
00356 #define    DDC4     4
00357 #define    DDC3     3
00358 #define    DDC2     2
00359 #define    DDC1     1
00360 #define    DDC0     0
00361 
00362 /* Input Pins, Port C */
00363 #define    PINC5    5
00364 #define    PINC4    4
00365 #define    PINC3    3
00366 #define    PINC2    2
00367 #define    PINC1    1
00368 #define    PINC0    0
00369 
00370 /* Data Register, Port D */
00371 #define    PD7      7
00372 #define    PD6      6
00373 #define    PD5      5
00374 #define    PD4      4
00375 #define    PD3      3
00376 #define    PD2      2
00377 #define    PD1      1
00378 #define    PD0      0
00379 
00380 /* Data Direction Register, Port D */
00381 #define    DDD7     7
00382 #define    DDD6     6
00383 #define    DDD5     5
00384 #define    DDD4     4
00385 #define    DDD3     3
00386 #define    DDD2     2
00387 #define    DDD1     1
00388 #define    DDD0     0
00389 
00390 /* Input Pins, Port D */
00391 #define    PIND7     7
00392 #define    PIND6     6
00393 #define    PIND5     5
00394 #define    PIND4     4
00395 #define    PIND3     3
00396 #define    PIND2     2
00397 #define    PIND1     1
00398 #define    PIND0     0
00399 
00400 /* Pointer definition   */
00401 #define    XL     r26
00402 #define    XH     r27
00403 #define    YL     r28
00404 #define    YH     r29
00405 #define    ZL     r30
00406 #define    ZH     r31
00407 
00408 /* Constants */
00409 #define    RAMEND   0xDF    /*Last On-Chip SRAM location*/
00410 #define    XRAMEND  0xDF
00411 #define    E2END    0xFF
00412 #define    FLASHEND 0xFFF
00413 
00414 #endif /* _AVR_IO4433_H_ */

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