00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __AVR_CPP_ATMEGA8515_TIMER_H__
00029 #define __AVR_CPP_ATMEGA8515_TIMER_H__
00030
00031
00032
00033 #ifndef __AVR_CPP_TIMER_H__
00034 #ifdef __DOXYGEN__
00035 #include <avr/cpp/Timer.h>
00036 #else
00037 #error "Include <avr/cpp/Timer.h> instead of <avr/cpp/atmega8515/Timer.h>."
00038 #endif
00039 #endif // ifdef __AVR_CPP_TIMER_H__
00040
00041 #ifndef __AVR_CPP_XXX_TIMER_H__
00042 #define __AVR_CPP_XXX_TIMER_H__ "atmega8515/Timer.h"
00043 #else
00044 #error "Attempt to include more than one <avr/cpp/XXX/Timer.h> file."
00045 #endif
00046
00047 #define TIMER0_COMP_ns Timer
00048 #define TIMER0_OVF_ns Timer
00049 #define TIMER1_OVF_ns Timer
00050 #define TIMER1_COMPA_ns Timer
00051 #define TIMER1_COMPB_ns Timer
00052 #define TIMER1_CAPT_ns Timer
00053
00054 #define TIMER0_COMP_struct Timer::TimerCounter0::CompareMatchInterrupt
00055 #define TIMER0_OVF_struct Timer::TimerCounter0::OverflowInterrupt
00056 #define TIMER1_OVF_struct Timer::TimerCounter1::OverflowInterrupt
00057 #define TIMER1_COMPA_struct Timer::TimerCounter1::CompareMatchAInterrupt
00058 #define TIMER1_COMPB_struct Timer::TimerCounter1::CompareMatchBInterrupt
00059 #define TIMER1_CAPT_struct Timer::TimerCounter1::InputCaptureInterrupt
00060
00061
00062 namespace AVRCpp
00063 {
00064 namespace Timer
00065 {
00066 inline void PrescalerReset10() { SetBits<_SFIOR>(_PSR10); }
00067
00068
00069 struct TimerCounter0 : Internal::OneChannel8BitTimer <
00070 _TCNT0,
00071 _OCR0,
00072 _TCCR0,
00073 ClockB,
00074 OutputPin0<PortB> >
00075 {
00076 struct CompareMatchInterrupt : Interrupt<Bits<_TIMSK, _OCIE0>, Bits<_TIFR, _OCF0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00077 struct OverflowInterrupt : Interrupt<Bits<_TIMSK, _TOIE0>, Bits<_TIFR, _TOV0> > { __INTERRUPT_HANDLER_SUPPORT__ };
00078
00079 };
00080
00081
00082 struct TimerCounter1 : Internal::OldTwoChannel16BitTimer <
00083 _TCNT1,
00084 _OCR1A,
00085 _OCR1B,
00086 _ICR1,
00087 _TCCR1A,
00088 _TCCR1B,
00089 ClockB,
00090 OutputPin5<PortD>,
00091 OutputPin2<PortE>,
00092 InputPin0<PortE> >
00093 {
00094 struct InputCaptureInterrupt : Interrupt<Bits<_TIMSK, _TICIE1>, Bits<_TIFR, _ICF1> > { __INTERRUPT_HANDLER_SUPPORT__ };
00095 struct CompareMatchAInterrupt : Interrupt<Bits<_TIMSK, _OCIE1A>, Bits<_TIFR, _OCF1A> > { __INTERRUPT_HANDLER_SUPPORT__ };
00096 struct CompareMatchBInterrupt : Interrupt<Bits<_TIMSK, _OCIE1B>, Bits<_TIFR, _OCF1B> > { __INTERRUPT_HANDLER_SUPPORT__ };
00097 struct OverflowInterrupt : Interrupt<Bits<_TIMSK, _TOIE1>, Bits<_TIFR, _TOV1> > { __INTERRUPT_HANDLER_SUPPORT__ };
00098
00099 };
00100
00101 }
00102
00103 }
00104
00105 #endif // ifndef __AVR_CPP_ATMEGA8515_TIMER_H__