TimerManager Class Reference

#include <TimerManager.h>

Inheritance diagram for TimerManager:
Object

# Public Member Functions

void reset ()
 Reset the manager's state.
void frameStarted (uint32 elapsedMicroseconds)

# Static Public Member Functions

static void interruptHandler ()
 Interrupt handler for timer's interrupts.
static void configure (uint16 timerResolution, uint16 targetTimePerInterrupt, uint16 targetTimePerInterrupttUnits)
static void applySettings (bool enable)
static void enable ()
 Enable the timer.
static void disable ()
 Disable the timer.
static void resetTimerCounter ()
 Reset timer's counter.
static void setResolution (uint16 resolution)
static uint16 getResolution ()
static uint16 getResolutionInUS ()
static void setTargetTimePerInterrupt (uint16 targetTimePerInterrupt)
static uint16 getTargetTimePerInterrupt ()
static float getTargetTimePerInterruptInMS ()
static uint32 getTargetTimePerInterruptInUS ()
static void setTargetTimePerInterruptUnits (uint16 targetTimePerInterrupttUnits)
static uint16 getTargetTimePerInterruptUnits ()
static uint16 getTimerCounter ()
static uint16 getCurrentTimerCounter ()
static uint16 getMinimumTimePerInterruptStep ()
static uint32 getElapsedMilliseconds ()
static uint32 getTotalElapsedMilliseconds ()
static void wait (uint32 milliseconds)
static void repeatMethodCall (uint32 callTimes, uint32 duration, ListenerObject object, void(*method)(ListenerObject, uint32))
static void print (int32 x, int32 y)
static void printInterruptStats (int x, int y)

# Private Attributes

uint32 elapsedMilliseconds
 Elapsed milliseconds since the last call to reset.
uint32 elapsedMicroseconds
 Elapsed microseconds.
uint32 totalElapsedMilliseconds
 Elapsed milliseconds since the start of the program.
uint16 resolution
 Timer's resolution.
uint16 interruptsPerSecond
 Interrupts during the last secoond.
uint16 interruptsPerGameFrame
 Interrupts during the last game frame.
uint32 elapsedMicrosecondsPerInterrupt
 Elapsed microseconds per interrupt.
uint16 targetTimePerInterrupt
 Target elapsed time per interrupt.
uint16 targetTimePerInterrupttUnits
 Units of the target time per interrupt.
uint8 tcrValue
 Last written value to the TCR registry.
- Private Attributes inherited from Object
void * vTable
 Pointer to the class's virtual table.

# Additional Inherited Members

- Private Member Functions inherited from Object
void constructor ()
 Class' constructor.
const void * getVTable ()
bool mutateTo (const void *targetClass)
- Static Private Member Functions inherited from Object
static Object getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod)

# Detailed Description

Class TimerManager

Inherits from Object

Manages rumble effects.

Definition at line 70 of file TimerManager.h.

# Member Function Documentation

# applySettings()

static void TimerManager::applySettings ( bool enable)
static

Apply the settings to the hardware timer.

Parameters
enableIf true, the hardware timer is enabled

Definition at line 98 of file TimerManager.c.

# configure()

static void TimerManager::configure ( uint16 timerResolution,
uint16 targetTimePerInterrupt,
uint16 targetTimePerInterrupttUnits )
static

Configure the timer with the provided arguments.

Parameters
timerResolutionTimer's resolution (__TIMER_100US or __TIMER_20US)
targetTimePerInterruptTarget elapsed time between timer interrupts
targetTimePerInterrupttUnitsTimer interrupt's target time units

Definition at line 88 of file TimerManager.c.

# disable()

static void TimerManager::disable ( )
static

Disable the timer.

Definition at line 124 of file TimerManager.c.

# enable()

static void TimerManager::enable ( )
static

Enable the timer.

Definition at line 113 of file TimerManager.c.

# frameStarted()

secure void TimerManager::frameStarted ( uint32 elapsedMicroseconds)

Call when the next frame starts.

Parameters
elapsedMicrosecondsElapsed microseconds between calls

Definition at line 584 of file TimerManager.c.

# getCurrentTimerCounter()

static uint16 TimerManager::getCurrentTimerCounter ( )
static

Retrieve the current timer counter.

Returns
Current timer counter

Definition at line 398 of file TimerManager.c.

# getElapsedMilliseconds()

static uint32 TimerManager::getElapsedMilliseconds ( )
static

Retrieve elapsed milliseconds since the last call to reset.

Returns
Elapsed milliseconds since the last call to reset

Definition at line 426 of file TimerManager.c.

# getMinimumTimePerInterruptStep()

static uint16 TimerManager::getMinimumTimePerInterruptStep ( )
static

Retrieve the minimum timer per interrupt step.

Returns
Minimum timer per interrupt step

Definition at line 405 of file TimerManager.c.

# getResolution()

static uint16 TimerManager::getResolution ( )
static

Retrieve the timer's resolution.

Returns
Timer's resolution

Definition at line 214 of file TimerManager.c.

# getResolutionInUS()

static uint16 TimerManager::getResolutionInUS ( )
static

Retrieve the timer's resolution in microseconds.

Returns
Timer's resolution in microseconds

Definition at line 223 of file TimerManager.c.

# getTargetTimePerInterrupt()

static uint16 TimerManager::getTargetTimePerInterrupt ( )
static

Retrieve the target time between interrupt calls.

