uwb-core DPL (Decawave Porting Layer) callout abstraction More...
uwb-core DPL (Decawave Porting Layer) callout abstraction
Callout sets a timer that on expiration will post an event to an event queue. This mimics the same as MyNewt callout api.
Definition in file dpl_callout.h.
#include "xtimer.h"
#include "dpl/dpl_types.h"
#include "dpl/dpl_eventq.h"
#include "dpl/dpl_error.h"
Go to the source code of this file.
Data Structures | |
struct | dpl_callout |
callout structure More... | |
Functions | |
void | dpl_callout_init (struct dpl_callout *c, struct dpl_eventq *q, dpl_event_fn *e_cb, void *e_arg) |
Initialize a callout. More... | |
dpl_error_t | dpl_callout_reset (struct dpl_callout *c, dpl_time_t ticks) |
Reset the callout to fire off in 'ticks' ticks. More... | |
void | dpl_callout_stop (struct dpl_callout *c) |
Stops the callout from firing. More... | |
void dpl_callout_init | ( | struct dpl_callout * | c, |
struct dpl_eventq * | q, | ||
dpl_event_fn * | e_cb, | ||
void * | e_arg | ||
) |
Initialize a callout.
Callouts are used to schedule events in the future onto an event queue. Callout timers are scheduled using the dpl_callout_reset() function. When the timer expires, an event is posted to the event queue specified in dpl_callout_init(). The event argument given here is posted in the ev_arg field of that event.
[out] | c | callout to initialize |
[in] | q | event queue to queue event in |
[in] | e_cb | callback function |
[in] | e_arg | callback function argument |
dpl_error_t dpl_callout_reset | ( | struct dpl_callout * | c, |
dpl_time_t | ticks | ||
) |
Reset the callout to fire off in 'ticks' ticks.
[in] | c | callout to reset |
[in] | ticks | number of ticks to wait before posting an event |
void dpl_callout_stop | ( | struct dpl_callout * | c | ) |
Stops the callout from firing.
[in] | c | the callout to stop |