/* Copyright (c) 2002, 2003, 2004, 2005 Juergen Schilling Eric B. Weddington All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* $Id: iom169.h 2231 2011-03-07 05:06:55Z arcanum $ */ /* iom169.h - definitions for ATmega169 */ /* This should be up to date with data sheet version 2514J-AVR-12/03. */ #ifndef _AVR_IOM169_H_ #define _AVR_IOM169_H_ 1 /* This file should only be included from , never directly. */ #ifndef _AVR_IO_H_ # error "Include instead of this file." #endif #ifndef _AVR_IOXXX_H_ # define _AVR_IOXXX_H_ "iom169.h" #else # error "Attempt to include more than one file." #endif /* I/O registers */ /* Port A */ #define PINA _SFR_IO8(0x00) #define DDRA _SFR_IO8(0x01) #define PORTA _SFR_IO8(0x02) /* Port B */ #define PINB _SFR_IO8(0x03) #define DDRB _SFR_IO8(0x04) #define PORTB _SFR_IO8(0x05) /* Port C */ #define PINC _SFR_IO8(0x06) #define DDRC _SFR_IO8(0x07) #define PORTC _SFR_IO8(0x08) /* Port D */ #define PIND _SFR_IO8(0x09) #define DDRD _SFR_IO8(0x0A) #define PORTD _SFR_IO8(0x0B) /* Port E */ #define PINE _SFR_IO8(0x0C) #define DDRE _SFR_IO8(0x0D) #define PORTE _SFR_IO8(0x0E) /* Port F */ #define PINF _SFR_IO8(0x0F) #define DDRF _SFR_IO8(0x10) #define PORTF _SFR_IO8(0x11) /* Port G */ #define PING _SFR_IO8(0x12) #define DDRG _SFR_IO8(0x13) #define PORTG _SFR_IO8(0x14) /* Timer/Counter 0 interrupt Flag Register */ #define TIFR0 _SFR_IO8(0x15) /* Timer/Counter 1 interrupt Flag Register */ #define TIFR1 _SFR_IO8(0x16) /* Timer/Counter 2 interrupt Flag Register */ #define TIFR2 _SFR_IO8(0x17) /* External Interrupt Flag Register */ #define EIFR _SFR_IO8(0x1C) /* External Interrupt Mask Register */ #define EIMSK _SFR_IO8(0x1D) /* General Purpose I/O Register 0 */ #define GPIOR0 _SFR_IO8(0x1E) #define EECR _SFR_IO8(0x1F) #define EEDR _SFR_IO8(0X20) /* Combine EEARL and EEARH */ #define EEAR _SFR_IO16(0x21) #define EEARL _SFR_IO8(0x21) #define EEARH _SFR_IO8(0X22) /* 6-char sequence denoting where to find the EEPROM registers in memory space. Adresses denoted in hex syntax with uppercase letters. Used by the EEPROM subroutines. First two letters: EECR address. Second two letters: EEDR address. Last two letters: EEAR address. */ #define __EEPROM_REG_LOCATIONS__ 1F2021 /* General Timer/Counter Control Register */ #define GTCCR _SFR_IO8(0x23) /* Timer/Counter Control Register A */ #define TCCR0A _SFR_IO8(0x24) /* Timer/Counter Register */ #define TCNT0 _SFR_IO8(0x26) /* Output Compare Register A */ #define OCR0A _SFR_IO8(0x27) /* General Purpose I/O Register 1 */ #define GPIOR1 _SFR_IO8(0x2A) /* General Purpose I/O Register 2 */ #define GPIOR2 _SFR_IO8(0x2B) /* SPI Control Register */ #define SPCR _SFR_IO8(0x2C) /* SPI Status Register */ #define SPSR _SFR_IO8(0x2D) /* SPI Data Register */ #define SPDR _SFR_IO8(0x2E) /* Analog Comperator Control and Status Register */ #define ACSR _SFR_IO8(0x30) /* On-chip Debug Register */ #define OCDR _SFR_IO8(0x31) /* Sleep Mode Control Register */ #define SMCR _SFR_IO8(0x33) /* MCU Status Register */ #define MCUSR _SFR_IO8(0x34) /* MCU Control Rgeister */ #define MCUCR _SFR_IO8(0x35) /* Store Program Memory Control and Status Register */ #define SPMCSR _SFR_IO8(0x37) /* Watchdog Timer Control Register */ #define WDTCR _SFR_MEM8(0x60) /* Clock Prescale Register */ #define CLKPR _SFR_MEM8(0x61) #define PRR _SFR_MEM8(0x64) #define PRADC 0 #define PRUSART0 1 #define PRSPI 2 #define PRTIM1 3 #define PRLCD 4 #define __AVR_HAVE_PRR ((1<