Timer
RTOS timer functions. More...
Functions | |
zos_result_t | zn_rtos_timer_init (zos_timer_t *timer, uint32_t time_ms, zos_timer_handler_t function, void *arg) |
Initializes a RTOS timerInitialises a RTOS timer Timer does not start running until zn_rtos_timer_start() is called. More... | |
zos_result_t | zn_rtos_timer_start (zos_timer_t *timer) |
Starts a RTOS timer runningStarts a RTOS timer running. More... | |
zos_result_t | zn_rtos_timer_stop (zos_timer_t *timer) |
Stops a running RTOS timerStops a running RTOS timer. More... | |
zos_result_t | zn_rtos_timer_reload (zos_timer_t *timer) |
Reloads a RTOS timer that has expiredThis is usually called in the timer callback handler, to reschedule the timer for the next period. More... | |
zos_result_t | zn_rtos_timer_update (zos_timer_t *timer, uint32_t timeout) |
Update timer timeout. More... | |
zos_result_t | zn_rtos_timer_deinit (zos_timer_t *timer) |
De-initialise a RTOS timerDeletes a RTOS timer created with zn_rtos_timer_init() More... | |
zos_bool_t | zn_rtos_timer_is_running (zos_timer_t *timer) |
Check if an RTOS timer is running. More... | |
Detailed Description
RTOS timer functions.
Function Documentation
zos_result_t zn_rtos_timer_deinit | ( | zos_timer_t * | timer | ) |
De-initialise a RTOS timerDeletes a RTOS timer created with zn_rtos_timer_init()
- Parameters
-
timer
: a pointer to the RTOS timer handle
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
zos_result_t zn_rtos_timer_init | ( | zos_timer_t * | timer, |
uint32_t | time_ms, |
||
zos_timer_handler_t | function, |
||
void * | arg |
||
) |
Initializes a RTOS timerInitialises a RTOS timer Timer does not start running until zn_rtos_timer_start() is called.
- Parameters
-
timer
: a pointer to the timer handle to be initialised time_ms
: Timer period in milliseconds function
: the callback handler function that is called each time the timer expires arg
: an argument that will be passed to the callback function
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
zos_bool_t zn_rtos_timer_is_running | ( | zos_timer_t * | timer | ) |
Check if an RTOS timer is running.
- Parameters
-
timer
: a pointer to the RTOS timer handle
- Returns
- ZOS_SUCCESS : if running.
- ZOS_ERROR : if not running
zos_result_t zn_rtos_timer_reload | ( | zos_timer_t * | timer | ) |
Reloads a RTOS timer that has expiredThis is usually called in the timer callback handler, to reschedule the timer for the next period.
- Parameters
-
timer
: a pointer to the timer handle to reload
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
zos_result_t zn_rtos_timer_start | ( | zos_timer_t * | timer | ) |
Starts a RTOS timer runningStarts a RTOS timer running.
Timer must have been previously initialised with zn_rtos_timer_init()
- Parameters
-
timer
: a pointer to the timer handle to start
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
zos_result_t zn_rtos_timer_stop | ( | zos_timer_t * | timer | ) |
Stops a running RTOS timerStops a running RTOS timer.
Timer must have been previously started with zn_rtos_timer_start()
- Parameters
-
timer
: a pointer to the timer handle to stop
- Returns
- ZOS_SUCCESS : on success.
- ZOS_ERROR : if an error occurred
zos_result_t zn_rtos_timer_update | ( | zos_timer_t * | timer, |
uint32_t | timeout |
||
) |
Update timer timeout.