Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Timer Management Services

Defines the interfaces for Timer Management Services. More...

Data Structures

struct  _wiced_timer_t
 Timer structure. More...
 

Macros

#define wiced_timer_target_time_get(p_target_timer)   (((p_target_timer))->tt)
 Get the expected trigger point (time) of target timer. More...
 

Typedefs

typedef void * TIMER_PARAM_TYPE
 Timer callback argument type.
 
typedef TIMER_PARAM_TYPE WICED_TIMER_PARAM_TYPE
 To avoid recompiling older apps.
 
typedef void( wiced_timer_callback_t )(TIMER_PARAM_TYPE cb_params)
 Function prototype for the timer call back. More...
 
typedef struct _wiced_timer_t wiced_timer_t
 Timer structure. 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 wiced timer types. More...
 

Functions

wiced_result_t wiced_init_timer (wiced_timer_t *p_timer, wiced_timer_callback_t *p_timer_cb, TIMER_PARAM_TYPE 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_ms)
 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...
 

Detailed Description

Defines the interfaces for Timer Management Services.

Macro Definition Documentation

#define wiced_timer_target_time_get (   p_target_timer)    (((p_target_timer))->tt)

Get the expected trigger point (time) of target timer.

Parameters
[in]p_target_timer: pointer to the target timer control block
Returns
a 64-bit value time in microsecond.

Typedef Documentation

typedef void( wiced_timer_callback_t)(TIMER_PARAM_TYPE cb_params)

Function prototype for the timer call back.

Parameters
[in]cb_params:Timer callback function
typedef struct _wiced_timer_t wiced_timer_t

Timer structure.

NOTE: this structure is used internally by the wiced stack. Applications MUST NOT modify any of the elements of this structure.

Timer control block memory MUST be peristant from when the timer is initialized, using wiced_init_timer(), till it is de-initialized, using wiced_deinit_timer().

Enumeration Type Documentation

Defines the wiced timer types.

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

Function Documentation

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
wiced_result_t wiced_init_timer ( wiced_timer_t p_timer,
wiced_timer_callback_t p_timer_cb,
TIMER_PARAM_TYPE  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_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
0 if the timer is not in use and non-zero value if the timer is in use
wiced_result_t wiced_start_timer ( wiced_timer_t p_timer,
uint32_t  timeout_ms 
)

Starts a timer.

Parameters
[in]p_timer:Pointer to the timer structure
[in]timeout_ms:timeout in milliseconds
Returns
wiced_result_t
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