MAX32665 SDK Documentation  0.2
Software Development Kit Overview and API Documentation
Semaphore (SEMA)

Modules

 SEMA_Registers
 Registers, Bit Masks and Bit Positions for the SEMA Peripheral Module.
 

Functions

int SEMA_Init (sys_cfg_sema_t *sys_cfg)
 Initialize the semaphore peripheral. More...
 
int SEMA_GetSema (unsigned sema)
 Attempt to get a semaphore. More...
 
int SEMA_CheckSema (unsigned sema)
 Check a semaphore. More...
 
uint32_t SEMA_Status (void)
 Check all semaphores. More...
 
void SEMA_FreeSema (unsigned sema)
 Frees the semaphore. More...
 
int SEMA_Shutdown (void)
 Shutdown the semaphore peripheral. More...
 

Detailed Description

Function Documentation

◆ SEMA_Init()

int SEMA_Init ( sys_cfg_sema_t *  sys_cfg)
Returns
E_NO_ERROR if semaphore acquired.

◆ SEMA_GetSema()

int SEMA_GetSema ( unsigned  sema)
Parameters
semaNumber of semaphore you are trying to get.
Returns
E_NO_ERROR if semaphore acquired.
E_BUSY if semaphore is already locked.

◆ SEMA_CheckSema()

int SEMA_CheckSema ( unsigned  sema)
Parameters
semaNumber of semaphore you want to check.
Returns
E_NO_ERROR if semaphore is free.
E_BUSY if semaphore is already locked.
Note
Will not be atomic if you call this function and then attempt to SEMA_GetSema().

◆ SEMA_Status()

uint32_t SEMA_Status ( void  )
Returns
Status of all semaphores. Each semaphore will be represented by 1 bit.
Note
Will not be atomic if you call this function and then attempt to SEMA_GetSema().

◆ SEMA_FreeSema()

void SEMA_FreeSema ( unsigned  sema)
Parameters
semaNumber of semaphore want to free.

◆ SEMA_Shutdown()

int SEMA_Shutdown ( void  )
Returns
E_NO_ERROR if semaphore acquired.