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

io4434.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/io4434.h - definitions for AT90S4434 */
00027 
00028 #ifndef _AVR_IO4434_H_
00029 #define _AVR_IO4434_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_ "io4434.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 /* ADC Data register */
00048 #define ADCW    _SFR_IO16(0x04)
00049 #define ADCL    _SFR_IO8(0x04)
00050 #define ADCH    _SFR_IO8(0x05)
00051 
00052 /* ADC Control and Status Register */
00053 #define ADCSR   _SFR_IO8(0x06)
00054 
00055 /* ADC MUX */
00056 #define ADMUX   _SFR_IO8(0x07)
00057 
00058 /* Analog Comparator Control and Status Register */
00059 #define ACSR    _SFR_IO8(0x08)
00060 
00061 /* UART Baud Rate Register */
00062 #define UBRR    _SFR_IO8(0x09)
00063 
00064 /* UART Control Register */
00065 #define UCR     _SFR_IO8(0x0A)
00066 
00067 /* UART Status Register */
00068 #define USR     _SFR_IO8(0x0B)
00069 
00070 /* UART I/O Data Register */
00071 #define UDR     _SFR_IO8(0x0C)
00072 
00073 /* SPI Control Register */
00074 #define SPCR    _SFR_IO8(0x0D)
00075 
00076 /* SPI Status Register */
00077 #define SPSR    _SFR_IO8(0x0E)
00078 
00079 /* SPI I/O Data Register */
00080 #define SPDR    _SFR_IO8(0x0F)
00081 
00082 /* Input Pins, Port D */
00083 #define PIND    _SFR_IO8(0x10)
00084 
00085 /* Data Direction Register, Port D */
00086 #define DDRD    _SFR_IO8(0x11)
00087 
00088 /* Data Register, Port D */
00089 #define PORTD   _SFR_IO8(0x12)
00090 
00091 /* Input Pins, Port C */
00092 #define PINC    _SFR_IO8(0x13)
00093 
00094 /* Data Direction Register, Port C */
00095 #define DDRC    _SFR_IO8(0x14)
00096 
00097 /* Data Register, Port C */
00098 #define PORTC   _SFR_IO8(0x15)
00099 
00100 /* Input Pins, Port B */
00101 #define PINB    _SFR_IO8(0x16)
00102 
00103 /* Data Direction Register, Port B */
00104 #define DDRB    _SFR_IO8(0x17)
00105 
00106 /* Data Register, Port B */
00107 #define PORTB   _SFR_IO8(0x18)
00108 
00109 /* Input Pins, Port A */
00110 #define PINA    _SFR_IO8(0x19)
00111 
00112 /* Data Direction Register, Port A */
00113 #define DDRA    _SFR_IO8(0x1A)
00114 
00115 /* Data Register, Port A */
00116 #define PORTA   _SFR_IO8(0x1B)
00117 
00118 /* EEPROM Control Register */
00119 #define EECR    _SFR_IO8(0x1C)
00120 
00121 /* EEPROM Data Register */
00122 #define EEDR    _SFR_IO8(0x1D)
00123 
00124 /* EEPROM Address Register */
00125 #define EEAR    _SFR_IO16(0x1E)
00126 #define EEARL   _SFR_IO8(0x1E)
00127 #define EEARH   _SFR_IO8(0x1F)
00128 
00129 /* Watchdog Timer Control Register */
00130 #define WDTCR   _SFR_IO8(0x21)
00131 
00132 /* Asynchronous mode Status Register */
00133 #define ASSR    _SFR_IO8(0x22)
00134 
00135 /* Timer/Counter2 Output Compare Register */
00136 #define OCR2    _SFR_IO8(0x23)
00137 
00138 /* Timer/Counter 2 */
00139 #define TCNT2   _SFR_IO8(0x24)
00140 
00141 /* Timer/Counter 2 Control Register */
00142 #define TCCR2   _SFR_IO8(0x25)
00143 
00144 /* T/C 1 Input Capture Register */
00145 #define ICR1    _SFR_IO16(0x26)
00146 #define ICR1L   _SFR_IO8(0x26)
00147 #define ICR1H   _SFR_IO8(0x27)
00148 
00149 /* Timer/Counter1 Output Compare Register B */
00150 #define OCR1B   _SFR_IO16(0x28)
00151 #define OCR1BL  _SFR_IO8(0x28)
00152 #define OCR1BH  _SFR_IO8(0x29)
00153 
00154 /* Timer/Counter1 Output Compare Register A */
00155 #define OCR1A   _SFR_IO16(0x2A)
00156 #define OCR1AL  _SFR_IO8(0x2A)
00157 #define OCR1AH  _SFR_IO8(0x2B)
00158 
00159 /* Timer/Counter 1 */
00160 #define TCNT1   _SFR_IO16(0x2C)
00161 #define TCNT1L  _SFR_IO8(0x2C)
00162 #define TCNT1H  _SFR_IO8(0x2D)
00163 
00164 /* Timer/Counter 1 Control and Status Register */
00165 #define TCCR1B  _SFR_IO8(0x2E)
00166 
00167 /* Timer/Counter 1 Control Register */
00168 #define TCCR1A  _SFR_IO8(0x2F)
00169 
00170 /* Timer/Counter 0 */
00171 #define TCNT0   _SFR_IO8(0x32)
00172 
00173 /* Timer/Counter 0 Control Register */
00174 #define TCCR0   _SFR_IO8(0x33)
00175 
00176 /* MCU general Status Register */
00177 #define MCUSR   _SFR_IO8(0x34)
00178 
00179 /* MCU general Control Register */
00180 #define MCUCR   _SFR_IO8(0x35)
00181 
00182 /* Timer/Counter Interrupt Flag register */
00183 #define TIFR    _SFR_IO8(0x38)
00184 
00185 /* Timer/Counter Interrupt MaSK register */
00186 #define TIMSK   _SFR_IO8(0x39)
00187 
00188 /* General Interrupt Flag Register */
00189 #define GIFR    _SFR_IO8(0x3A)
00190 
00191 /* General Interrupt MaSK register */
00192 #define GIMSK   _SFR_IO8(0x3B)
00193 
00194 /* Stack Pointer */
00195 #define SP      _SFR_IO16(0x3D)
00196 #define SPL     _SFR_IO8(0x3D)
00197 #define SPH     _SFR_IO8(0x3E)
00198 
00199 /* Status REGister */
00200 #define SREG    _SFR_IO8(0x3F)
00201 
00202 /* Interrupt vectors */
00203 
00204 #define SIG_INTERRUPT0          _VECTOR(1)
00205 #define SIG_INTERRUPT1          _VECTOR(2)
00206 #define SIG_OUTPUT_COMPARE2     _VECTOR(3)
00207 #define SIG_OVERFLOW2           _VECTOR(4)
00208 #define SIG_INPUT_CAPTURE1      _VECTOR(5)
00209 #define SIG_OUTPUT_COMPARE1A    _VECTOR(6)
00210 #define SIG_OUTPUT_COMPARE1B    _VECTOR(7)
00211 #define SIG_OVERFLOW1           _VECTOR(8)
00212 #define SIG_OVERFLOW0           _VECTOR(9)
00213 #define SIG_SPI                 _VECTOR(10)
00214 #define SIG_UART_RECV           _VECTOR(11)
00215 #define SIG_UART_DATA           _VECTOR(12)
00216 #define SIG_UART_TRANS          _VECTOR(13)
00217 #define SIG_ADC                 _VECTOR(14)
00218 #define SIG_EEPROM_READY        _VECTOR(15)
00219 #define SIG_COMPARATOR          _VECTOR(16)
00220 
00221 #define _VECTORS_SIZE 34
00222 
00223 /*
00224    The Register Bit names are represented by their bit number (0-7).
00225 */
00226 
00227 /* MCU general Status Register */
00228 #define    EXTRF       1
00229 #define    PORF        0
00230 
00231 /* General Interrupt MaSK register */
00232 #define    INT1        7
00233 #define    INT0        6
00234 
00235 /* General Interrupt Flag Register */
00236 #define    INTF1       7
00237 #define    INTF0       6
00238 
00239 /* Timer/Counter Interrupt MaSK register */
00240 #define    OCIE2       7
00241 #define    TOIE2       6
00242 #define    TICIE1      5
00243 #define    OCIE1A      4
00244 #define    OCIE1B      3
00245 #define    TOIE1       2
00246 #define    TOIE0       0
00247 
00248 /* Timer/Counter Interrupt Flag register */
00249 #define    OCF2         7
00250 #define    TOV2         6
00251 #define    ICF1         5
00252 #define    OCF1A        4
00253 #define    OCF1B        3
00254 #define    TOV1         2
00255 #define    TOV0         0
00256 
00257 /* MCU general Control Register */
00258 #define    SE           6
00259 #define    SM1          5
00260 #define    SM0          4
00261 #define    ISC11        3
00262 #define    ISC10        2
00263 #define    ISC01        1
00264 #define    ISC00        0
00265 
00266 /* Timer/Counter 0 Control Register */
00267 #define    CS02         2
00268 #define    CS01         1
00269 #define    CS00         0
00270 
00271 /* Timer/Counter 1 Control Register */
00272 #define    COM1A1       7
00273 #define    COM1A0       6
00274 #define    COM1B1       5
00275 #define    COM1B0       4
00276 #define    PWM11        1
00277 #define    PWM10        0
00278 
00279 /* Timer/Counter 1 Control and Status Register */
00280 #define    ICNC1        7
00281 #define    ICES1        6
00282 #define    CTC1         3
00283 #define    CS12         2
00284 #define    CS11         1
00285 #define    CS10         0
00286 
00287 /* Timer/Counter 2 Control Register */
00288 #define    PWM2         6
00289 #define    COM21        5
00290 #define    COM20        4
00291 #define    CTC2         3
00292 #define    CS22         2
00293 #define    CS21         1
00294 #define    CS20         0
00295 
00296 /* Asynchronous mode Status Register */
00297 #define    AS2          3
00298 #define    TCN2UB       2
00299 #define    OCR2UB       1
00300 #define    TCR2UB       0
00301 
00302 /* Watchdog Timer Control Register */
00303 #define    WDTOE        4
00304 #define    WDE          3
00305 #define    WDP2         2
00306 #define    WDP1         1
00307 #define    WDP0         0
00308 
00309 /* EEPROM Control Register */
00310 #define    EERIE        3
00311 #define    EEMWE        2
00312 #define    EEWE         1
00313 #define    EERE         0
00314 
00315 /* Data Register, Port A */
00316 #define    PA7      7
00317 #define    PA6      6
00318 #define    PA5      5
00319 #define    PA4      4
00320 #define    PA3      3
00321 #define    PA2      2
00322 #define    PA1      1
00323 #define    PA0      0
00324 
00325 /* Data Direction Register, Port A */
00326 #define    DDA7     7
00327 #define    DDA6     6
00328 #define    DDA5     5
00329 #define    DDA4     4
00330 #define    DDA3     3
00331 #define    DDA2     2
00332 #define    DDA1     1
00333 #define    DDA0     0
00334 
00335 /* Input Pins, Port A */
00336 #define    PINA7    7
00337 #define    PINA6    6
00338 #define    PINA5    5
00339 #define    PINA4    4
00340 #define    PINA3    3
00341 #define    PINA2    2
00342 #define    PINA1    1
00343 #define    PINA0    0
00344 
00345 /* Data Register, Port B */
00346 #define    PB7      7
00347 #define    PB6      6
00348 #define    PB5      5
00349 #define    PB4      4
00350 #define    PB3      3
00351 #define    PB2      2
00352 #define    PB1      1
00353 #define    PB0      0
00354 
00355 /* Data Direction Register, Port B */
00356 #define    DDB7     7
00357 #define    DDB6     6
00358 #define    DDB5     5
00359 #define    DDB4     4
00360 #define    DDB3     3
00361 #define    DDB2     2
00362 #define    DDB1     1
00363 #define    DDB0     0
00364 
00365 /* Input Pins, Port B */
00366 #define    PINB7    7
00367 #define    PINB6    6
00368 #define    PINB5    5
00369 #define    PINB4    4
00370 #define    PINB3    3
00371 #define    PINB2    2
00372 #define    PINB1    1
00373 #define    PINB0    0
00374 
00375 /* Data Register, Port C */
00376 #define    PC7      7
00377 #define    PC6      6
00378 #define    PC5      5
00379 #define    PC4      4
00380 #define    PC3      3
00381 #define    PC2      2
00382 #define    PC1      1
00383 #define    PC0      0
00384 
00385 /* Data Direction Register, Port C */
00386 #define    DDC7     7
00387 #define    DDC6     6
00388 #define    DDC5     5
00389 #define    DDC4     4
00390 #define    DDC3     3
00391 #define    DDC2     2
00392 #define    DDC1     1
00393 #define    DDC0     0
00394 
00395 /* Input Pins, Port C */
00396 #define    PINC7    7
00397 #define    PINC6    6
00398 #define    PINC5    5
00399 #define    PINC4    4
00400 #define    PINC3    3
00401 #define    PINC2    2
00402 #define    PINC1    1
00403 #define    PINC0    0
00404 
00405 /* Data Register, Port D */
00406 #define    PD7      7
00407 #define    PD6      6
00408 #define    PD5      5
00409 #define    PD4      4
00410 #define    PD3      3
00411 #define    PD2      2
00412 #define    PD1      1
00413 #define    PD0      0
00414 
00415 /* Data Direction Register, Port D */
00416 #define    DDD7     7
00417 #define    DDD6     6
00418 #define    DDD5     5
00419 #define    DDD4     4
00420 #define    DDD3     3
00421 #define    DDD2     2
00422 #define    DDD1     1
00423 #define    DDD0     0
00424 
00425 /* Input Pins, Port D */
00426 #define    PIND7     7
00427 #define    PIND6     6
00428 #define    PIND5     5
00429 #define    PIND4     4
00430 #define    PIND3     3
00431 #define    PIND2     2
00432 #define    PIND1     1
00433 #define    PIND0     0
00434 
00435 /* SPI Control Register */
00436 #define    SPIE     7
00437 #define    SPE     6
00438 #define    DORD     5
00439 #define    MSTR     4
00440 #define    CPOL     3
00441 #define    CPHA     2
00442 #define    SPR1     1
00443 #define    SPR0     0
00444 
00445 /* SPI Status Register */
00446 #define    SPIF     7
00447 #define    WCOL     6
00448 
00449 /* UART Status Register */
00450 #define    RXC      7
00451 #define    TXC      6
00452 #define    UDRE     5
00453 #define    FE       4
00454 #define    DOR      3
00455 
00456 /* UART Control Register */
00457 #define    RXCIE    7
00458 #define    TXCIE    6
00459 #define    UDRIE    5
00460 #define    RXEN     4
00461 #define    TXEN     3
00462 #define    CHR9     2
00463 #define    RXB8     1
00464 #define    TXB8     0
00465 
00466 /* Analog Comparator Control and Status Register */
00467 #define    ACD      7
00468 #define    ACO      5
00469 #define    ACI      4
00470 #define    ACIE     3
00471 #define    ACIC     2
00472 #define    ACIS1    1
00473 #define    ACIS0    0
00474 
00475 /* ADC MUX */
00476 #define    MUX2     2
00477 #define    MUX1     1
00478 #define    MUX0     0
00479 
00480 /* ADC Control and Status Register */
00481 #define    ADEN     7
00482 #define    ADSC     6
00483 #define    ADFR     5
00484 #define    ADIF     4
00485 #define    ADIE     3
00486 #define    ADPS2    2
00487 #define    ADPS1    1
00488 #define    ADPS0    0
00489 
00490 /* Pointer definition   */
00491 #define    XL     r26
00492 #define    XH     r27
00493 #define    YL     r28
00494 #define    YH     r29
00495 #define    ZL     r30
00496 #define    ZH     r31
00497 
00498 /* Constants */
00499 #define    RAMEND   0x15F    /*Last On-Chip SRAM location*/
00500 #define    XRAMEND  0x15F
00501 #define    E2END    0xFF
00502 #define    FLASHEND 0xFFF
00503 
00504 #endif /* _AVR_IO4434_H_ */

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