monoZ docs
Semaphore

-For semaphore related APIs refer MZ_sys_cmsis_os2.h file. More...

Functions

uint8_t mz_sem_create (mz_semaphore_t *c, uint8_t cnt, uint8_t init)
 This function is used to create and initialize the semaphore object Create and Initialize a Semaphore object. More...
 
uint8_t mz_sem_delete (mz_semaphore_t *c)
 This function is used to delete a semaphore object Delete a Semaphore object. More...
 
uint32_t mz_sem_wait (mz_semaphore_t *c, uint32_t timeout)
 This function is used to acquire a semaphore token or timout if no tokens are available Acquire a Semaphore token or timeout if no tokens are available. More...
 
uint8_t mz_sem_release (mz_semaphore_t *c)
 This function is used to acquire a semaphore token or timout if no tokens are available Release a Semaphore token up to the initial maximum count. More...
 
uint8_t mz_sem_isvalid (mz_semaphore_t *c)
 This functiion is used to check the semaphore object validity Check the Semaphore object validation. More...
 
uint8_t mz_sem_invalid (mz_semaphore_t *c)
 This function is used to invalidate the created semaphore Semaphore object is invalid. More...
 

Detailed Description

-For semaphore related APIs refer MZ_sys_cmsis_os2.h file.

Function Documentation

◆ mz_sem_create()

uint8_t mz_sem_create ( mz_semaphore_t c,
uint8_t  cnt,
uint8_t  init 
)

This function is used to create and initialize the semaphore object Create and Initialize a Semaphore object.

Parameters
cmz_mutex_t
cntuint8_t
inituint8_t
Returns
semaphore ID for reference by other functions or NULL in case of error.

◆ mz_sem_delete()

uint8_t mz_sem_delete ( mz_semaphore_t c)

This function is used to delete a semaphore object Delete a Semaphore object.

Parameters
cmz_semaphore_t
Returns
status code that indicates the execution status of the function.

◆ mz_sem_wait()

uint32_t mz_sem_wait ( mz_semaphore_t c,
uint32_t  timeout 
)

This function is used to acquire a semaphore token or timout if no tokens are available Acquire a Semaphore token or timeout if no tokens are available.

Parameters
cmz_semaphore_t
timeoutuint32_t
Returns
status code that indicates the execution status of the function.

◆ mz_sem_release()

uint8_t mz_sem_release ( mz_semaphore_t c)

This function is used to acquire a semaphore token or timout if no tokens are available Release a Semaphore token up to the initial maximum count.

Parameters
cmz_semaphore_t
Returns
status code that indicates the execution status of the function.

◆ mz_sem_isvalid()

uint8_t mz_sem_isvalid ( mz_semaphore_t c)

This functiion is used to check the semaphore object validity Check the Semaphore object validation.

Parameters
cmz_semaphore_t
Returns
status code that indicates the execution status of the function.

◆ mz_sem_invalid()

uint8_t mz_sem_invalid ( mz_semaphore_t c)

This function is used to invalidate the created semaphore Semaphore object is invalid.

Parameters
cmz_semaphore_t
Returns
status code that indicates the execution status of the function.