avr-classes
Public Member Functions | List of all members
TimerAdapter Class Reference

#include <timeradapter.h>

Inheritance diagram for TimerAdapter:
Timer::InterruptHandler

Public Member Functions

 TimerAdapter (EventReceiver *receiver, const Event &outputCompareMatchEvent, const Event &overflowEvent)
 
EventReceivergetReceiver (void) const
 
void setReceiver (EventReceiver *receiver)
 
Event getOutputCompareMatchEvent (void) const
 
void setOutputCompareMatchEvent (const Event &event)
 
Event getOverflowEvent (void) const
 
void setOverflowEvent (const Event &event)
 
virtual void onOutputCompareMatch (void) override
 
virtual void onOverflow (void) override
 

Detailed Description

This component basically converts timer interrupts into events. For each interrupt a separate event ID can be set.

Note
While sending of events can be disabled by setting INVALID_EVENT_ID, consider disabling the interrupts at the source to save runtime.

Constructor & Destructor Documentation

◆ TimerAdapter()

TimerAdapter::TimerAdapter ( EventReceiver receiver,
const Event outputCompareMatchEvent,
const Event overflowEvent 
)
inline

Constructor.

Parameters
receiverReceiver of the events.
outputCompareMatchEventEvent for Output Compare Match interrupts.
overflowEventEvent for Overflow interrupts.

Member Function Documentation

◆ getOutputCompareMatchEvent()

Event TimerAdapter::getOutputCompareMatchEvent ( void  ) const
inline

Returns the currently set event for Output Compare Match interrupts.

Returns
Currently set event.

◆ getOverflowEvent()

Event TimerAdapter::getOverflowEvent ( void  ) const
inline

Returns the currently set event for Overflow interrupts.

Returns
Currently set event.

◆ getReceiver()

EventReceiver* TimerAdapter::getReceiver ( void  ) const
inline

Returns the currently set receiver.

Returns
Currently set receiver.

◆ onOutputCompareMatch()

virtual void TimerAdapter::onOutputCompareMatch ( void  )
inlineoverridevirtual

Handler for Output Compare Match interrupt.

Reimplemented from Timer::InterruptHandler.

◆ onOverflow()

virtual void TimerAdapter::onOverflow ( void  )
inlineoverridevirtual

Handler for Overflow interrupt.

Reimplemented from Timer::InterruptHandler.

◆ setOutputCompareMatchEvent()

void TimerAdapter::setOutputCompareMatchEvent ( const Event event)
inline

Sets the event for Output Compare Match interrupts.

Parameters
eventEvent to set.

◆ setOverflowEvent()

void TimerAdapter::setOverflowEvent ( const Event event)
inline

Sets the event for Overflow interrupts.

Parameters
eventEvent to set.

◆ setReceiver()

void TimerAdapter::setReceiver ( EventReceiver receiver)
inline

Sets the event receiver.

Parameters
receiverReceiver to set.