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

#include <timer0.h>

Inheritance diagram for Timer0:
Timer

Public Member Functions

virtual void configure (const Config &config) override
 
virtual uint8_t getCounterRegister (void) override
 
virtual void setCounterRegister (uint8_t value) override
 
virtual void setOutputCompareValue (uint8_t value) override
 
virtual void forceOutputCompareMatch (void) override
 
virtual void setInterruptHandler (InterruptHandler *handler) override
 
virtual void enableOutputCompareMatchInterrupt (bool state) override
 
virtual void enableOverflowInterrupt (bool state) override
 

Additional Inherited Members

- Static Public Member Functions inherited from Timer
template<uint32_t CPUFREQUENCY>
static bool autoFill (Config &config, uint32_t desiredCycleTime, uint32_t *actualCycleTime=nullptr)
 

Detailed Description

Implements the Timer interface using the Timer0 hardware unit.

Member Function Documentation

◆ configure()

void Timer0::configure ( const Config config)
overridevirtual

Configures the timer device.

Parameters
configConfiguration for timer device.

Implements Timer.

◆ enableOutputCompareMatchInterrupt()

void Timer0::enableOutputCompareMatchInterrupt ( bool  state)
overridevirtual

Enables or disabled the Output Compare Match interrupt.

Parameters
stateTrue to enable interrupt, false to disable.

Implements Timer.

◆ enableOverflowInterrupt()

void Timer0::enableOverflowInterrupt ( bool  state)
overridevirtual

Enables or disabled the Overflow interrupt.

Parameters
stateTrue to enable interrupt, false to disable.

Implements Timer.

◆ forceOutputCompareMatch()

void Timer0::forceOutputCompareMatch ( void  )
overridevirtual

Strobes the force output compare match flag.

Implements Timer.

◆ getCounterRegister()

uint8_t Timer0::getCounterRegister ( void  )
overridevirtual

Gets the current value of the counter register.

Returns
Current value of the counter register.

Implements Timer.

◆ setCounterRegister()

void Timer0::setCounterRegister ( uint8_t  value)
overridevirtual

Sets the counter register value.

Parameters
valueValue to set.

Implements Timer.

◆ setInterruptHandler()

void Timer0::setInterruptHandler ( InterruptHandler handler)
overridevirtual

Sets callback for interrupts.

Parameters
handlerPointer to class implementing the interrupt handler interface.

Implements Timer.

◆ setOutputCompareValue()

void Timer0::setOutputCompareValue ( uint8_t  value)
overridevirtual

Sets the output compare register value.

Parameters
valueValue to set.

Implements Timer.