class Timers
Easy interface to do operations with timers and their registers.
| Timers | Easy interface to do operations with timers and their registers. |
| timer_data | Utility class that holds pointers to the real registers plus internal registers. |
| Variables | |
| count | Pointer to the Timer count register. |
| control | Pointer to the Timer control register. |
| cyclesCounter | Internal counter of cycles. |
| alreadyStarted | If true, the timer is running. |
| mMemory | Pointer to the memory object of the associated GBA. |
| mCpu | Pointer to cpu. |
| Functions | |
| Timers | Builds the timers handler utility. |
| GetControl | Gets the Control register of the timer. |
| GetPrescalerSelectionIndex | Gets The prescaler selection index of a timer. |
| GetPrescalerSelection | Gets Prescaler selection. |
| GetCountUpTiming | When countup timing is enabled in a timer, when it overflows, it increases the next one value. |
| GetIRQEnabled | Gets if interrupts for a timer overflow are enabled. |
| GetTimerState | Retrieves a timer’s state. |
| GetCount | Retrieves a timer’s counter. |
| SetToReloadValue | Sets a timer to its reload value. |
| OverflowTimer | Performs overflow operation on timer (generates irq if enabled, restarts with reload value, increments successive if countup is enabled). |
| Idle | Performs idle operations on timers. |
struct timer_data
Utility class that holds pointers to the real registers plus internal registers.
| Variables | |
| count | Pointer to the Timer count register. |
| control | Pointer to the Timer control register. |
| cyclesCounter | Internal counter of cycles. |
| alreadyStarted | If true, the timer is running. |
| mMemory | Pointer to the memory object of the associated GBA. |
| mCpu | Pointer to cpu. |
| Functions | |
| Timers | Builds the timers handler utility. |
| GetControl | Gets the Control register of the timer. |
| GetPrescalerSelectionIndex | Gets The prescaler selection index of a timer. |
| GetPrescalerSelection | Gets Prescaler selection. |
| GetCountUpTiming | When countup timing is enabled in a timer, when it overflows, it increases the next one value. |
| GetIRQEnabled | Gets if interrupts for a timer overflow are enabled. |
| GetTimerState | Retrieves a timer’s state. |
| GetCount | Retrieves a timer’s counter. |
| SetToReloadValue | Sets a timer to its reload value. |
| OverflowTimer | Performs overflow operation on timer (generates irq if enabled, restarts with reload value, increments successive if countup is enabled). |
| Idle | Performs idle operations on timers. |
Easy interface to do operations with timers and their registers.
class Timers
Utility class that holds pointers to the real registers plus internal registers.
struct timer_data
Pointer to the Timer count register.
uint16_t* count
Pointer to the Timer control register.
uint16_t* control
Internal counter of cycles.
int cyclesCounter
If true, the timer is running.
bool alreadyStarted
Pointer to the memory object of the associated GBA.
Memory* mMemory
Pointer to cpu.
CPU* mCpu
Builds the timers handler utility.
Timers( Memory * mem, CPU * cpu )
Gets the Control register of the timer.
inline int GetControl( int index )
Gets The prescaler selection index of a timer.
inline int GetPrescalerSelectionIndex( int index )
Gets Prescaler selection.
inline int GetPrescalerSelection( int index )
When countup timing is enabled in a timer, when it overflows, it increases the next one value.
inline bool GetCountUpTiming( int index )
Gets if interrupts for a timer overflow are enabled.
inline bool GetIRQEnabled( int index )
Retrieves a timer’s state.
inline bool GetTimerState( int index )
Retrieves a timer’s counter.
inline uint16_t GetCount( int index )
Sets a timer to its reload value.
inline void SetToReloadValue( int index )
Performs overflow operation on timer (generates irq if enabled, restarts with reload value, increments successive if countup is enabled).
inline void OverflowTimer( int index )
Performs idle operations on timers.
inline void Idle( int cyclesCount )