dpl_sem.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
20 #ifndef DPL_DPL_SEM_H
21 #define DPL_DPL_SEM_H
22 
23 #include <stdint.h>
24 
25 #include "dpl_types.h"
26 #include "dpl_error.h"
27 
28 #include "sema.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 struct dpl_sem {
39 };
40 
51 dpl_error_t dpl_sem_init(struct dpl_sem *sem, uint16_t tokens);
52 
67 dpl_error_t dpl_sem_pend(struct dpl_sem *sem, dpl_time_t timeout);
68 
79 
83 uint16_t dpl_sem_get_count(struct dpl_sem *sem);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif /* DPL_DPL_SEM_H */
dpl_error.h
uwb-core DPL (Decawave Porting Layer) error types
dpl_sem_get_count
uint16_t dpl_sem_get_count(struct dpl_sem *sem)
Get current semaphore's count.
dpl_time_t
uint32_t dpl_time_t
dpl time type
Definition: dpl_types.h:55
sema.h
Semaphore definitions.
dpl_sem_init
dpl_error_t dpl_sem_init(struct dpl_sem *sem, uint16_t tokens)
Initialize a semaphore.
dpl_sem
dpl semaphore wrapper
Definition: dpl_sem.h:37
sema_t
A Semaphore.
Definition: sema.h:63
dpl_error_t
enum dpl_error dpl_error_t
dep error type
Definition: dpl_error.h:49
dpl_sem_release
dpl_error_t dpl_sem_release(struct dpl_sem *sem)
Release a semaphore.
dpl_types.h
uwb-core DPL (Decawave Porting Layer) types
dpl_sem_pend
dpl_error_t dpl_sem_pend(struct dpl_sem *sem, dpl_time_t timeout)
Pend (wait) for a semaphore.
dpl_sem::sema
sema_t sema
the semaphore
Definition: dpl_sem.h:38