ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
Files | |
file | ruuvi_interface_scheduler_test.h |
Test interface functions to scheduler. | |
file | ruuvi_interface_timer.h |
Interface functions to timer. | |
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 | |
bool | ri_timer_integration_test_run (const rd_test_print_fp printfp) |
Run all timer integration tests. More... | |
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) |
typedef void* ri_timer_id_t |
Pointer to timer data.
Definition at line 79 of file ruuvi_interface_timer.h.
typedef void(* ruuvi_timer_timeout_handler_t) (void *const p_context) |
Function to be called when timer times out.
p_context | pointer to context to be passed to handler, can be NULL. |
Definition at line 86 of file ruuvi_interface_timer.h.
enum ri_timer_mode_t |
Enable implementation selected by application.
Single or continuous execution of task.
Enumerator | |
---|---|
RI_TIMER_MODE_SINGLE_SHOT | |
RI_TIMER_MODE_REPEATED |
Definition at line 73 of file ruuvi_interface_timer.h.
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_init | ( | void | ) |
bool ri_timer_integration_test_run | ( | const rd_test_print_fp | printfp | ) |
Run all timer integration tests.
[in] | printfp | Function to which test JSON is passed. |
false | if no errors occured. |
true | if error occured. |
bool ri_timer_is_init | ( | void | ) |
Check if timer is initialized.
true | if timers have been successfully initialized. |
false | if timer is not initialized. |
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.
This operation is ignored if timer is already running.
[in] | timer_id | id of timer to control |
[in] | ms | timeout (or interval) of timer in milliseconds. |
[in] | context | Pointer passed to timer handler. |
Return RD_SUCCESS on success, error code on start.
rd_status_t ri_timer_stop | ( | ri_timer_id_t | timer_id | ) |
Stop a running timer.
timer_id | id of timer to stop returns RD_SUCCESS on success, error code from stack on error |
rd_status_t ri_timer_uninit | ( | void | ) |