CycleTimer Class Reference
|
yasimavr
|
#include <sim_cycle_timer.h>
Public Member Functions | |
| CycleTimer () | |
| CycleTimer (const CycleTimer &other) | |
| virtual | ~CycleTimer () |
| bool | scheduled () const |
| Returns true if this timer is scheduled with a manager. | |
| bool | paused () const |
| cycle_count_t | remaining_delay () const |
| virtual cycle_count_t | next (cycle_count_t when)=0 |
| Callback from the cycle loop. | |
| CycleTimer & | operator= (const CycleTimer &other) |
Friends | |
| class | CycleManager |
Detailed Description
Abstract interface for timers that can register with the cycle manager and be scheduled to be called at a given cycle.
Constructor & Destructor Documentation
◆ CycleTimer() [1/2]
| CycleTimer::CycleTimer | ( | ) |
◆ CycleTimer() [2/2]
| CycleTimer::CycleTimer | ( | const CycleTimer & | other | ) |
◆ ~CycleTimer()
|
virtual |
Member Function Documentation
◆ next()
|
pure virtual |
Callback from the cycle loop.
- Note
- there's no guarantee the method will be called exactly on the required 'when' cycle. The only guarantee is "called 'when' <= 'current cycle'", the implementations must account for this.
- Parameters
-
when current 'when' cycle, at which the timer was scheduled
- Returns
- the next 'when' the timer requires to be called at.
- Note
- The next 'when' can be in the 'past' (i.e. <= 'current cycle'). In this case, the timer will be called again within the same cycle with the given next 'when'. The only constraint is that it must be greater than the previous 'when'. If it's negative or zero, the timer is removed from the queue.
Implemented in ArchAVR_NVM::SPM_Timer, ArchAVR_NVM::EE_Timer, ArchAVR_SPI::_Controller, ArchXT_SPI::_Controller, PrescaledTimer, TWI::Client, TWI::Host, BoundFunctionCycleTimer< C >, BoundFunctionCycleTimer< ArchAVR_IntCtrl >, BoundFunctionCycleTimer< ArchAVR_WDT >, BoundFunctionCycleTimer< ArchXT_NVM >, BoundFunctionCycleTimer< ArchXT_WDT >, and BoundFunctionCycleTimer< UART::USART >.
◆ operator=()
| CycleTimer & CycleTimer::operator= | ( | const CycleTimer & | other | ) |
◆ paused()
| bool CycleTimer::paused | ( | ) | const |
Returns true if this timer is scheduled and paused
◆ remaining_delay()
| cycle_count_t CycleTimer::remaining_delay | ( | ) | const |
Returns the remaining delay before this timer is called, or -1 if the timer isn't scheduled.
◆ scheduled()
|
inline |
Returns true if this timer is scheduled with a manager.
Friends And Related Symbol Documentation
◆ CycleManager
|
friend |
The documentation for this class was generated from the following files:
Generated by