Cordio Stack and Cordio Profiles  r2p3-02rel0
WSF Timer API

Data Structures

struct  wsfTimer_t
 Timer structure. More...
 

Macros

#define WSF_MS_PER_TICK   10
 Default milliseconds per tick rate.
 

Typedefs

typedef uint32_t wsfTimerTicks_t
 Timer ticks data type.
 

Functions

void WsfTimerInit (void)
 Initialize the timer service. This function should only be called once upon system initialization. More...
 
void WsfTimerStartSec (wsfTimer_t *pTimer, wsfTimerTicks_t sec)
 Start a timer in units of seconds. Before this function is called parameter pTimer->handlerId must be set to the event handler for this timer and parameter pTimer->msg must be set to any application-defined timer event parameters. More...
 
void WsfTimerStartMs (wsfTimer_t *pTimer, wsfTimerTicks_t ms)
 Start a timer in units of milliseconds. More...
 
void WsfTimerStop (wsfTimer_t *pTimer)
 Stop a timer. More...
 
void WsfTimerUpdate (wsfTimerTicks_t ticks)
 Update the timer service with the number of elapsed ticks. This function is typically called only from timer porting code. More...
 
wsfTimerTicks_t WsfTimerNextExpiration (bool_t *pTimerRunning)
 Return the number of ticks until the next timer expiration. Note that this function can return zero even if a timer is running, indicating the timer has expired but has not yet been serviced. More...
 
wsfTimer_tWsfTimerServiceExpired (wsfTaskId_t taskId)
 Service expired timers for the given task. This function is typically called only WSF OS porting code. More...
 

Description

Function Documentation

void WsfTimerInit ( void  )

Initialize the timer service. This function should only be called once upon system initialization.

Returns
None.
void WsfTimerStartSec ( wsfTimer_t pTimer,
wsfTimerTicks_t  sec 
)

Start a timer in units of seconds. Before this function is called parameter pTimer->handlerId must be set to the event handler for this timer and parameter pTimer->msg must be set to any application-defined timer event parameters.

Parameters
pTimerPointer to timer.
secSeconds until expiration.
Returns
None.
void WsfTimerStartMs ( wsfTimer_t pTimer,
wsfTimerTicks_t  ms 
)

Start a timer in units of milliseconds.

Parameters
pTimerPointer to timer.
msMilliseconds until expiration.
Returns
None.
void WsfTimerStop ( wsfTimer_t pTimer)

Stop a timer.

Parameters
pTimerPointer to timer.
Returns
None.
void WsfTimerUpdate ( wsfTimerTicks_t  ticks)

Update the timer service with the number of elapsed ticks. This function is typically called only from timer porting code.

Parameters
ticksNumber of ticks since last update.
Returns
None.
wsfTimerTicks_t WsfTimerNextExpiration ( bool_t pTimerRunning)

Return the number of ticks until the next timer expiration. Note that this function can return zero even if a timer is running, indicating the timer has expired but has not yet been serviced.

Parameters
pTimerRunningReturns TRUE if a timer is running, FALSE if no timers running.
Returns
The number of ticks until the next timer expiration.
wsfTimer_t* WsfTimerServiceExpired ( wsfTaskId_t  taskId)

Service expired timers for the given task. This function is typically called only WSF OS porting code.

Parameters
taskIdOS Task ID of task servicing timers.
Returns
Pointer to next expired timer or NULL if there are no expired timers.