# osal\_sem.h - [Overview](#section458654899165628) - [Summary](#section1491335021165628) - [Data Structures](#nested-classes) - [Macros](#define-members) - [Functions](#func-members) ## **Overview** **Related Modules:** [OSAL](OSAL.md) **Description:** Declares semaphore structures and interfaces. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Data Structures

Data Structure Name

Description

OsalSem

Describes a semaphore.

## Macros

Macro Name and Value

Description

OSAL_DECLARE_SEMAPHORE(sem) struct OsalSem sem

Defines a semaphore.

## Functions

Function

Description

OsalSemInit (struct OsalSem *sem, uint32_t value)

int32_t

Initializes a semaphore.

OsalSemWait (struct OsalSem *sem, uint32_t ms)

int32_t

Waits for a semaphore.

OsalSemPost (struct OsalSem *sem)

int32_t

Releases a semaphore.

OsalSemDestroy (struct OsalSem *sem)

int32_t

Destroys a semaphore.