AM62Px MCU+ SDK  10.01.00

Introduction

For more details and example usage, see Semaphore

Data Structures

struct  SemaphoreP_Object
 Opaque semaphore object used with the semaphore APIs. More...
 

Functions

int32_t SemaphoreP_constructMutex (SemaphoreP_Object *obj)
 Create a mutex semaphore object. More...
 
int32_t SemaphoreP_constructBinary (SemaphoreP_Object *obj, uint32_t initValue)
 Create a binary semaphore object. More...
 
int32_t SemaphoreP_constructCounting (SemaphoreP_Object *obj, uint32_t initValue, uint32_t maxValue)
 Create a counting semaphore object. More...
 
void SemaphoreP_destruct (SemaphoreP_Object *obj)
 Cleanup, delete, destruct a semaphore object. More...
 
void SemaphoreP_post (SemaphoreP_Object *obj)
 Post a semaphore object or unlock a mutex. More...
 
int32_t SemaphoreP_pend (SemaphoreP_Object *obj, uint32_t timeToWaitInTicks)
 Pend on a semaphore object or lock a mutex. More...
 
int32_t SemaphoreP_getCount (SemaphoreP_Object *obj)
 Function to return the count of a semaphore. Supported only on FreeRTOS. More...
 

Macros

#define SemaphoreP_OBJECT_SIZE_MAX   (152U)
 Max size of semaphore object across no-RTOS and all OS's. More...
 

Macro Definition Documentation

◆ SemaphoreP_OBJECT_SIZE_MAX

#define SemaphoreP_OBJECT_SIZE_MAX   (152U)

Max size of semaphore object across no-RTOS and all OS's.

Function Documentation

◆ SemaphoreP_constructMutex()

int32_t SemaphoreP_constructMutex ( SemaphoreP_Object obj)

Create a mutex semaphore object.

Parameters
obj[out] created object
Returns
SystemP_SUCCESS on success, SystemP_FAILURE on error

◆ SemaphoreP_constructBinary()

int32_t SemaphoreP_constructBinary ( SemaphoreP_Object obj,
uint32_t  initValue 
)

Create a binary semaphore object.

Parameters
obj[out] created object
initValue[in] Initial value of the binary semaphore, MUST be 0 or 1
Returns
SystemP_SUCCESS on success, SystemP_FAILURE on error

◆ SemaphoreP_constructCounting()

int32_t SemaphoreP_constructCounting ( SemaphoreP_Object obj,
uint32_t  initValue,
uint32_t  maxValue 
)

Create a counting semaphore object.

Parameters
obj[out] created object
initValue[in] Initial value of the counting semaphore, MUST be between 0 .. maxValue
maxValue[in] Maximum value of counting semaphore
Returns
SystemP_SUCCESS on success, SystemP_FAILURE on error

◆ SemaphoreP_destruct()

void SemaphoreP_destruct ( SemaphoreP_Object obj)

Cleanup, delete, destruct a semaphore object.

Parameters
obj[in] semaphore object

◆ SemaphoreP_post()

void SemaphoreP_post ( SemaphoreP_Object obj)

Post a semaphore object or unlock a mutex.

Parameters
obj[in] semaphore object

◆ SemaphoreP_pend()

int32_t SemaphoreP_pend ( SemaphoreP_Object obj,
uint32_t  timeToWaitInTicks 
)

Pend on a semaphore object or lock a mutex.

Parameters
obj[in] semaphore object
timeToWaitInTicks[in] amount of time to block waiting for semaphore to be available, in units of system ticks (see Clock)
Returns
SystemP_SUCCESS on successful acquire of the semaphore
SystemP_TIMEOUT on failure to acquire the semaphore due to timeout condition
SystemP_FAILURE on failure to acquire the semaphore due to other conditions

◆ SemaphoreP_getCount()

int32_t SemaphoreP_getCount ( SemaphoreP_Object obj)

Function to return the count of a semaphore. Supported only on FreeRTOS.

Parameters
objA SemaphoreP_Handle
Returns
The count of the semaphore