avr-classes
|
#include <timer.h>
Classes | |
struct | Config |
class | InterruptHandler |
Public Member Functions | |
virtual void | configure (const Config &config)=0 |
virtual uint8_t | getCounterRegister (void)=0 |
virtual void | setCounterRegister (uint8_t value)=0 |
virtual void | setOutputCompareValue (uint8_t value)=0 |
virtual void | forceOutputCompareMatch (void)=0 |
virtual void | setInterruptHandler (InterruptHandler *handler)=0 |
virtual void | enableOutputCompareMatchInterrupt (bool state)=0 |
virtual void | enableOverflowInterrupt (bool state)=0 |
Static Public Member Functions | |
template<uint32_t CPUFREQUENCY> | |
static bool | autoFill (Config &config, uint32_t desiredCycleTime, uint32_t *actualCycleTime=nullptr) |
Interface for devices that implement an 8 bit timer.
|
inlinestatic |
Automatically fills a configuration structure for CTC mode.
config | Configuration structure to fill. |
desiredCycleTime | Cycle time in microseconds to achieve. |
actualCycleTime | Optional pointer to buffer to receive the cycle time that was actually configured. |
|
pure virtual |
Configures the timer device.
config | Configuration for timer device. |
Implemented in Timer0.
|
pure virtual |
Enables or disabled the Output Compare Match interrupt.
state | True to enable interrupt, false to disable. |
Implemented in Timer0.
|
pure virtual |
Enables or disabled the Overflow interrupt.
state | True to enable interrupt, false to disable. |
Implemented in Timer0.
|
pure virtual |
Strobes the force output compare match flag.
Implemented in Timer0.
|
pure virtual |
Gets the current value of the counter register.
Implemented in Timer0.
|
pure virtual |
|
pure virtual |
Sets callback for interrupts.
handler | Pointer to class implementing the interrupt handler interface. |
Implemented in Timer0.
|
pure virtual |