avr/cpp/atmega88/ExternalInterrupt.h

Go to the documentation of this file.
00001 /**********************************************************************************************************************\
00002 
00003         C++ library for Atmel AVR microcontrollers
00004         Copyright (C) 2007 Lauri Kirikal, Mikk Leini, MT� TT� Robotiklubi
00005 
00006         This program is free software; you can redistribute it and/or
00007         modify it under the terms of the GNU General Public License
00008         as published by the Free Software Foundation; either version 2
00009         of the License, or (at your option) any later version.
00010 
00011         This program is distributed in the hope that it will be useful,
00012         but WITHOUT ANY WARRANTY; without even the implied warranty of
00013         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014         GNU General Public License for more details.
00015 
00016         You should have received a copy of the GNU General Public License
00017         along with this program; if not, write to the Free Software
00018         Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019 
00020         See http://creativecommons.org/licenses/GPL/2.0/
00021 
00022         MT� TT� Robotiklubi  http://www.robotiklubi.ee robotiklubi@gmail.com
00023         Lauri Kirikal        laurikirikal@gmail.com
00024         Mikk Leini           mikk.leini@gmail.com
00025 
00026 \**********************************************************************************************************************/
00027 
00028 #ifndef __AVR_CPP_ATMEGA88_EXTERNAL_INTERRUPT_H__
00029 #define __AVR_CPP_ATMEGA88_EXTERNAL_INTERRUPT_H__
00030 
00031 /* This file should only be included from <avr/cpp/ExternalInterrupt.h>, never directly. */
00032 
00033 #ifndef __AVR_CPP_EXTERNAL_INTERRUPT_H__
00034 #ifdef __DOXYGEN__
00035 #include <avr/cpp/ExternalInterrupt.h>
00036 #else
00037 #error "Include <avr/cpp/ExternalInterrupt.h> instead of <avr/cpp/atmega88/ExternalInterrupt.h>."
00038 #endif
00039 #endif // ifndef __AVR_CPP_EXTERNAL_INTERRUPT_H__
00040 
00041 #ifndef __AVR_CPP_XXX_EXTERNAL_INTERRUPT_H__
00042 #define __AVR_CPP_XXX_EXTERNAL_INTERRUPT_H__ "atmega88/ExternalInterrupt.h"
00043 #else
00044 #error "Attempt to include more than one <avr/cpp/XXX/ExternalInterrupt.h> file."
00045 #endif
00046 
00047 #define INT0_ns         ExternalInterrupt
00048 #define INT1_ns         ExternalInterrupt
00049 #define PCINT0_ns       ExternalInterrupt
00050 #define PCINT1_ns       ExternalInterrupt
00051 #define PCINT2_ns       ExternalInterrupt
00052 
00053 #define INT0_struct             ExternalInterrupt::Interrupt0
00054 #define INT1_struct             ExternalInterrupt::Interrupt1
00055 #define PCINT0_struct   ExternalInterrupt::PinChangeInterrupt0
00056 #define PCINT1_struct   ExternalInterrupt::PinChangeInterrupt1
00057 #define PCINT2_struct   ExternalInterrupt::PinChangeInterrupt2
00058 
00059 
00060 namespace AVRCpp
00061 {
00062         namespace ExternalInterrupt
00063         {
00064                 struct Interrupt0 : Internal::InterruptBase <
00065                                 InputPin2<PortD>,                               /* InputPin */
00066                                 Event,                                                  /* EventEnum */
00067                                 Bits<_EICRA, _ISC00 | _ISC01>,  /* EventBits */
00068                                 Bits<_EIMSK, _INT0>,                    /* InterruptEnableBit */
00069                                 Bits<_EIFR, _INTF0>,                    /* InterruptFlagBit */
00070                                 0 >                                                             /* eventShift */
00071                                 
00072                 { __INTERRUPT_HANDLER_SUPPORT__ }; // Interrupt0
00073                 
00074                 struct Interrupt1 : Internal::InterruptBase <
00075                                 InputPin3<PortD>,                               /* InputPin */
00076                                 Event,                                                  /* EventEnum */
00077                                 Bits<_EICRA, _ISC10 | _ISC11>,  /* EventBits */
00078                                 Bits<_EIMSK, _INT1>,                    /* InterruptEnableBit */
00079                                 Bits<_EIFR, _INTF1>,                    /* InterruptFlagBit */
00080                                 2 >                                                             /* eventShift */
00081                                 
00082                 { __INTERRUPT_HANDLER_SUPPORT__ }; // Interrupt1
00083                 
00084                 struct PinChangeInterrupt0 : Internal::PinChangeInterruptBase < 
00085                         _PCMSK0,                                                        /* MaskRegister */
00086                         Bits<_PCICR, _PCIE0>,                           /* InterruptEnableBit */ 
00087                         Bits<_PCIFR, _PCIF0> >                          /* InterruptFlagBit */
00088 
00089                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt0
00090                 
00091                 struct PinChangeInterrupt1 : Internal::PinChangeInterruptBase < 
00092                         _PCMSK1,                                                        /* MaskRegister */
00093                         Bits<_PCICR, _PCIE1>,                           /* InterruptEnableBit */ 
00094                         Bits<_PCIFR, _PCIF1> >                          /* InterruptFlagBit */
00095 
00096                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt1
00097                 
00098                 struct PinChangeInterrupt2 : Internal::PinChangeInterruptBase < 
00099                         _PCMSK2,                                                        /* MaskRegister */
00100                         Bits<_PCICR, _PCIE2>,                           /* InterruptEnableBit */ 
00101                         Bits<_PCIFR, _PCIF2> >                          /* InterruptFlagBit */
00102 
00103                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt2
00104 
00105         } // namespace ExternalInterrupts
00106         
00107 } // namespace AVRCpp
00108 
00109 #endif // ifndef __AVR_CPP_ATMEGA88_EXTERNAL_INTERRUPT_H__

Generated on Sat Sep 15 23:41:40 2007 for AVR C++ Lib for ATmega88 by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi