Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Macros | Typedefs | Functions
WSF_TIMER_API

Data Structures

struct  wsfTimer_tag
 Timer structure. More...
 

Macros

#define WSF_MS_PER_TICK   10
 Default milliseconds per tick rate. More...
 

Typedefs

typedef uint32_t wsfTimerTicks_t
 Timer ticks data type. More...
 
typedef struct wsfTimer_tag wsfTimer_t
 Timer structure. More...
 

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 (uint8_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...
 
void WsfTimerSleep (void)
 Check if there is an active timer and if there is enough time to go to sleep. More...
 
void WsfTimerSleepUpdate (void)
 Update WSF timer based on elapsed RTC ticks. More...
 

Detailed Description

Macro Definition Documentation

#define WSF_MS_PER_TICK   10

Default milliseconds per tick rate.

Definition at line 42 of file wsf_timer.h.

Typedef Documentation

typedef struct wsfTimer_tag wsfTimer_t

Timer structure.

typedef uint32_t wsfTimerTicks_t

Timer ticks data type.

Definition at line 50 of file wsf_timer.h.

Function Documentation

void WsfTimerInit ( void  )

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

wsfTimerTicks_t WsfTimerNextExpiration ( uint8_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.
void WsfTimerSleep ( void  )

Check if there is an active timer and if there is enough time to go to sleep.

void WsfTimerSleepUpdate ( void  )

Update WSF timer based on elapsed RTC ticks.

void WsfTimerStartMs ( wsfTimer_t pTimer,
wsfTimerTicks_t  ms 
)

Start a timer in units of milliseconds.

Parameters
pTimerPointer to timer.
msMilliseconds until expiration.
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.
void WsfTimerStop ( wsfTimer_t pTimer)

Stop a timer.

Parameters
pTimerPointer to timer.
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.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.