Bluetooth Host Stack Library
All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
Timer Management Services

General Description

Defines the interfaces for Timer Management Services.

Data Structures

struct  wiced_timer_t
 Timer structure. More...
 

Typedefs

typedef void * wiced_timer_callback_arg_t
 Timer callback argument type.
 
typedef wiced_timer_callback_arg_t WICED_TIMER_PARAM_TYPE
 To avoid recompiling older apps.
 
typedef wiced_timer_callback_arg_t TIMER_PARAM_TYPE
 To avoid recompiling older apps.
 
typedef void() wiced_timer_callback_t(wiced_timer_callback_arg_t cb_params)
 Function prototype for the timer call back. More...
 

Enumerations

enum  wiced_timer_type_e {
  WICED_MILLI_SECONDS_TIMER,
  WICED_SECONDS_TIMER,
  WICED_MILLI_SECONDS_PERIODIC_TIMER,
  WICED_SECONDS_PERIODIC_TIMER
}
 Defines the AIROC timer types. More...
 

Functions

wiced_result_t wiced_init_timer (wiced_timer_t *p_timer, wiced_timer_callback_t *p_timer_cb, wiced_timer_callback_arg_t cb_arg, wiced_timer_type_e timer_type)
 Initializes the timer. More...
 
wiced_result_t wiced_start_timer (wiced_timer_t *p_timer, uint32_t timeout)
 Starts a timer. More...
 
wiced_result_t wiced_stop_timer (wiced_timer_t *p_timer)
 Stops a timer. More...
 
wiced_bool_t wiced_is_timer_in_use (wiced_timer_t *p_timer)
 Checks if a timer is in use. More...
 
wiced_result_t wiced_deinit_timer (wiced_timer_t *p_timer)
 Deinitialize a timer instance and stops the timer if it is running. More...
 

Typedef Documentation

◆ wiced_timer_callback_t

typedef void() wiced_timer_callback_t(wiced_timer_callback_arg_t cb_params)

Function prototype for the timer call back.

Parameters
[in]cb_params:Timer callback function

Enumeration Type Documentation

◆ wiced_timer_type_e

Defines the AIROC timer types.

These timers are system tick driven and a systick is 1 millisecond.So the minimum timer resolution supported is 1 millisecond

Enumerator
WICED_MILLI_SECONDS_TIMER 

Single shot milliseconds timer.

WICED_SECONDS_TIMER 

Single shot seconds timer.

WICED_MILLI_SECONDS_PERIODIC_TIMER 

Periodic milliseconds timer.

WICED_SECONDS_PERIODIC_TIMER 

Periodic seconds timer.

Function Documentation

◆ wiced_init_timer()

wiced_result_t wiced_init_timer ( wiced_timer_t p_timer,
wiced_timer_callback_t p_timer_cb,
wiced_timer_callback_arg_t  cb_arg,
wiced_timer_type_e  timer_type 
)

Initializes the timer.

Parameters
[in]p_timer:Pointer to the timer structure
[in]p_timer_cb:Timer callback function to be invoked on timer expiry
[in]cb_arg:Parameter to be passed to the timer callback function which gets invoked on timer expiry,if any
[in]timer_type:Shows if the timer is milliseconds or seconds, and if periodic or not
Returns
wiced_result_t

◆ wiced_start_timer()

wiced_result_t wiced_start_timer ( wiced_timer_t p_timer,
uint32_t  timeout 
)

Starts a timer.

Note
: Starting an already running timer restarts the timer timeout
Parameters
[in]p_timer:Pointer to the timer structure
[in]timeout: The units of the timeout parameter is set as per the timer_type set in wiced_init_timer
timeout is in milliseconds if timer_type is WICED_MILLI_SECONDS_TIMER or WICED_MILLI_SECONDS_PERIODIC_TIMER,
timeout is in seconds if timer_type is WICED_SECONDS_TIMER or WICED_SECONDS_PERIODIC_TIMER,
Returns
wiced_result_t

◆ wiced_stop_timer()

wiced_result_t wiced_stop_timer ( wiced_timer_t p_timer)

Stops a timer.

Parameters
[in]p_timer:Pointer to the timer structure
Returns
wiced_result_t

◆ wiced_is_timer_in_use()

wiced_bool_t wiced_is_timer_in_use ( wiced_timer_t p_timer)

Checks if a timer is in use.

Parameters
[in]p_timer:Pointer to the timer structure
Returns
TRUE if the timer is in use and FALSE if the timer is not in use

◆ wiced_deinit_timer()

wiced_result_t wiced_deinit_timer ( wiced_timer_t p_timer)

Deinitialize a timer instance and stops the timer if it is running.

Parameters
[in]p_timer:Pointer to the timer
Returns
wiced_result_t