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

iom162.h

00001 /* Copyright (c) 2002, Nils Kristian Strom <nilsst@omegav.ntnu.no>
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 /* iom162.h - definitions for ATmega162 */
00027 
00028 #ifndef _AVR_IOM162_H_
00029 #define _AVR_IOM162_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_ "iom162.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 /* Memory mapped I/O registers */
00046 
00047 /* Timer/Counter3 Control Register A */
00048 #define TCCR3A  _SFR_MEM8(0x8B)
00049 
00050 /* Timer/Counter3 Control Register B */
00051 #define TCCR3B  _SFR_MEM8(0x8A)
00052 
00053 /* Timer/Counter3 - Counter Register */
00054 #define TCNT3H  _SFR_MEM8(0x89)
00055 #define TCNT3L  _SFR_MEM8(0x88)
00056 #define TCNT3   _SFR_MEM16(0x88)
00057 
00058 /* Timer/Counter3 - Output Compare Register A */
00059 #define OCR3AH  _SFR_MEM8(0x87)
00060 #define OCR3AL  _SFR_MEM8(0x86)
00061 #define OCR3A   _SFR_MEM16(0x86)
00062 
00063 /* Timer/Counter3 - Output Compare Register B */
00064 #define OCR3BH  _SFR_MEM8(0x85)
00065 #define OCR3BL  _SFR_MEM8(0x84)
00066 #define OCR3B   _SFR_MEM16(0x84)
00067 
00068 /* Timer/Counter3 - Input Capture Register */
00069 #define ICR3H   _SFR_MEM8(0x81)
00070 #define ICR3L   _SFR_MEM8(0x80)
00071 #define ICR3    _SFR_MEM16(0x80)
00072 
00073 /* Extended Timer/Counter Interrupt Mask */
00074 #define ETIMSK  _SFR_MEM8(0x7D)
00075 
00076 /* Extended Timer/Counter Interrupt Flag Register */
00077 #define ETIFR   _SFR_MEM8(0x7C)
00078 
00079 /* Pin Change Mask Register 1 */
00080 #define PCMSK1  _SFR_MEM8(0x6C)
00081 
00082 /* Pin Change Mask Register 0 */
00083 #define PCMSK0  _SFR_MEM8(0x6B)
00084 
00085 /* Clock PRescale */
00086 #define CLKPR   _SFR_MEM8(0x61)
00087 
00088 
00089 /* Standard I/O registers */
00090 
00091 #define SREG    _SFR_IO8(0x3F)  /* Status Register */
00092 #define SPH     _SFR_IO8(0x3E)  /* Stack Pointer High Byte */
00093 #define SPL     _SFR_IO8(0x3D)  /* Stack Pointer High Byte */
00094 #define UBRR1H  _SFR_IO8(0x3C)  /* USART 1 Baud Rate Register High Byte, Shared with UCSR1C */
00095 #define UCSR1C  _SFR_IO8(0x3C)  /* USART 1 Control and Status Register, Shared with UBRR1H */
00096 #define GICR    _SFR_IO8(0x3B)  /* General Interrupt Control Register */
00097 #define GIFR    _SFR_IO8(0x3A)  /* General Interrupt Flag Register */
00098 #define TIMSK   _SFR_IO8(0x39)  /* Timer Interrupt Mask */
00099 #define TIFR    _SFR_IO8(0x38)  /* Timer Interrupt Flag Register */
00100 #define SPMCR   _SFR_IO8(0x37)  /* Store Program Memory Control Register */
00101 #define EMCUCR  _SFR_IO8(0x36)  /* Extended MCU Control Register */
00102 #define MCUCR   _SFR_IO8(0x35)  /* MCU Control Register */
00103 #define MCUCSR  _SFR_IO8(0x34)  /* MCU Control and Status Register */
00104 #define TCCR0   _SFR_IO8(0x33)  /* Timer/Counter 0 Control Register */
00105 #define TCNT0   _SFR_IO8(0x32)  /* TImer/Counter 0 */
00106 #define OCR0    _SFR_IO8(0x31)  /* Output Compare Register 0 */
00107 #define SFIOR   _SFR_IO8(0x30)  /* Special Function I/O Register */
00108 #define TCCR1A  _SFR_IO8(0x2F)  /* Timer/Counter 1 Control Register A */
00109 #define TCCR1B  _SFR_IO8(0x2E)  /* Timer/Counter 1 Control Register A */
00110 #define TCNT1H  _SFR_IO8(0x2D)  /* Timer/Counter 1 High Byte */
00111 #define TCNT1L  _SFR_IO8(0x2C)  /* Timer/Counter 1 Low Byte */
00112 #define TCNT1   _SFR_IO16(0x2C) /* Timer/Counter 1 */
00113 #define OCR1AH  _SFR_IO8(0x2B)  /* Timer/Counter 1 Output Compare Register A High Byte */
00114 #define OCR1AL  _SFR_IO8(0x2A)  /* Timer/Counter 1 Output Compare Register A Low Byte */
00115 #define OCR1A   _SFR_IO16(0x2A) /* Timer/Counter 1 Output Compare Register A */
00116 #define OCR1BH  _SFR_IO8(0x29)  /* Timer/Counter 1 Output Compare Register B High Byte */
00117 #define OCR1BL  _SFR_IO8(0x28)  /* Timer/Counter 1 Output Compare Register B Low Byte */
00118 #define OCR1B   _SFR_IO16(0x28) /* Timer/Counter 1 Output Compare Register B */
00119 #define TCCR2   _SFR_IO8(0x27)  /* Timer/Counter 2 Control Register */
00120 #define ASSR    _SFR_IO8(0x26)  /* Asynchronous Status Register */
00121 #define ICR1H   _SFR_IO8(0x25)  /* Input Capture Register 1 High Byte */
00122 #define ICR1L   _SFR_IO8(0x24)  /* Input Capture Register 1 Low Byte */
00123 #define ICR1    _SFR_IO16(0x24) /* Input Capture Register 1 */
00124 #define TCNT2   _SFR_IO8(0x23)  /* Timer/Counter 2 */
00125 #define OCR2    _SFR_IO8(0x22)  /* Timer/Counter 2 Output Compare Register */
00126 #define WDTCR   _SFR_IO8(0x21)  /* Watchdow Timer Control Register */
00127 #define UBRR0H  _SFR_IO8(0x20)  /* USART 0 Baud-Rate Register High Byte, Shared with UCSR0C */
00128 #define UCSR0C  _SFR_IO8(0x20)  /* USART 0 Control and Status Register C, Shared with UBRR0H */
00129 #define EEARH   _SFR_IO8(0x1F)  /* EEPROM Address Register High Byte */
00130 #define EEARL   _SFR_IO8(0x1E)  /* EEPROM Address Register Low Byte */
00131 #define EEAR    _SFR_IO16(0x1E) /* EEPROM Address Register */
00132 #define EEDR    _SFR_IO8(0x1D)  /* EEPROM Data Register */
00133 #define EECR    _SFR_IO8(0x1C)  /* EEPROM Control REgister */
00134 #define PORTA   _SFR_IO8(0x1B)  /* Port A */
00135 #define DDRA    _SFR_IO8(0x1A)  /* Port A Data Direction Register */
00136 #define PINA    _SFR_IO8(0x19)  /* Port A Pin Register */
00137 #define PORTB   _SFR_IO8(0x18)  /* Port B */
00138 #define DDRB    _SFR_IO8(0x17)  /* Port B Data Direction Register */
00139 #define PINB    _SFR_IO8(0x16)  /* Port B Pin Register */
00140 #define PORTC   _SFR_IO8(0x15)  /* Port C */
00141 #define DDRC    _SFR_IO8(0x14)  /* Port C Data Direction Register */
00142 #define PINC    _SFR_IO8(0x13)  /* Port C Pin Register */
00143 #define PORTD   _SFR_IO8(0x12)  /* Port D */
00144 #define DDRD    _SFR_IO8(0x11)  /* Port D Data Direction Register */
00145 #define PIND    _SFR_IO8(0x10)  /* Port D Pin Register */
00146 #define SPDR    _SFR_IO8(0x0F)  /* SPI Data Register */
00147 #define SPSR    _SFR_IO8(0x0E)  /* SPI Status Register */
00148 #define SPCR    _SFR_IO8(0x0D)  /* SPI Control Register */
00149 #define UDR0    _SFR_IO8(0x0C)  /* USART 0 Data Register */
00150 #define UCSR0A  _SFR_IO8(0x0B)  /* USART 0 Control and Status Register A */
00151 #define UCSR0B  _SFR_IO8(0x0A)  /* USART 0 Control and Status Register B */
00152 #define UBRR0L  _SFR_IO8(0x09)  /* USART 0 Baud-Rate Register Low Byte */
00153 #define ACSR    _SFR_IO8(0x08)  /* Analog Comparator Status Register */
00154 #define PORTE   _SFR_IO8(0x07)  /* Port E */
00155 #define DDRE    _SFR_IO8(0x06)  /* Port E Data Direction Register */
00156 #define PINE    _SFR_IO8(0x05)  /* Port E Pin Register */
00157 #define OSCCAL  _SFR_IO8(0x04)  /* Oscillator Calibration, Shared with OCDR */
00158 #define OCDR    _SFR_IO8(0x04)  /* On-Chip Debug Register, Shared with OSCCAL */
00159 #define UDR1    _SFR_IO8(0x03)  /* USART 1 Data Register */
00160 #define UCSR1A  _SFR_IO8(0x02)  /* USART 1 Control and Status Register A */
00161 #define UCSR1B  _SFR_IO8(0x01)  /* USART 1 Control and Status Register B */
00162 #define UBRR1L  _SFR_IO8(0x00)  /* USART 0 Baud Rate Register High Byte */
00163  
00164 
00165 /* Interrupt vectors (byte addresses) */
00166 
00167 #define SIG_INTERRUPT0          _VECTOR(1) /* External Interrupt Request 0 */
00168 #define SIG_INTERRUPT1          _VECTOR(2) /* External Interrupt Request 1 */
00169 #define SIG_INTERRUPT2          _VECTOR(3) /* External Interrupt Request 2 */
00170 #define SIG_PIN_CHANGE0         _VECTOR(4) /* Pin Change Interrupt Request 0 */
00171 #define SIG_PIN_CHANGE1         _VECTOR(5) /* Pin Change Interrupt Request 1 */
00172 #define SIG_INPUT_CAPTURE3      _VECTOR(6) /* Timer/Counter3 Capture Event */
00173 #define SIG_OUTPUT_COMPARE3A    _VECTOR(7) /* Timer/Counter3 Compare Match A */
00174 #define SIG_OUTPUT_COMPARE3B    _VECTOR(8) /* Timer/Counter3 Compare Match B */
00175 #define SIG_OVERFLOW3           _VECTOR(9) /* Timer/Counter3 Overflow */
00176 #define SIG_OUTPUT_COMPARE2     _VECTOR(10) /* Timer/Counter2 Compare Match */
00177 #define SIG_OVERFLOW2           _VECTOR(11) /* Timer/Counter2 Overflow */
00178 #define SIG_INPUT_CAPTURE1      _VECTOR(12) /* Timer/Counter1 Capture Event */
00179 #define SIG_OUTPUT_COMPARE1A    _VECTOR(13) /* Timer/Counter1 Compare Match A */
00180 #define SIG_OUTPUT_COMPARE1B    _VECTOR(14) /* Timer/Counter1 Compare Match B */
00181 #define SIG_OVERFLOW1           _VECTOR(15) /* Timer/Counter1 Overflow */
00182 #define SIG_OUTPUT_COMPARE0     _VECTOR(16) /* Timer/Counter0 Compare Match */
00183 #define SIG_OVERFLOW0           _VECTOR(17) /* Timer/Counter0 Overflow */
00184 #define SIG_SPI                 _VECTOR(18) /* Serial Transfer Complete */
00185 #define SIG_USART0_RECV         _VECTOR(19) /* USART0,Rx Complete */
00186 #define SIG_USART1_RECV         _VECTOR(20) /* USART1,Rx Complete */
00187 #define SIG_USART0_DATA         _VECTOR(21) /* USART0 Data Register Empty */
00188 #define SIG_USART1_DATA         _VECTOR(22) /* USART1 Data Register Empty */
00189 #define SIG_USART0_TRANS        _VECTOR(23) /* USART0,Tx Complete */
00190 #define SIG_USART1_TRANS        _VECTOR(24) /* USART1,Tx Complete */
00191 #define SIG_EEPROM_READY        _VECTOR(25) /* EEPROM Ready */
00192 #define SIG_COMPARATOR          _VECTOR(26) /* Analog Comparator */
00193 #define SIG_SPM_READY           _VECTOR(27) /* Store Program Memory Ready */
00194 
00195 #define _VECTORS_SIZE 112 /* = (num vec+1) * 4 */
00196 
00197 
00198 
00199 
00200 
00201 /* TCCR3B bit definitions, memory mapped I/O */
00202 
00203 #define ICNC3   7
00204 #define ICES3   6
00205 #define WGM33   4
00206 #define WGM32   3
00207 #define CS32    2
00208 #define CS31    1
00209 #define CS30    0
00210 
00211 
00212 
00213 /* TCCR3A bit definitions, memory mapped I/O */
00214 
00215 #define COM3A1  7
00216 #define COM3A0  6
00217 #define COM3B1  5
00218 #define COM3B0  4
00219 #define FOC3A   3
00220 #define FOC3B   2
00221 #define WGM31   1
00222 #define WGM30   0
00223 
00224 
00225 
00226 /* ETIMSK bit definitions, memory mapped I/O */
00227 
00228 #define TICIE3          5
00229 #define OCIE3A          4
00230 #define OCIE3B          3
00231 #define TOIE3           2
00232 
00233 
00234 
00235 /* ETIFR bit definitions, memory mapped I/O */
00236 
00237 #define ICF3            5
00238 #define OCF3A           4
00239 #define OCF3B           3
00240 #define TOV3            2
00241 
00242 
00243 
00244 /* PCMSK1 bit definitions, memory mapped I/O */
00245 #define PCINT15 7
00246 #define PCINT14 6
00247 #define PCINT13 5
00248 #define PCINT12 4
00249 #define PCINT11 3
00250 #define PCINT10 2
00251 #define PCINT9  1
00252 #define PCINT8  0
00253 
00254 
00255 
00256 /* PCMSK0 bit definitions, memory mapped I/O */
00257 
00258 #define PCINT7  7
00259 #define PCINT6  6
00260 #define PCINT5  5
00261 #define PCINT4  4
00262 #define PCINT3  3
00263 #define PCINT2  2
00264 #define PCINT1  1
00265 #define PCINT0  0
00266 
00267 
00268 
00269 /* CLKPR bit definitions, memory mapped I/O */
00270 
00271 #define CLKPCE  7
00272 #define CLKPS3  3
00273 #define CLKPS2  2
00274 #define CLKPS1  1
00275 #define CLKPS0  0
00276 
00277 
00278 
00279 /* SREG bit definitions */
00280 /* Not written, set using other mechanisms. */
00281 
00282 
00283 /* SPH bit definitions */
00284 
00285 #define SP15    15
00286 #define SP14    14
00287 #define SP13    13
00288 #define SP12    12
00289 #define SP11    11
00290 #define SP10    10
00291 #define SP9     9
00292 #define SP8     8
00293 
00294 
00295 
00296 /* SPL bit definitions */
00297 
00298 #define SP7     7
00299 #define SP6     6
00300 #define SP5     5
00301 #define SP4     4
00302 #define SP3     3
00303 #define SP2     2
00304 #define SP1     1
00305 #define SP0     0
00306 
00307 
00308 
00309 /* UBRR1H bit definitions */
00310 
00311 #define URSEL1  7
00312 #define UBRR111 3
00313 #define UBRR110 2
00314 #define UBRR19  1
00315 #define UBRR18  0
00316 
00317 
00318 
00319 /* UCSR1C bit definitions */
00320 
00321 #define URSEL1  7
00322 #define UMSEL1  6
00323 #define UPM11   5
00324 #define UPM10   4
00325 #define USBS1   3
00326 #define UCSZ11  2
00327 #define UCSZ10  1
00328 #define UCPOL1  0
00329 
00330 
00331 
00332 /* GICR bit definitions */
00333 
00334 #define INT1    7
00335 #define INT0    6
00336 #define INT2    5
00337 #define PCIE1   4
00338 #define PCIE0   3
00339 #define IVSEL   1
00340 #define IVCE    0
00341 
00342 
00343 
00344 /* GIFR bit definitions */
00345 
00346 #define INTF1   7
00347 #define INTF0   6
00348 #define INTF2   5
00349 #define PCIF1   4
00350 #define PCIF0   3
00351 
00352 
00353 
00354 /* TIMSK bit definitions */
00355 
00356 #define TOIE1   7
00357 #define OCIE1A  6
00358 #define OCIE1B  5
00359 #define OCIE2   4
00360 #define TICIE1  3
00361 #define TOIE2   2
00362 #define TOIE0   1
00363 #define OCIE0   0
00364 
00365 
00366 
00367 /* TIFR bit definitions */
00368 
00369 #define TOV1    7
00370 #define OCF1A   6
00371 #define OCF1B   5
00372 #define OCF2    4
00373 #define ICF1    3
00374 #define TOV2    2
00375 #define TOV0    1
00376 #define OCF0    0
00377 
00378 
00379 
00380 /* SPMCR bit definitions */ 
00381 
00382 #define SPMIE   7
00383 #define RWWSB   6
00384 #define RWWSRE  4
00385 #define BLBSET  3
00386 #define PGWRT   2
00387 #define PGERS   1
00388 #define SPMEN   0
00389 
00390 
00391 
00392 /* EMCUCR bit definitions */
00393 
00394 #define SM0     7
00395 #define SRL2    6
00396 #define SRL1    5
00397 #define SRL0    4
00398 #define SRW01   3
00399 #define SRW00   2
00400 #define SRW11   1
00401 #define ISC2    0
00402 
00403 
00404 
00405 /* MCUCR bit definitions */
00406 
00407 #define SRE     7
00408 #define SRW10   6
00409 #define SE      5
00410 #define SM1     4
00411 #define ISC11   3
00412 #define ISC10   2
00413 #define ISC01   1
00414 #define ISC00   0
00415 
00416 
00417 
00418 /* MCUCSR bit definitions */
00419 
00420 #define JTD     7
00421 #define SM2     5
00422 #define JTRF    4
00423 #define WDRF    3
00424 #define BORF    2
00425 #define EXTRF   1
00426 #define PORF    0
00427 
00428 
00429 
00430 /* TCCR0 bit definitions */
00431 
00432 #define FOC0    7
00433 #define WGM00   6
00434 #define COM01   5
00435 #define COM00   4
00436 #define WGM01   3
00437 #define CS02    2
00438 #define CS01    1
00439 #define CS00    0
00440 
00441 
00442 
00443 /* SFIOR bit definitions */
00444 
00445 #define TSM     7
00446 #define XMBK    6
00447 #define XMM2    5
00448 #define XMM1    4
00449 #define XMM0    3
00450 #define PUD     2
00451 #define PSR2    1
00452 #define PSR310  0
00453 
00454 
00455 
00456 /* TCCR1A bit definitions */
00457 
00458 #define COM1A1
00459 #define COM1A0
00460 #define COM1B1
00461 #define COM1B0
00462 #define FOC1A
00463 #define FOC1B
00464 #define WGM11
00465 #define WGM10
00466 
00467 
00468 
00469 
00470 /* TCCR1B bit definitions */
00471 
00472 #define ICNC1   7               /* Input Capture Noise Canceler */
00473 #define ICES1   6               /* Input Capture Edge Select */
00474 #define WGM13   4               /* Waveform Generation Mode 3 */
00475 #define WGM12   3               /* Waveform Generation Mode 2 */
00476 #define CS12    2               /* Clock Select 2 */
00477 #define CS11    1               /* Clock Select 1 */
00478 #define CS10    0               /* Clock Select 0 */
00479 
00480 
00481 
00482 /* TCCR2 bit definitions */
00483 
00484 #define FOC2    7
00485 #define WGM20   6
00486 #define COM21   5
00487 #define COM20   4
00488 #define WGM21   3
00489 #define CS22    2
00490 #define CS21    1
00491 #define CS20    0
00492 
00493 
00494 
00495 /* ASSR bit definitions */
00496 
00497 #define AS2     3
00498 #define TCON2UB 2
00499 #define OCR2UB  1
00500 #define TCR2UB  0
00501 
00502 
00503 
00504 /* WDTCR bit definitions */
00505 
00506 #define WDCE    4
00507 #define WDE     3
00508 #define WDP2    2
00509 #define WDP1    1
00510 #define WDP0    0
00511 
00512 
00513 
00514 /* UBRR0H bif definitions */
00515 
00516 #define URSEL0  7
00517 #define UBRR011 3
00518 #define UBRR010 2
00519 #define UBRR09  1
00520 #define UBRR08  0
00521 
00522 
00523 
00524 /* UCSR0C bit definitions */
00525 
00526 #define URSEL0  7
00527 #define UMSEL0  6
00528 #define UPM01   5
00529 #define UPM00   4
00530 #define USBS0   3
00531 #define UCSZ01  2
00532 #define UCSZ00  1
00533 #define UCPOL0  0
00534 
00535 
00536 
00537 /* EEARH bit definitions */
00538 
00539 #define EEAR8   0
00540 
00541 
00542 
00543 /* EECR bit definitions */
00544 
00545 #define EERIE   3
00546 #define EEMWE   2
00547 #define EEWE    1
00548 #define EERE    0
00549 
00550 
00551 
00552 /* PORTA bit definitions */
00553 
00554 #define PA7     7
00555 #define PA6     6
00556 #define PA5     5
00557 #define PA4     4
00558 #define PA3     3
00559 #define PA2     2
00560 #define PA1     1
00561 #define PA0     0
00562 
00563 
00564 
00565 /* DDRA bit definitions */
00566 
00567 #define DDA7    7
00568 #define DDA6    6
00569 #define DDA5    5
00570 #define DDA4    4
00571 #define DDA3    3
00572 #define DDA2    2
00573 #define DDA1    1
00574 #define DDA0    0
00575 
00576 
00577 
00578 /* PINA bit definitions */
00579 
00580 #define PINA7   7
00581 #define PINA6   6
00582 #define PINA5   5
00583 #define PINA4   4
00584 #define PINA3   3
00585 #define PINA2   2
00586 #define PINA1   1
00587 #define PINA0   0
00588 
00589 
00590 /* PORTB bit definitions */
00591 
00592 #define PB7     7
00593 #define PB6     6
00594 #define PB5     5
00595 #define PB4     4
00596 #define PB3     3
00597 #define PB2     2
00598 #define PB1     1
00599 #define PB0     0
00600 
00601 
00602 
00603 /* DDRB bit definitions */
00604 
00605 #define DDB7    7
00606 #define DDB6    6
00607 #define DDB5    5
00608 #define DDB4    4
00609 #define DDB3    3
00610 #define DDB2    2
00611 #define DDB1    1
00612 #define DDB0    0
00613 
00614 
00615 
00616 /* PINB bit definitions */
00617 
00618 #define PINB7   7
00619 #define PINB6   6
00620 #define PINB5   5
00621 #define PINB4   4
00622 #define PINB3   3
00623 #define PINB2   2
00624 #define PINB1   1
00625 #define PINB0   0
00626 
00627 
00628 
00629 /* PORTC bit definitions */
00630 
00631 #define PC7      7
00632 #define PC6      6
00633 #define PC5      5
00634 #define PC4      4
00635 #define PC3      3
00636 #define PC2      2
00637 #define PC1      1
00638 #define PC0      0
00639 
00640 
00641 
00642 /* DDRC bit definitions */
00643 
00644 #define DDC7    7
00645 #define DDC6    6
00646 #define DDC5    5
00647 #define DDC4    4
00648 #define DDC3    3
00649 #define DDC2    2
00650 #define DDC1    1
00651 #define DDC0    0
00652 
00653 
00654 
00655 /* PINC bit definitions */
00656 
00657 #define PINC7   7
00658 #define PINC6   6
00659 #define PINC5   5
00660 #define PINC4   4
00661 #define PINC3   3
00662 #define PINC2   2
00663 #define PINC1   1
00664 #define PINC0   0
00665 
00666 
00667 
00668 /* PORTD bit definitions */
00669 
00670 #define PD7      7
00671 #define PD6      6
00672 #define PD5      5
00673 #define PD4      4
00674 #define PD3      3
00675 #define PD2      2
00676 #define PD1      1
00677 #define PD0      0
00678 
00679 
00680 
00681 /* DDRD bit definitions */
00682 
00683 #define DDD7    7
00684 #define DDD6    6
00685 #define DDD5    5
00686 #define DDD4    4
00687 #define DDD3    3
00688 #define DDD2    2
00689 #define DDD1    1
00690 #define DDD0    0
00691 
00692 
00693 
00694 /* PIND bit definitions */
00695 
00696 #define PIND7   7
00697 #define PIND6   6
00698 #define PIND5   5
00699 #define PIND4   4
00700 #define PIND3   3
00701 #define PIND2   2
00702 #define PIND1   1
00703 #define PIND0   0
00704 
00705 
00706 
00707 /* SPSR bit definitions */
00708 
00709 #define SPIF    7
00710 #define WCOL    6
00711 #define SPI2X   0
00712 
00713 
00714 
00715 /* SPCR bit definitions */
00716 
00717 #define SPIE    7
00718 #define SPE     6
00719 #define DORD    5
00720 #define MSTR    4
00721 #define CPOL    3
00722 #define CPHA    2
00723 #define SPR1    1
00724 #define SPR0    0
00725 
00726 
00727 
00728 /* UCSR0A bit definitions */
00729 
00730 #define RXC0    7
00731 #define TXC0    6
00732 #define UDRE0   5
00733 #define FE0     4
00734 #define DOR0    3
00735 #define PE0     2
00736 #define U2X0    1
00737 #define MPCM0   0
00738 
00739 
00740 
00741 /* UCSR0B bit definitions */
00742 
00743 #define RXCIE0  7
00744 #define TXCIE0  6
00745 #define UDRIE0  5
00746 #define RXEN0   4
00747 #define TXEN0   3
00748 #define UCSZ02  2
00749 #define RXB80   1
00750 #define TXB80   0
00751 
00752 
00753 
00754 /* ACSR bit definitions */
00755 
00756 #define ACD     7
00757 #define ACBG    6
00758 #define ACO     5
00759 #define ACI     4
00760 #define ACIE    3
00761 #define ACIC    2
00762 #define ACIS1   1
00763 #define ACIS0   0
00764 
00765 
00766 
00767 /* PORTE bit definitions */
00768 
00769 #define PORTE2  2
00770 #define PORTE1  1
00771 #define PORTE0  0
00772 
00773 
00774 
00775 /* DDRE bit definitions */
00776 
00777 #define DDE2    2
00778 #define DDE1    1
00779 #define DDE0    0
00780 
00781 
00782 
00783 /* PINE bit definitions */
00784 
00785 #define PINE2   2
00786 #define PINE1   1
00787 #define PINE0   0
00788 
00789 
00790 
00791 /* UCSR1A bit definitions */
00792 
00793 #define RXC1    7
00794 #define TXC1    6
00795 #define UDRE1   5
00796 #define FE1     4
00797 #define DOR1    3
00798 #define PE1     2
00799 #define U2X1    1
00800 #define MPCM1   0
00801 
00802 
00803 
00804 /* UCSR1B bit definitions */
00805 
00806 #define RXCIE1  7
00807 #define TXCIE1  6
00808 #define UDRIE1  5
00809 #define RXEN1   4
00810 #define TXEN1   3
00811 #define UCSZ12  2
00812 #define RXB81   1
00813 #define TXB81   0
00814 
00815 
00816 /* Pointer registers (same for all AVR devices so far) */
00817 
00818 #define XL r26
00819 #define XH r27
00820 #define YL r28
00821 #define YH r29
00822 #define ZL r30
00823 #define ZH r31
00824 
00825 
00826 /* Last memory addresses */
00827 
00828 #define RAMEND          0x4FF
00829 #define XRAMEND         0xFFFF
00830 #define E2END           0x1FF
00831 #define FLASHEND        0x3FFF
00832 
00833 
00834 #endif  /* _AVR_IOM162_H_ */

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