Provides functionality to trigger periodic event callbacks. More...
Provides functionality to trigger periodic event callbacks.
This provides convenience functions to trigger periodic event callbacks executed by the event thread.
Event Periodic Callback API
Definition in file periodic_callback.h.
Go to the source code of this file.
Data Structures | |
struct | event_periodic_callback_t |
Periodic Callback Event structure. More... | |
static void * | event_periodic_callback_get_arg (event_periodic_callback_t *event) |
Get user context from Periodic Callback Event. More... | |
static void | event_periodic_callback_init (event_periodic_callback_t *event, ztimer_clock_t *clock, event_queue_t *queue, void(*callback)(void *), void *arg) |
Initialize a periodic callback event. More... | |
static void | event_periodic_callback_start (event_periodic_callback_t *event, uint32_t interval) |
Starts a periodic callback event. More... | |
static void | event_periodic_callback_set_count (event_periodic_callback_t *event, uint32_t count) |
Set the amount of times the periodic callback event should repeat itself. More... | |
static void | event_periodic_callback_stop (event_periodic_callback_t *event) |
Stop a periodic callback event. More... | |
|
inlinestatic |
Get user context from Periodic Callback Event.
[in] | event | event_periodic_callback object to initialize |
Definition at line 49 of file periodic_callback.h.
|
inlinestatic |
Initialize a periodic callback event.
[in] | event | event_periodic_callback object to initialize |
[in] | clock | the clock to configure this timer on |
[in] | queue | queue that the timed-out event will be added to |
[in] | callback | callback to set up |
[in] | arg | callback argument to set up |
Definition at line 65 of file periodic_callback.h.
|
inlinestatic |
Set the amount of times the periodic callback event should repeat itself.
[in] | event | event_periodic_callback context object to use |
[in] | count | times the event should repeat itself, EVENT_PERIODIC_FOREVER to run for ever. |
Definition at line 107 of file periodic_callback.h.
|
inlinestatic |
Starts a periodic callback event.
If the event is already started, it's interval will be updated and it will be scheduled with the new interval.
This will make the event as configured in event
be triggered at every interval ticks (based on event->periodic.clock).
[in] | event | event_periodic_callback context object to use |
[in] | interval | period length for the event |
Definition at line 94 of file periodic_callback.h.
|
inlinestatic |
Stop a periodic callback event.
Calling this function will cancel the timeout by removing its underlying timer. If the timer has already fired before calling this function, the connected event will be put already into the given event queue and this function does not have any effect.
[in] | event | event_periodic_callback context object to use |
Definition at line 127 of file periodic_callback.h.