Loading...
Searching...
No Matches

uwb-core DPL (Decawave Porting Layer) event queue wrappers More...

Detailed Description

uwb-core DPL (Decawave Porting Layer) event queue wrappers

Author
Francisco Molina franc.nosp@m.ois-.nosp@m.xavie.nosp@m.r.mo.nosp@m.lina@.nosp@m.inri.nosp@m.a.fr

Definition in file dpl_eventq.h.

#include <dpl/dpl_types.h>
#include "os/os_eventq.h"
#include "uwb_core.h"
+ Include dependency graph for dpl_eventq.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpl_event
 dpl event wrapper More...
 
struct  dpl_eventq
 dpl event queue wrapper More...
 

Typedefs

typedef void dpl_event_fn(struct dpl_event *ev)
 dpl event callback function
 

Functions

static void dpl_event_init (struct dpl_event *ev, dpl_event_fn *fn, void *arg)
 Init a event.
 
static bool dpl_event_is_queued (struct dpl_event *ev)
 Check if event is in queue.
 
static void * dpl_event_get_arg (struct dpl_event *ev)
 Runs an event.
 
static void dpl_event_set_arg (struct dpl_event *ev, void *arg)
 Set the vent arg.
 
static void dpl_event_run (struct dpl_event *ev)
 Runs an event.
 
static void dpl_eventq_init (struct dpl_eventq *evq)
 Initialize the event queue.
 
static int dpl_eventq_inited (struct dpl_eventq *evq)
 Check whether the event queue is initialized.
 
static void dpl_eventq_deinit (struct dpl_eventq *evq)
 Deinitialize an event queue.
 
static struct dpl_eventdpl_eventq_get (struct dpl_eventq *evq)
 Get next event from event queue, blocking.
 
static struct dpl_eventdpl_eventq_get_no_wait (struct dpl_eventq *evq)
 Get next event from event queue, non-blocking.
 
static void dpl_eventq_put (struct dpl_eventq *evq, struct dpl_event *ev)
 Put an event on the event queue.
 
static void dpl_eventq_remove (struct dpl_eventq *evq, struct dpl_event *ev)
 Remove an event from the queue.
 
static void dpl_eventq_run (struct dpl_eventq *evq)
 Gets and runs an event from the queue callback.
 
static bool dpl_eventq_is_empty (struct dpl_eventq *evq)
 Check if queue is empty.
 
static struct dpl_eventqdpl_eventq_dflt_get (void)
 Retrieves the default event queue.
 

Typedef Documentation

◆ dpl_event_fn

typedef void dpl_event_fn(struct dpl_event *ev)

dpl event callback function

Definition at line 49 of file dpl_eventq.h.

Function Documentation

◆ dpl_event_get_arg()

static void * dpl_event_get_arg ( struct dpl_event ev)
inlinestatic

Runs an event.

Parameters
[in]evevent to run

Definition at line 81 of file dpl_eventq.h.

◆ dpl_event_init()

static void dpl_event_init ( struct dpl_event ev,
dpl_event_fn fn,
void *  arg 
)
inlinestatic

Init a event.

Parameters
[in]evpointer to event to set
[in]fnevent callback function
[in]argevent argument

Definition at line 58 of file dpl_eventq.h.

◆ dpl_event_is_queued()

static bool dpl_event_is_queued ( struct dpl_event ev)
inlinestatic

Check if event is in queue.

Parameters
[in]evevent to check
Returns
true if event is queues, false otherwise

Definition at line 71 of file dpl_eventq.h.

◆ dpl_event_run()

static void dpl_event_run ( struct dpl_event ev)
inlinestatic

Runs an event.

Parameters
[in]evevent to run

Definition at line 102 of file dpl_eventq.h.

◆ dpl_event_set_arg()

static void dpl_event_set_arg ( struct dpl_event ev,
void *  arg 
)
inlinestatic

Set the vent arg.

Parameters
[in]evevent
[in]argarg to set event

Definition at line 92 of file dpl_eventq.h.

◆ dpl_eventq_deinit()

static void dpl_eventq_deinit ( struct dpl_eventq evq)
inlinestatic

Deinitialize an event queue.

Note
Not supported in RIOT
Parameters
[in]evqthe event queue to deinit

Definition at line 134 of file dpl_eventq.h.

◆ dpl_eventq_dflt_get()

static struct dpl_eventq * dpl_eventq_dflt_get ( void  )
inlinestatic

Retrieves the default event queue.

As there is no default event queue in RIOT, uwb-core will start and handle a default event queue.

Returns
the default event queue.

Definition at line 214 of file dpl_eventq.h.

◆ dpl_eventq_get()

static struct dpl_event * dpl_eventq_get ( struct dpl_eventq evq)
inlinestatic

Get next event from event queue, blocking.

Parameters
[in]evqthe event queue to pull an event from
Returns
the event from the queue

Definition at line 147 of file dpl_eventq.h.

◆ dpl_eventq_get_no_wait()

static struct dpl_event * dpl_eventq_get_no_wait ( struct dpl_eventq evq)
inlinestatic

Get next event from event queue, non-blocking.

Returns
event from the queue, or NULL if none available.

Definition at line 157 of file dpl_eventq.h.

◆ dpl_eventq_init()

static void dpl_eventq_init ( struct dpl_eventq evq)
inlinestatic

Initialize the event queue.

Parameters
[in]evqThe event queue to initialize

Definition at line 112 of file dpl_eventq.h.

◆ dpl_eventq_inited()

static int dpl_eventq_inited ( struct dpl_eventq evq)
inlinestatic

Check whether the event queue is initialized.

Parameters
[in]evqthe event queue to check

Definition at line 122 of file dpl_eventq.h.

◆ dpl_eventq_is_empty()

static bool dpl_eventq_is_empty ( struct dpl_eventq evq)
inlinestatic

Check if queue is empty.

Parameters
[in]evqthe event queue to check
Returns
true if empty, false otherwise

Definition at line 201 of file dpl_eventq.h.

◆ dpl_eventq_put()

static void dpl_eventq_put ( struct dpl_eventq evq,
struct dpl_event ev 
)
inlinestatic

Put an event on the event queue.

Parameters
[in]evqevent queue
[in]evevent to put in queue

Definition at line 168 of file dpl_eventq.h.

◆ dpl_eventq_remove()

static void dpl_eventq_remove ( struct dpl_eventq evq,
struct dpl_event ev 
)
inlinestatic

Remove an event from the queue.

Parameters
[in]evqevent queue to remove the event from
[in]evevent to remove from the queue

Definition at line 179 of file dpl_eventq.h.

◆ dpl_eventq_run()

static void dpl_eventq_run ( struct dpl_eventq evq)
inlinestatic

Gets and runs an event from the queue callback.

Parameters
[in]evqThe event queue to pull the item off.

Definition at line 189 of file dpl_eventq.h.