oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Typedefs | Functions
timer.h File Reference
#include "ove/types.h"
#include "ove_config.h"
#include "ove/storage.h"
Include dependency graph for timer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct ove_timer * ove_timer_t
 Opaque handle for a software timer object.
 
typedef void(* ove_timer_fn) (ove_timer_t timer, void *user_data)
 Timer expiry callback function prototype.
 

Functions

int ove_timer_init (ove_timer_t *timer, ove_timer_storage_t *storage, ove_timer_fn callback, void *user_data, uint32_t period_ms, int one_shot)
 Initialise a software timer using caller-supplied static storage.
 
void ove_timer_deinit (ove_timer_t timer)
 Stop and release resources held by a timer initialised with ove_timer_init().
 
int ove_timer_init_ns (ove_timer_t *timer, ove_timer_storage_t *storage, ove_timer_fn callback, void *user_data, uint64_t period_ns, int one_shot)
 Initialise a software timer with a nanosecond period using caller-supplied static storage.
 
int ove_timer_set_period_ns (ove_timer_t timer, uint64_t period_ns)
 Change the period of an existing timer and (re)arm it.
 
int ove_timer_create (ove_timer_t *timer, ove_timer_fn callback, void *user_data, uint32_t period_ms, int one_shot)
 Allocate and initialise a software timer from the heap.
 
int ove_timer_create_ns (ove_timer_t *timer, ove_timer_fn callback, void *user_data, uint64_t period_ns, int one_shot)
 Allocate and initialise a software timer with a nanosecond period from the heap.
 
void ove_timer_destroy (ove_timer_t timer)
 Stop and free a timer allocated with ove_timer_create().
 
int ove_timer_start (ove_timer_t timer)
 Start (arm) a timer.
 
int ove_timer_stop (ove_timer_t timer)
 Stop a running timer without invoking its callback.
 
int ove_timer_reset (ove_timer_t timer)
 Restart a timer's countdown from the beginning of its period.