avr/cpp/atmega324p/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_ATMEGA324P_EXTERNAL_INTERRUPT_H__
00029 #define __AVR_CPP_ATMEGA324P_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/atmega324p/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__ "atmega324p/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 INT2_ns         ExternalInterrupt
00050 #define PCINT0_ns       ExternalInterrupt
00051 #define PCINT1_ns       ExternalInterrupt
00052 #define PCINT2_ns       ExternalInterrupt
00053 #define PCINT3_ns       ExternalInterrupt
00054 
00055 #define INT0_struct             ExternalInterrupt::Interrupt0
00056 #define INT1_struct             ExternalInterrupt::Interrupt1
00057 #define INT2_struct             ExternalInterrupt::Interrupt2
00058 #define PCINT0_struct   ExternalInterrupt::PinChangeInterrupt0
00059 #define PCINT1_struct   ExternalInterrupt::PinChangeInterrupt1
00060 #define PCINT2_struct   ExternalInterrupt::PinChangeInterrupt2
00061 #define PCINT3_struct   ExternalInterrupt::PinChangeInterrupt3
00062 
00063 
00064 namespace AVRCpp
00065 {
00066         namespace ExternalInterrupt
00067         {
00068                 struct Interrupt0 : Internal::InterruptBase <
00069                                 InputPin2<PortD>,                               /* InputPin */
00070                                 Event,                                                  /* EventEnum */
00071                                 Bits<_EICRA, _ISC00 | _ISC01>,  /* EventBits */
00072                                 Bits<_EIMSK, _INT0>,                    /* InterruptEnableBit */
00073                                 Bits<_EIFR, _INTF0>,                    /* InterruptFlagBit */
00074                                 0 >                                                             /* eventShift */
00075                                 
00076                 { __INTERRUPT_HANDLER_SUPPORT__ }; // Interrupt0
00077                 
00078                 struct Interrupt1 : Internal::InterruptBase <
00079                                 InputPin3<PortD>,                               /* InputPin */
00080                                 Event,                                                  /* EventEnum */
00081                                 Bits<_EICRA, _ISC10 | _ISC11>,  /* EventBits */
00082                                 Bits<_EIMSK, _INT1>,                    /* InterruptEnableBit */
00083                                 Bits<_EIFR, _INTF1>,                    /* InterruptFlagBit */
00084                                 2 >                                                             /* eventShift */
00085                                 
00086                 { __INTERRUPT_HANDLER_SUPPORT__ }; // Interrupt1
00087                 
00088                 struct Interrupt2 : Internal::InterruptBase <
00089                                 InputPin2<PortB>,                               /* InputPin */
00090                                 Event,                                                  /* EventEnum */
00091                                 Bits<_EICRA, _ISC20 | _ISC21>,  /* EventBits */
00092                                 Bits<_EIMSK, _INT2>,                    /* InterruptEnableBit */
00093                                 Bits<_EIFR, _INTF2>,                    /* InterruptFlagBit */
00094                                 4 >                                                             /* eventShift */
00095                                 
00096                 { __INTERRUPT_HANDLER_SUPPORT__ }; // Interrupt2
00097                 
00098                 struct PinChangeInterrupt0 : Internal::PinChangeInterruptBase < 
00099                         _PCMSK0,                                                        /* MaskRegister */
00100                         Bits<_PCICR, _PCIE0>,                           /* InterruptEnableBit */ 
00101                         Bits<_PCIFR, _PCIF0> >                          /* InterruptFlagBit */
00102 
00103                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt0
00104                 
00105                 struct PinChangeInterrupt1 : Internal::PinChangeInterruptBase < 
00106                         _PCMSK1,                                                        /* MaskRegister */
00107                         Bits<_PCICR, _PCIE1>,                           /* InterruptEnableBit */ 
00108                         Bits<_PCIFR, _PCIF1> >                          /* InterruptFlagBit */
00109 
00110                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt1
00111                 
00112                 struct PinChangeInterrupt2 : Internal::PinChangeInterruptBase < 
00113                         _PCMSK2,                                                        /* MaskRegister */
00114                         Bits<_PCICR, _PCIE2>,                           /* InterruptEnableBit */ 
00115                         Bits<_PCIFR, _PCIF2> >                          /* InterruptFlagBit */
00116 
00117                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt2
00118 
00119                 struct PinChangeInterrupt3 : Internal::PinChangeInterruptBase < 
00120                         _PCMSK3,                                                        /* MaskRegister */
00121                         Bits<_PCICR, _PCIE3>,                           /* InterruptEnableBit */ 
00122                         Bits<_PCIFR, _PCIF3> >                          /* InterruptFlagBit */
00123 
00124                 { __INTERRUPT_HANDLER_SUPPORT__ }; // PinChangeInterrupt3
00125 
00126         } // namespace ExternalInterrupts
00127         
00128 } // namespace AVRCpp
00129 
00130 #endif // ifndef __AVR_CPP_ATMEGA324P_EXTERNAL_INTERRUPT_H__

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