Loading...
Searching...
No Matches

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

Detailed Description

uwb-core DPL (Decawave Porting Layer) semapahore 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_sem.h.

#include <stdint.h>
#include "dpl_types.h"
#include "dpl_error.h"
#include "os/os_sem.h"
+ Include dependency graph for dpl_sem.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dpl_sem
 dpl semaphore wrapper More...
 

Functions

static dpl_error_t dpl_sem_init (struct dpl_sem *sem, uint16_t tokens)
 Initialize a semaphore.
 
static dpl_error_t dpl_sem_pend (struct dpl_sem *sem, dpl_time_t timeout)
 Pend (wait) for a semaphore.
 
static dpl_error_t dpl_sem_release (struct dpl_sem *sem)
 Release a semaphore.
 
static int16_t dpl_sem_get_count (struct dpl_sem *sem)
 Get current semaphore's count.
 

Function Documentation

◆ dpl_sem_get_count()

static int16_t dpl_sem_get_count ( struct dpl_sem sem)
inlinestatic

Get current semaphore's count.

Definition at line 91 of file dpl_sem.h.

◆ dpl_sem_init()

static dpl_error_t dpl_sem_init ( struct dpl_sem sem,
uint16_t  tokens 
)
inlinestatic

Initialize a semaphore.

Parameters
[in]sempointer to semaphore
[in]tokens# of tokens the semaphore should contain initially.
Returns
dpl_error_t DPL_INVALID_PARM Semaphore passed in was NULL. DPL_OK no error.

Definition at line 50 of file dpl_sem.h.

◆ dpl_sem_pend()

static dpl_error_t dpl_sem_pend ( struct dpl_sem sem,
dpl_time_t  timeout 
)
inlinestatic

Pend (wait) for a semaphore.

Parameters
[in]sempointer to semaphore.
[in]timeouttimeout, in os ticks. A timeout of 0 means do not wait if not available. A timeout of DPL_TIMEOUT_NEVER means wait forever.
Returns
dpl_error_t DPL_INVALID_PARM semaphore passed in was NULL. DPL_TIMEOUT semaphore was owned by another task and timeout=0 DPL_OK no error

Definition at line 69 of file dpl_sem.h.

◆ dpl_sem_release()

static dpl_error_t dpl_sem_release ( struct dpl_sem sem)
inlinestatic

Release a semaphore.

Parameters
[in]sempointer to the semaphore to be released
Returns
dpl_error_t DPL_INVALID_PARM semaphore passed in was NULL. DPL_OK no error

Definition at line 83 of file dpl_sem.h.