ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
Interface functions to timer. More...
Go to the source code of this file.
Typedefs | |
typedef void * | ri_timer_id_t |
Pointer to timer data. More... | |
typedef void(* | ruuvi_timer_timeout_handler_t) (void *const p_context) |
Function to be called when timer times out. More... | |
Enumerations | |
enum | ri_timer_mode_t { RI_TIMER_MODE_SINGLE_SHOT , RI_TIMER_MODE_REPEATED } |
Enable implementation selected by application. More... | |
Functions | |
rd_status_t | ri_timer_init (void) |
rd_status_t | ri_timer_uninit (void) |
bool | ri_timer_is_init (void) |
Check if timer is initialized. More... | |
rd_status_t | ri_timer_create (ri_timer_id_t *p_timer_id, ri_timer_mode_t mode, ruuvi_timer_timeout_handler_t timeout_handler) |
rd_status_t | ri_timer_start (ri_timer_id_t timer_id, uint32_t ms, void *const context) |
Start given timer at a mode defined in ri_timer_create. More... | |
rd_status_t | ri_timer_stop (ri_timer_id_t timer_id) |
Interface functions to timer.
Timer abstraction. Allows creating single-shot and repeated timers which call a function at interval. The timer will run in interrupt context, if you need to use peripherals or spend a lot of time in timer function you should use ri_scheduler to run the functions without blocking timing-critical tasks.
Typical usage:
Definition in file ruuvi_interface_timer.h.