dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Abstracts the concept of a binary semaphore to hide different implementations. More...

Data Structures

struct  pios_semaphore
 

Macros

#define PIOS_SEMAPHORE_TIMEOUT_MAX   0xffffffff
 

Functions

struct pios_semaphorePIOS_Semaphore_Create (void)
 Creates a binary semaphore. More...
 
bool PIOS_Semaphore_Take (struct pios_semaphore *sema, uint32_t timeout_ms)
 Takes binary semaphore. More...
 
bool PIOS_Semaphore_Give (struct pios_semaphore *sema)
 Gives binary semaphore. More...
 
bool PIOS_Semaphore_Take_FromISR (struct pios_semaphore *sema, bool *woken)
 
bool PIOS_Semaphore_Give_FromISR (struct pios_semaphore *sema, bool *woken)
 

Variables

uint32_t pios_semaphore::sema_count
 

Detailed Description

Abstracts the concept of a binary semaphore to hide different implementations.

Macro Definition Documentation

#define PIOS_SEMAPHORE_TIMEOUT_MAX   0xffffffff

Definition at line 30 of file pios_semaphore.h.

Function Documentation

struct pios_semaphore * PIOS_Semaphore_Create ( void  )

Creates a binary semaphore.

Returns
instance of struct pios_semaphore or NULL on failure

Definition at line 150 of file pios_semaphore.c.

bool PIOS_Semaphore_Give ( struct pios_semaphore sema)

Gives binary semaphore.

Parameters
[in]semapointer to instance of struct pios_semaphore
Returns
true on success or false on timeout or failure

Definition at line 202 of file pios_semaphore.c.

bool PIOS_Semaphore_Give_FromISR ( struct pios_semaphore sema,
bool *  woken 
)

Definition at line 231 of file pios_semaphore.c.

bool PIOS_Semaphore_Take ( struct pios_semaphore sema,
uint32_t  timeout_ms 
)

Takes binary semaphore.

Parameters
[in]semapointer to instance of struct pios_semaphore
[in]timeout_mstimeout for acquiring the lock in milliseconds
Returns
true on success or false on timeout or failure

Definition at line 175 of file pios_semaphore.c.

bool PIOS_Semaphore_Take_FromISR ( struct pios_semaphore sema,
bool *  woken 
)

Definition at line 220 of file pios_semaphore.c.

Variable Documentation

uint32_t pios_semaphore::sema_count

Definition at line 34 of file pios_semaphore.c.