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

iom169.h

00001 /* Copyright (c) 2002, Juergen Schilling
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 /* iom169.h - definitions for ATmega169 */
00027 
00028 #ifndef _AVR_IOM169_H_
00029 #define _AVR_IOM169_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_ "iom169.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 /* Port A */
00048 #define PINA   _SFR_IO8(0x00)
00049 #define DDRA   _SFR_IO8(0x01)
00050 #define PORTA  _SFR_IO8(0x02)
00051 
00052 /* Port B */
00053 #define PINB   _SFR_IO8(0x03)
00054 #define DDRB   _SFR_IO8(0x04)
00055 #define PORTB  _SFR_IO8(0x05)
00056 
00057 /* Port C */
00058 #define PINC   _SFR_IO8(0x06)
00059 #define DDRC   _SFR_IO8(0x07)
00060 #define PORTC  _SFR_IO8(0x08)
00061 
00062 /* Port D */
00063 #define PIND   _SFR_IO8(0x09)
00064 #define DDRD   _SFR_IO8(0x0A)
00065 #define PORTD  _SFR_IO8(0x0B)
00066 
00067 /* Port E */
00068 #define PINE   _SFR_IO8(0x0C)
00069 #define DDRE   _SFR_IO8(0x0D)
00070 #define PORTE  _SFR_IO8(0x0E)
00071 
00072 /* Port F */
00073 #define PINF   _SFR_IO8(0x0F)
00074 #define DDRF   _SFR_IO8(0x10)
00075 #define PORTF  _SFR_IO8(0x11)
00076 
00077 /* Port G */
00078 #define PING   _SFR_IO8(0x12)
00079 #define DDRG   _SFR_IO8(0x13)
00080 #define PORTG  _SFR_IO8(0x14)
00081 
00082 /* Timer/Counter 0 interrupt Flag Register */
00083 #define TIFR0  _SFR_IO8(0x15)
00084 
00085 /* Timer/Counter 1 interrupt Flag Register */
00086 #define TIFR1  _SFR_IO8(0x16)
00087 
00088 /* Timer/Counter 2 interrupt Flag Register */
00089 #define TIFR2  _SFR_IO8(0x17)
00090 
00091 /* External Interrupt Flag Register */
00092 #define EIFR   _SFR_IO8(0x1C)
00093 
00094 /* External Interrupt Mask Register */
00095 #define EIMSK  _SFR_IO8(0x1D)
00096 
00097 /* General Purpose I/O Register 0 */
00098 #define GPIOR0 _SFR_IO8(0x1E)
00099 
00100 /* EEPROM Control Register */
00101 #define EECR   _SFR_IO8(0x1F)
00102 
00103 /* EEPROM Data Register */
00104 #define EEDR   _SFR_IO8(0x20)
00105 
00106 /* EEPROM Address Register */
00107 #define EEAR   _SFR_IO16(0x21)
00108 #define EEARL  _SFR_IO8(0x21)
00109 #define EEARH  _SFR_IO8(0x22)
00110 
00111 /* General Timer/Counter Control Register */
00112 #define GTCCR  _SFR_IO8(0x23)
00113 
00114 /* Timer/Counter Control Register A */
00115 #define TCCR0A _SFT_IO8(0x24)
00116 
00117 /* Timer/Counter Register */
00118 #define TCNT9  _SFR_IO8(0x26)
00119 
00120 /* Output Compare Register A */
00121 #define OCR0A  _SFR_IO8(0x27)
00122 
00123 /* General Purpose I/O Register 1 */
00124 #define GPIOR1 _SFR_IO8(0x2A)
00125 
00126 /* General Purpose I/O Register 2 */
00127 #define GPIOR2 _SFR_IO8(0x2B)
00128 
00129 /* SPI Control Register */
00130 #define SPCR   _SFR_IO8(0x2C)
00131 
00132 /* SPI Status Register */
00133 #define SPSR   _SFR_IO8(0x2D)
00134 
00135 /* SPI Data Register */
00136 #define SPDR   _SFR_IO8(0x2E)
00137 
00138 /* Analog Comperator Control and Status Register */
00139 #define ACSR   _SFR_IO8(0x30)
00140 
00141 /* On-chip Debug Register */
00142 #define OCDR   _SFR_IO8(0x31)
00143 
00144 /* Sleep Mode Control Register */
00145 #define SMCR   _SFR_IO8(0x33)
00146 
00147 /* MCU Status Register */
00148 #define MCUSR  _SFR_IO8(0x34)
00149 
00150 /* MCU Control Rgeister */
00151 #define MCUCR  _SFR_IO8(0x35)
00152 
00153 /* Store Program Memory Control and Status Register */
00154 #define SPMCSR _SFR_IO8(0x37)
00155 
00156 /* Stack Pointer */
00157 #define SP     _SFR_IO16(0x3D)
00158 #define SPL    _SFR_IO8(0x3D)
00159 #define SPH    _SFR_IO8(0x3E)
00160 
00161 /* Status Register */
00162 #define SREG   _SFR_IO8(0x3F)
00163 
00164 /* Watchdog Timer Control Register */
00165 #define WDTCR  _SFR_MEM8(0x60)
00166 
00167 /* Clock Prescale Register */
00168 #define CLKPR  _SFR_MEM8(0x61)
00169 
00170 /* Oscillator Calibration Register */
00171 #define OSCCAL _SFR_MEM8(0x66)
00172 
00173 /* External Interrupt Control Register A */
00174 #define EICRA  _SFR_MEM8(0x69)
00175 
00176 /* Pin Chandge Mask Register */
00177 #define PCMSK  _SFR_MEM16(0x6B)
00178 #define PCMSK0 _SFR_MEM8(0x6B)
00179 #define PCMSK1 _SFR_MEM8(0x6C)
00180 
00181 /* Timer/Counter 0 Interrupt Mask Register */
00182 #define TIMSK0 _SFR_MEM8(0x6E)
00183 
00184 /* Timer/Counter 1 Interrupt Mask Register */
00185 #define TIMSK1 _SFR_MEM8(0x6F)
00186 
00187 /* Timer/Counter 2 Interrupt Mask Register */
00188 #define TIMSK2 _SFR_MEM8(0x70)
00189 
00190 /* ADC Data Register */
00191 #define ADC    _SFR_MEM16(0x78)
00192 #define ADCL   _SFR_MEM8(0x78)
00193 #define ADCH   _SFR_MEM8(0x79)
00194 
00195 /* ADC Control and Status Register A */
00196 #define ADCSRA _SFR_MEM8(0x7A)
00197 
00198 /* ADC Control and Status Register B */
00199 #define ADCSRB _SFR_MEM8(0x7B)
00200 
00201 /* ADC Multiplex Selection Register */
00202 #define ADMUX  _SFR_MEM8(0x7C)
00203 
00204 /* Digital Input Disable Register 0 */
00205 #define DIDR0  _SFR_MEM8(0x7E)
00206 
00207 /* Digital Input Disable Register 1 */
00208 #define DIDR1  _SFR_MEM8(0x7F)
00209 
00210 /* Timer/Counter1 Control Register A */
00211 #define TCCR1A _SFR_MEM8(0x80)
00212 
00213 /* Timer/Counter1 Control Register B */
00214 #define TCCR1B _SFR_MEM8(0x81)
00215 
00216 /* Timer/Counter1 Control Register C */
00217 #define TCCR1C _SFR_MEM8(0x82)
00218 
00219 /* Timer/Counter1 Register */
00220 #define TCNT1  _SFR_MEM16(0x84)
00221 #define TCNT1L _SFR_MEM8(0x84)
00222 #define TCNT1H _SFR_MEM8(0x85)
00223 
00224 /* Timer/Counter1 Input Capture Register */
00225 #define ICR1   _SFR_MEM16(0x86)
00226 #define ICR1L  _SFR_MEM8(0x86)
00227 #define ICR1H  _SFR_MEM8(0x87)
00228 
00229 /* Timer/Counter1 Output Compare Register A */
00230 #define OCRA1  _SFR_MEM16(0x88)
00231 #define OCRA1L _SFR_MEM8(0x88)
00232 #define OCRA1H _SFR_MEM8(0x89)
00233 
00234 /* Timer/Counter1 Output Compare Registare B */
00235 #define OCRB1  _SFR_MEM16(0x8A)
00236 #define OCRB1L _SFR_MEM8(0x8A)
00237 #define OCRB1H _SFR_MEM8(0x8B)
00238 
00239 /* Timer/Counter2 Control Register A */
00240 #define TCCR2A _SFR_MEM8(0xB0)
00241 
00242 /* Timer/Counter2 Register */
00243 #define TCNT2  _SFR_MEM8(0xB2)
00244 
00245 /* Timer/Counter2 Output Compare Register */
00246 #define OCR2A  _SFR_MEM8(0xB3)
00247 
00248 /* Asynchronous Status Register */
00249 #define ASSR   _SFR_MEM8(0xB6)
00250 
00251 /* USI Control Register */
00252 #define USICR  _SFR_MEM8(0xB8)
00253 
00254 /* USI Status Register */
00255 #define USISR  _SFR_MEM8(0xB9)
00256 
00257 /* USI Data Register */
00258 #define USIDR  _SFR_MEM8(0xBA)
00259 
00260 /* USART0 Control and Status Register A */
00261 #define UCSR0A _SFR_MEM8(0xC0)
00262 
00263 /* USART0 Control and Status Register B */
00264 #define UCSR0B _SFR_MEM8(0xC1)
00265 
00266 /* USART0 Control and Status Register C */
00267 #define UCSR0C _SFR_MEM8(0xC2)
00268 
00269 /* USART0 Baud Rate Register */
00270 #define UBRR0  _SFR_MEM16(0xC4)
00271 #define UBRR0L _SFR_MEM8(0xC4)
00272 #define UBRR0H _SFR_MEM8(0xC5)
00273 
00274 /* USART0 I/O Data Register */
00275 #define UDR0   _SFR_MEM8(0xC6)
00276 
00277 /* LCD Control and Status Register A */
00278 #define LCDCRA _SFR_MEM8(0xE4)
00279 
00280 /* LCD Control and Status Register B */
00281 #define LCDCRB _SFR_MEM8(0xE5)
00282 
00283 /* LCD Frame Rate Register */
00284 #define LCDFRR _SFR_MEM8(0xE6)
00285 
00286 /* LCD Contrast Control Register */
00287 #define LCDCCR _SFR_MEM8(0xE7)
00288 
00289 /* LCD Memory mapping */
00290 #define LCDDR0 _SFR_MEM8(0xEC)
00291 #define LCDDR1 _SFR_MEM8(0xED)
00292 #define LCDDR2 _SFR_MEM8(0xEE)
00293 #define LCDDR3 _SFR_MEM8(0xEF)
00294 #define LCDDR5 _SFR_MEM8(0xF1)
00295 #define LCDDR6 _SFR_MEM8(0xF2)
00296 #define LCDDR7 _SFR_MEM8(0xF3)
00297 #define LCDDR8 _SFR_MEM8(0xF4)
00298 #define LCDDR10 _SFR_MEM8(0xF6)
00299 #define LCDDR11 _SFR_MEM8(0xF7)
00300 #define LCDDR12 _SFR_MEM8(0xF8)
00301 #define LCDDR13 _SFR_MEM8(0xF9)
00302 #define LCDDR15 _SFR_MEM8(0xFB)
00303 #define LCDDR16 _SFR_MEM8(0xFC)
00304 #define LCDDR17 _SFR_MEM8(0xFD)
00305 #define LCDDR18 _SFR_MEM8(0xFE)
00306 
00307 /* Interrupt vectors */
00308 
00309 #define SIG_INTERRUPT0          _VECTOR(1)
00310 #define SIG_INTERRUPT1          _VECTOR(2)
00311 #define SIG_INTERRUPT2          _VECTOR(3)
00312 #define SIG_INTERRUPT3     _VECTOR(4)
00313 #define SIG_OUTPUT_COMPARE2     _VECTOR(5)
00314 #define SIG_OVERFLOW2           _VECTOR(6)
00315 #define SIG_INPUT_CAPTURE1      _VECTOR(7)
00316 #define SIG_OUTPUT_COMPARE1A    _VECTOR(8)
00317 #define SIG_OUTPUT_COMPARE1B    _VECTOR(9)
00318 #define SIG_OVERFLOW1           _VECTOR(10)
00319 #define SIG_OUTPUT_COMPARE0     _VECTOR(11)
00320 #define SIG_OVERFLOW0           _VECTOR(12)
00321 #define SIG_SPI                 _VECTOR(13)
00322 #define SIG_UART0_RECV          _VECTOR(14)
00323 #define SIG_UART0_DATA          _VECTOR(15)
00324 #define SIG_UART0_TRANS         _VECTOR(16)
00325 #define SIG_USI_START           _VECTOR(17)
00326 #define SIG_USI_OVERFLOW   _VECTOR(18)
00327 #define SIG_COMPERATOR     _VECTOR(19)
00328 #define SIG_ADC            _VECTOR(20)
00329 #define SIG_EEPROM_READY        _VECTOR(21)
00330 #define SIG_SPM_READY           _VECTOR(22)
00331 #define SIG_LCD            _VECTOR(23)
00332 
00333 #define _VECTORS_SIZE 96
00334 
00335 /* Bit numbers */
00336 
00337 /*
00338    PA7 = SEG3
00339    PA6 = SEG2
00340    PA5 = SEG1
00341    PA4 = SEG0
00342    PA3 = COM3
00343    PA2 = COM2
00344    PA1 = COM1
00345    PA0 = COM0
00346 */
00347 
00348 /* PORTA */
00349 #define PA7     7
00350 #define PA6     6
00351 #define PA5     5
00352 #define PA4     4
00353 #define PA3     3
00354 #define PA2     2
00355 #define PA1     1
00356 #define PA0     0
00357 
00358 /* DDRA */
00359 #define DDA7    7
00360 #define DDA6    6
00361 #define DDA5    5
00362 #define DDA4    4
00363 #define DDA3    3
00364 #define DDA2    2
00365 #define DDA1    1
00366 #define DDA0    0
00367 
00368 /* PINA */
00369 #define PINA7   7
00370 #define PINA6   6
00371 #define PINA5   5
00372 #define PINA4   4
00373 #define PINA3   3
00374 #define PINA2   2
00375 #define PINA1   1
00376 #define PINA0   0
00377 
00378 /*
00379    PB7 = OC2A / PCINT15
00380    PB6 = OC1B / PCINT14
00381    PB5 = OC1A / PCINT13
00382    PB4 = OC0A / PCINT12
00383    PB3 = MISO / PCINT11
00384    PB2 = MOSI / PCINT10
00385    PB1 = SCK / PCINT9
00386    PB0 = SS# / PCINT8
00387  */
00388 
00389 /* PORTB */
00390 #define PB7     7
00391 #define PB6     6
00392 #define PB5     5
00393 #define PB4     4
00394 #define PB3     3
00395 #define PB2     2
00396 #define PB1     1
00397 #define PB0     0
00398 
00399 /* DDRB */
00400 #define DDB7    7
00401 #define DDB6    6
00402 #define DDB5    5
00403 #define DDB4    4
00404 #define DDB3    3
00405 #define DDB2    2
00406 #define DDB1    1
00407 #define DDB0    0
00408 
00409 /* PINB */
00410 #define PINB7   7
00411 #define PINB6   6
00412 #define PINB5   5
00413 #define PINB4   4
00414 #define PINB3   3
00415 #define PINB2   2
00416 #define PINB1   1
00417 #define PINB0   0
00418 
00419 /*
00420    PC7 = SEG5
00421    PC6 = SEG6
00422    PC5 = SEG7
00423    PC4 = SEG8
00424    PC3 = SEG9
00425    PC2 = SEG10
00426    PC1 = SEG11
00427    PC0 = SEG12
00428 */
00429 
00430 /* PORTC */
00431 #define PC7      7
00432 #define PC6      6
00433 #define PC5      5
00434 #define PC4      4
00435 #define PC3      3
00436 #define PC2      2
00437 #define PC1      1
00438 #define PC0      0
00439 
00440 /* DDRC */
00441 #define DDC7    7
00442 #define DDC6    6
00443 #define DDC5    5
00444 #define DDC4    4
00445 #define DDC3    3
00446 #define DDC2    2
00447 #define DDC1    1
00448 #define DDC0    0
00449 
00450 /* PINC */
00451 #define PINC7   7
00452 #define PINC6   6
00453 #define PINC5   5
00454 #define PINC4   4
00455 #define PINC3   3
00456 #define PINC2   2
00457 #define PINC1   1
00458 #define PINC0   0
00459 
00460 /*
00461    PD7 = SEG15
00462    PD6 = SEG16
00463    PD5 = SEG17
00464    PD4 = SEG18
00465    PD3 = SEG19
00466    PD2 = SEG20
00467    PD1 = INT0 / SEG21
00468    PD0 = ICP / SEG22
00469  */
00470 
00471 /* PORTD */
00472 #define PD7      7
00473 #define PD6      6
00474 #define PD5      5
00475 #define PD4      4
00476 #define PD3      3
00477 #define PD2      2
00478 #define PD1      1
00479 #define PD0      0
00480 
00481 /* DDRD */
00482 #define DDD7    7
00483 #define DDD6    6
00484 #define DDD5    5
00485 #define DDD4    4
00486 #define DDD3    3
00487 #define DDD2    2
00488 #define DDD1    1
00489 #define DDD0    0
00490 
00491 /* PIND */
00492 #define PIND7   7
00493 #define PIND6   6
00494 #define PIND5   5
00495 #define PIND4   4
00496 #define PIND3   3
00497 #define PIND2   2
00498 #define PIND1   1
00499 #define PIND0   0
00500 
00501 /*
00502    PE7 = CLK0 / PCINT7
00503    PE6 = DO / PCINT6
00504    PE5 = DI / SDA / PCINT5
00505    PE4 = USCK / SCL / PCINT4
00506    PE3 = AIN1 / PCINT3
00507    PE2 = XCK / AIN0 / PCINT2
00508    PE1 = TXD / PCINT1
00509    PE0 = RXD / PCINT0
00510  */
00511 
00512 /* PORTE */
00513 #define PE7 7
00514 #define PE6 6
00515 #define PE5 5
00516 #define PE4 4
00517 #define PE3 3
00518 #define PE2 2
00519 #define PE1 1
00520 #define PE0 0
00521 
00522 /* DDRE */
00523 #define DDE7    7
00524 #define DDE6    6
00525 #define DDE5    5
00526 #define DDE4    4
00527 #define DDE3    3
00528 #define DDE2    2
00529 #define DDE1    1
00530 #define DDE0    0
00531 
00532 /* PINE */
00533 #define PINE7   7
00534 #define PINE6   6
00535 #define PINE5   5
00536 #define PINE4   4
00537 #define PINE3   3
00538 #define PINE2   2
00539 #define PINE1   1
00540 #define PINE0   0
00541 
00542 /*
00543    PF7 = ADC7 / TDI
00544    PF6 = ADC6 / TDO
00545    PF5 = ADC5 / TMS
00546    PF4 = ADC4 / TCK
00547    PF3 = ADC3
00548    PF2 = ADC2
00549    PF1 = ADC1
00550    PF0 = ADC0
00551  */
00552 
00553 /* PORTF */
00554 #define PF7 7
00555 #define PF6 6
00556 #define PF5 5
00557 #define PF4 4
00558 #define PF3 3
00559 #define PF2 2
00560 #define PF1 1
00561 #define PF0 0
00562 
00563 /* DDRF */
00564 #define DDF7    7
00565 #define DDF6    6
00566 #define DDF5    5
00567 #define DDF4    4
00568 #define DDF3    3
00569 #define DDF2    2
00570 #define DDF1    1
00571 #define DDF0    0
00572 
00573 /* PINF */
00574 #define PINF7   7
00575 #define PINF6   6
00576 #define PINF5   5
00577 #define PINF4   4
00578 #define PINF3   3
00579 #define PINF2   2
00580 #define PINF1   1
00581 #define PINF0   0
00582 
00583 /*
00584    PG5 = RESET#
00585    PG4 = T0 / SEG23
00586    PG3 = T1 / SEG24
00587    PG2 = SEG4
00588    PG1 = SEG13
00589    PG0 = SEG14
00590  */
00591 
00592 /* PORTG */
00593 #define PG5 5
00594 #define PG4 4
00595 #define PG3 3
00596 #define PG2 2
00597 #define PG1 1
00598 #define PG0 0
00599 
00600 /* DDRG */
00601 #define DDG4    4
00602 #define DDG3    3
00603 #define DDG2    2
00604 #define DDG1    1
00605 #define DDG0    0
00606 
00607 /* PINE */
00608 #define PINE7   7
00609 #define PINE6   6
00610 #define PINE5   5
00611 #define PINE4   4
00612 #define PINE3   3
00613 #define PINE2   2
00614 #define PINE1   1
00615 #define PINE0   0
00616 
00617 /* TIFR0 */
00618 #define OCF0A   1
00619 #define TOV0    0
00620 
00621 /* TIFR1 */
00622 #define ICF1   5
00623 #define OCF1B  2
00624 #define OCF1A   1
00625 #define TOV1    0
00626 
00627 /* TIFR2 */
00628 #define OCF2A   1
00629 #define TOV2    0
00630 
00631 /* EIFR */
00632 #define PCIF1  7
00633 #define PCIF0  6
00634 #define INTF0  0
00635 
00636 /* EIMSK */
00637 #define PCIE1  7
00638 #define PCIE0  6
00639 #define INT0   0
00640 
00641 /* EECR */
00642 #define EERIE   3
00643 #define EEMWE   2
00644 #define EEWE    1
00645 #define EERE    0
00646 
00647 /* GTCCR */
00648 #define TSM    7
00649 #define PSR2   1
00650 #define PSR10  0
00651 
00652 /* TCCR0A */
00653 #define FOC0A   7
00654 #define WGM00   6
00655 #define COM0A1  5
00656 #define COM0A0  4
00657 #define WGM01   3
00658 #define CS02    2
00659 #define CS01    1
00660 #define CS00    0
00661 
00662 /* SPCR */
00663 #define SPIE    7
00664 #define SPE        6
00665 #define DORD    5
00666 #define MSTR    4
00667 #define CPOL    3
00668 #define CPHA    2
00669 #define SPR1    1
00670 #define SPR0    0
00671 
00672 /* SPSR */
00673 #define SPIF    7
00674 #define WCOL    6
00675 #define SPI2X   0
00676 
00677 /* ACSR */
00678 #define ACD        7
00679 #define ACBG    6
00680 #define ACO        5
00681 #define ACI        4
00682 #define ACIE    3
00683 #define ACIC    2
00684 #define ACIS1   1
00685 #define ACIS0   0
00686 
00687 /* OCDR */
00688 #define IDRD   7
00689 #define OCD    7
00690 #define OCDR6  6
00691 #define OCDR5  5
00692 #define OCDR4  4
00693 #define OCDR3  3
00694 #define OCDR2  2
00695 #define OCDR1  1
00696 #define OCDR0  0
00697 
00698 /* SMCR */
00699 #define SM2    3
00700 #define SM1    2
00701 #define SM0    1
00702 #define SE     0
00703 
00704 /* MCUSR */
00705 #define JTRF   4
00706 #define WDRF   3
00707 #define BORF   2
00708 #define EXTRF  1
00709 #define PORF   0
00710 
00711 /* MCUCR */
00712 #define JTD    7
00713 #define PUD    4
00714 #define IVSEL  1
00715 #define IVCE   0
00716 
00717 /* SPMCSR */
00718 #define SPMIE  7
00719 #define RWWSB  6
00720 #define RWWSRE 4
00721 #define BLBSET 3
00722 #define PGWRT  2
00723 #define PGERS  1
00724 #define SPMEN  0
00725 
00726 /* WDTCR */
00727 #define WDTCE   4
00728 #define WDE        3
00729 #define WDP2    2
00730 #define WDP1    1
00731 #define WDP0    0
00732 
00733 /* CLKPR */
00734 #define CLKPCE 7
00735 #define CLKPS3 3
00736 #define CLKPS2 2
00737 #define CLKPS1 1
00738 #define CLKPS0 0
00739 
00740 /* PCMSK0 */
00741 #define PCINT7 7
00742 #define PCINT6 6
00743 #define PCINT5 5
00744 #define PCINT4 4
00745 #define PCINT3 3
00746 #define PCINT2 2
00747 #define PCINT1 1
00748 #define PCINT0 0
00749 
00750 /* PCMSK1 */
00751 #define PCINT15 7
00752 #define PCINT14 6
00753 #define PCINT13 5
00754 #define PCINT12 4
00755 #define PCINT11 3
00756 #define PCINT10 2
00757 #define PCINT9 1
00758 #define PCINT8 0
00759 
00760 /* TIMSK0 */
00761 #define OCIE0A 1
00762 #define TOIE0  0
00763 
00764 /* TIMSK1 */
00765 #define ICIE1  5
00766 #define OCIE1B 2
00767 #define OCIE1A 1
00768 #define TOIE1  0
00769 
00770 /* TIMSK2 */
00771 #define OCIE2A 1
00772 #define TOIE2  0
00773 
00774 /* ADCSRA */
00775 #define ADEN   7
00776 #define ADSC   6
00777 #define ADATE  5
00778 #define ADIF   4
00779 #define ADIE   3
00780 #define ADPS2  2
00781 #define ADPS1  1
00782 #define ADPS0  0
00783 
00784 /* ADCSRB */
00785 #define ADHSM  7
00786 #define ACME   6
00787 #define ADTS2  2
00788 #define ADTS1  1
00789 #define ADTS0  0
00790 
00791 /* ADMUX */
00792 #define REFS1  7
00793 #define REFS0  6
00794 #define ADLAR  5
00795 #define MUX4   4
00796 #define MUX3   3
00797 #define MUX2   2
00798 #define MUX1   1
00799 #define MUX0   0
00800 
00801 /* DIDR0 */
00802 #define AIN1D  1
00803 #define AIN0D  0
00804 
00805 /* DIDR1 */
00806 #define ADC7D  7
00807 #define ADC6D  6
00808 #define ADC5D  5
00809 #define ADC4D  4
00810 #define ADC3D  3
00811 #define ADC2D  2
00812 #define ADC1D  1
00813 #define ADC0D  0
00814 
00815 /* TCCR1A */
00816 #define COM1A1  7
00817 #define COM1A0  6
00818 #define COM1B1  5
00819 #define COM1B0  4
00820 #define WGM11   1
00821 #define WGM10   0
00822 
00823 /* TCCR1B */
00824 #define ICNC1   7
00825 #define ICES1   6
00826 #define WGM13  4
00827 #define WGM12   3
00828 #define CS12    2
00829 #define CS11    1
00830 #define CS10    0
00831 
00832 /* TCCR1C */
00833 #define FOC1A  7
00834 #define FOC1B  6
00835 
00836 /* TCCR2A */
00837 #define FOC2A   7
00838 #define WGM20   6
00839 #define COM2A1  5
00840 #define COM2A0  4
00841 #define WGM21   3
00842 #define CS22    2
00843 #define CS21    1
00844 #define CS20    0
00845 
00846 /* ASSR */
00847 #define EXCLK  4
00848 #define AS2        3
00849 #define TCN2UB  2
00850 #define OCR2UB  1
00851 #define TCR2UB  0
00852 
00853 /* USICR */
00854 #define USISIE 7
00855 #define USIOIE 6
00856 #define USIWM1 5
00857 #define USIWM0 4
00858 #define USICS1 3
00859 #define USICS0 2
00860 #define USICLK 1
00861 #define USITC  0
00862 
00863 /* USISR */
00864 #define USISIF 7
00865 #define USIOIF 6
00866 #define USIPF  5
00867 #define USIDC  4
00868 #define USICNT3 3
00869 #define USICNT2 2
00870 #define USICNT1 1
00871 #define USICNT0 0
00872 
00873 /* UCSR0A */
00874 #define RXC0    7
00875 #define TXC0    6
00876 #define UDRE0   5
00877 #define FE0        4
00878 #define DOR0    3
00879 #define PE0     2
00880 #define U2X0   1
00881 #define MPCM0   0
00882 
00883 /* UCSR0B */
00884 #define RXCIE0  7
00885 #define TXCIE0  6
00886 #define UDRIE0  5
00887 #define RXEN0   4
00888 #define TXEN0   3
00889 #define UCSZ02 2
00890 #define RXB80   1
00891 #define TXB80   0
00892 
00893 /* UCSR0C */
00894 #define UMSEL0 6
00895 #define UPM01  5
00896 #define UPM00  4
00897 #define USBS0  3
00898 #define UCSZ01 2
00899 #define UCSZ00 1
00900 #define UCPOL0 0
00901 
00902 /* LCDCRA */
00903 #define LCDEN  7
00904 #define LCDAB  6
00905 #define LCDIF  4
00906 #define LCDIE  3
00907 #define LCDBL  0
00908 
00909 /* LCDCRB */
00910 #define LCDCS  7
00911 #define LCD2B  6
00912 #define LCDMUX1 5
00913 #define LCDMUX0 4
00914 #define LCDPM2 2
00915 #define LCDPM1 1
00916 #define LCDPM0 0
00917 
00918 /* LCDFRR */
00919 #define LCDPS2 6
00920 #define LCDPS1 5
00921 #define LCDPS0 4
00922 #define LCDCD2 2
00923 #define LCDCD1 1
00924 #define LCDCD0 0
00925 
00926 /* LCDCCR */
00927 #define LCDCC3 3
00928 #define LCDCC2 2
00929 #define LCDCC1 1
00930 #define LCDCC0 0
00931 
00932 /* LCDDR0-18 */
00933 #define SEG24  0
00934 
00935 #define SEG23  7
00936 #define SEG22  6
00937 #define SEG21  5
00938 #define SEG20  4
00939 #define SEG19  3
00940 #define SEG18  2
00941 #define SEG17  1
00942 #define SEG16  0
00943 
00944 #define SEG15  7
00945 #define SEG14  6
00946 #define SEG13  5
00947 #define SEG12  4
00948 #define SEG11  3
00949 #define SEG10  2
00950 #define SEG9   1
00951 #define SEG8   0
00952 
00953 #define SEG7   7
00954 #define SEG6   6
00955 #define SEG5   5
00956 #define SEG4   4
00957 #define SEG3   3
00958 #define SEG2   2
00959 #define SEG1   1
00960 #define SEG0   0
00961 
00962 /* Pointer registers (same for all AVR devices so far) */
00963 #define XL r26
00964 #define XH r27
00965 #define YL r28
00966 #define YH r29
00967 #define ZL r30
00968 #define ZH r31
00969 
00970 /* Last memory addresses */
00971 #define RAMEND          0x4FF
00972 #define E2END           0x1FF
00973 #define FLASHEND        0x3FFF
00974 
00975 #endif  /* _AVR_IOM169_H_ */

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