Returns
Target time between interrupt calls

Definition at line 294 of file TimerManager.c.

# getTargetTimePerInterruptInMS()

static float TimerManager::getTargetTimePerInterruptInMS ( )
static

Retrieve the target time in milliseconds between interrupt calls.

Returns
Target time in milliseconds between interrupt calls

Definition at line 303 of file TimerManager.c.

# getTargetTimePerInterruptInUS()

static uint32 TimerManager::getTargetTimePerInterruptInUS ( )
static

Retrieve the target time in microseconds between interrupt calls.

Returns
Target time in microseconds between interrupt calls

Definition at line 330 of file TimerManager.c.

# getTargetTimePerInterruptUnits()

static uint16 TimerManager::getTargetTimePerInterruptUnits ( )
static

Retrieve the target time units between interrupt calls.

Returns
Target time units between interrupt calls

Definition at line 380 of file TimerManager.c.

# getTimerCounter()

static uint16 TimerManager::getTimerCounter ( )
static

Retrieve the configured timer counter.

Returns
Configured timer counter

Definition at line 389 of file TimerManager.c.

# getTotalElapsedMilliseconds()

static uint32 TimerManager::getTotalElapsedMilliseconds ( )
static

Retrieve elapsed milliseconds since the start of the program.

Returns
Elapsed milliseconds since the start of the program

Definition at line 435 of file TimerManager.c.

# interruptHandler()

static void TimerManager::interruptHandler ( )
static

Interrupt handler for timer's interrupts.

Definition at line 40 of file TimerManager.c.

# print()

static void TimerManager::print ( int32 x,
int32 y )
static

Print the manager's configuration.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 494 of file TimerManager.c.

# printInterruptStats()

static void TimerManager::printInterruptStats ( int x,
int y )
static

Print the stats related to the interrupts.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 545 of file TimerManager.c.

# repeatMethodCall()

static void TimerManager::repeatMethodCall ( uint32 callTimes,
uint32 duration,
ListenerObject object,
void(* method )(ListenerObject, uint32) )
static

Call a method on the provided scope a numer of time during a lapse of time.

Parameters
callTimesNumber of calls to produce during the total duration
durationTime that must take the callTimes
objectCalled method's scope
methodMethod to call

Definition at line 464 of file TimerManager.c.

# reset()

secure void TimerManager::reset ( )

Reset the manager's state.

Definition at line 570 of file TimerManager.c.

# resetTimerCounter()

static void TimerManager::resetTimerCounter ( )
static

Reset timer's counter.

Definition at line 135 of file TimerManager.c.

# setResolution()

static void TimerManager::setResolution ( uint16 resolution)
static

Set the timer's resolution.

Parameters
resolution__TIMER_20US or __TIMER_100US

Definition at line 160 of file TimerManager.c.

# setTargetTimePerInterrupt()

static void TimerManager::setTargetTimePerInterrupt ( uint16 targetTimePerInterrupt)
static

Set the target time between interrupt calls.

Parameters
targetTimePerInterruptTarget time between interrupt calls

Definition at line 251 of file TimerManager.c.

# setTargetTimePerInterruptUnits()

static void TimerManager::setTargetTimePerInterruptUnits ( uint16 targetTimePerInterrupttUnits)
static

Set the target time units between interrupt calls.

Parameters
targetTimePerInterrupttUnitsTarget time units between interrupt calls

Definition at line 357 of file TimerManager.c.

# wait()

static void TimerManager::wait ( uint32 milliseconds)
static

Halt the program by the provided time.

Parameters
millisecondsTime to halt the program

Definition at line 444 of file TimerManager.c.

# Member Data Documentation

# elapsedMicroseconds

uint32 TimerManager::elapsedMicroseconds
private

Elapsed microseconds.

Definition at line 76 of file TimerManager.h.

# elapsedMicrosecondsPerInterrupt

uint32 TimerManager::elapsedMicrosecondsPerInterrupt
private

Elapsed microseconds per interrupt.

Definition at line 91 of file TimerManager.h.

# elapsedMilliseconds

uint32 TimerManager::elapsedMilliseconds
private

Elapsed milliseconds since the last call to reset.

Definition at line 73 of file TimerManager.h.

# interruptsPerGameFrame

uint16 TimerManager::interruptsPerGameFrame
private

Interrupts during the last game frame.

Definition at line 88 of file TimerManager.h.

# interruptsPerSecond

uint16 TimerManager::interruptsPerSecond
private

Interrupts during the last secoond.

Definition at line 85 of file TimerManager.h.

# resolution

uint16 TimerManager::resolution
private

Timer's resolution.

Definition at line 82 of file TimerManager.h.

# targetTimePerInterrupt

uint16 TimerManager::targetTimePerInterrupt
private

Target elapsed time per interrupt.

Definition at line 94 of file TimerManager.h.

# targetTimePerInterrupttUnits

uint16 TimerManager::targetTimePerInterrupttUnits
private

Units of the target time per interrupt.

Definition at line 97 of file TimerManager.h.

# tcrValue

uint8 TimerManager::tcrValue
private

Last written value to the TCR registry.

Definition at line 100 of file TimerManager.h.

# totalElapsedMilliseconds

uint32 TimerManager::totalElapsedMilliseconds
private

Elapsed milliseconds since the start of the program.

Definition at line 79 of file TimerManager.h.


The documentation for this class was generated from the following files: