Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

timer.h: Timer operations
[platform independant portions of code]


Typedefs

typedef void(* TimerFunction )(void *data)
typedef _Timer * Timer

Functions

ErrorCode timerSetFreq (uint32 freq)
ErrorCode timerGetFreq (uint32 *freq)
ErrorCode timerGetTicks (uint32 *ticks)
ErrorCode timerDelay (uint32 usec)
ErrorCode timerCreate (Timer *t, uint32 usec, TimerFunction func, void *data)
ErrorCode timerStart (Timer t)
ErrorCode timerStop (Timer t)
ErrorCode timerSetTimeout (Timer t, uint32 usec)
ErrorCode timerSetRepeat (Timer t, Boolean repeat)
ErrorCode timerDestroy (Timer *t)

Detailed Description

 *  *  *  * This file defines the portable interface to the platforms timer hardware.

Typedef Documentation

typedef struct _Timer* Timer
 

Definition at line 24 of file timer.h.

typedef void(* TimerFunction)(void *data)
 

Definition at line 23 of file timer.h.


Function Documentation

ErrorCode timerCreate Timer t,
uint32  usec,
TimerFunction  func,
void *  data
 

repeat True for repetitive timer Create a new timer object

Parameters:
t The timer handle for this timer
usec How often to call the callback function
func The actual callback function
data A parameter to pass to the callback function

ErrorCode timerDelay uint32  usec  ) 
 

Delay for a period of x * (1/1000th of a second) This is a fairly accurate blocking delay, but with a tight inner loop. Where accuracy is not a concern, taskDelay would be a better option as it will perform a voluntary task switch instead of polling, as this does.

Parameters:
usec The ms to delay for

ErrorCode timerDestroy Timer t  ) 
 

Destroy a timer

Parameters:
t The timer to destroy

ErrorCode timerGetFreq uint32 freq  ) 
 

Set the timer base frequency

Parameters:
freq The frequency, in x/s

ErrorCode timerGetTicks uint32 ticks  ) 
 

Get the number of ticks since ndk started

Parameters:
ticks Pointer to integer to fill with ticks

ErrorCode timerSetFreq uint32  freq  ) 
 

Set the timer base frequency

Parameters:
freq The frequency, in x/s

ErrorCode timerSetRepeat Timer  t,
Boolean  repeat
 

Set whether this is a repetitive timer, or a one time timer

Parameters:
t The timer to use
repeat True for repetitive timer

ErrorCode timerSetTimeout Timer  t,
uint32  usec
 

Set's the timer's timeout (or time between each callback)

Parameters:
t The timer to use
usec The number of (1/1000th) of a second to wait before calling the callback again

ErrorCode timerStart Timer  t  ) 
 

Start a timer object

Parameters:
t The timer to start

ErrorCode timerStop Timer  t  ) 
 

Stop a timer object

Parameters:
t The timer to stop


Generated on Wed Mar 22 20:36:34 2006 for ndk by  doxygen 1.4.4