Files | |
| file | SemaphoreP.h |
| Semaphore module for the RTOS Porting Interface. | |
Data Structures | |
| struct | SemaphoreP_Params |
| Basic SemaphoreP Parameters. More... | |
Variables | |
| char * | SemaphoreP_Params::name |
| SemaphoreP_Mode | SemaphoreP_Params::mode |
| uint32_t | SemaphoreP_Params::maxCount |
Semaphore status code | |
| typedef int32_t | SemaphoreP_Status |
| Status codes for SemaphoreP APIs. More... | |
| typedef void * | SemaphoreP_Handle |
| Opaque client reference to an instance of a SemaphoreP. More... | |
| #define | SemaphoreP_OK (0) |
| #define | SemaphoreP_FAILURE (-(int32_t)1) |
| #define | SemaphoreP_TIMEOUT (-(int32_t)2) |
| #define | SemaphoreP_UNSUPPORTED (-(int32_t)3) |
| #define | SemaphoreP_WAIT_FOREVER (~((uint32_t)0U)) |
| Wait forever define. More... | |
| #define | SemaphoreP_NO_WAIT ((uint32_t)0U) |
| No wait define. More... | |
Mode of Semaphore | |
| typedef uint32_t | SemaphoreP_Mode |
| Mode of the semaphore. More... | |
| SemaphoreP_Handle | SemaphoreP_create (uint32_t count, const SemaphoreP_Params *semParams) |
| Function to create a semaphore. More... | |
| SemaphoreP_Status | SemaphoreP_delete (SemaphoreP_Handle semPhandle) |
| Function to delete a semaphore. More... | |
| void | SemaphoreP_Params_init (SemaphoreP_Params *semParams) |
| Initialize params structure to default values. More... | |
| SemaphoreP_Status | SemaphoreP_pend (SemaphoreP_Handle semPhandle, uint32_t timeout) |
| Function to pend (wait) on a semaphore. More... | |
| SemaphoreP_Status | SemaphoreP_post (SemaphoreP_Handle semPhandle) |
| Function to post (signal) a semaphore. More... | |
| SemaphoreP_Status | SemaphoreP_postFromClock (SemaphoreP_Handle semPhandle) |
| Function to post (signal) a semaphore from an ClockP function. More... | |
| SemaphoreP_Status | SemaphoreP_postFromISR (SemaphoreP_Handle semPhandle) |
| Function to post (signal) a semaphore from an ISR. More... | |
| int32_t | SemaphoreP_getCount (SemaphoreP_Handle semPhandle) |
| Function to return the count of a semaphore. More... | |
| #define | SemaphoreP_Mode_COUNTING (0x0U) |
| #define | SemaphoreP_Mode_BINARY (0x1U) |
SemaphoreP interface
| #define SemaphoreP_OK (0) |
| #define SemaphoreP_FAILURE (-(int32_t)1) |
API completed successfully
| #define SemaphoreP_TIMEOUT (-(int32_t)2) |
API failed
| #define SemaphoreP_UNSUPPORTED (-(int32_t)3) |
API failed because of a timeout
| #define SemaphoreP_WAIT_FOREVER (~((uint32_t)0U)) |
Wait forever define.
API failed because of not supported
| #define SemaphoreP_NO_WAIT ((uint32_t)0U) |
No wait define.
| #define SemaphoreP_Mode_COUNTING (0x0U) |
| #define SemaphoreP_Mode_BINARY (0x1U) |
| typedef int32_t SemaphoreP_Status |
Status codes for SemaphoreP APIs.
| typedef void* SemaphoreP_Handle |
Opaque client reference to an instance of a SemaphoreP.
A SemaphoreP_Handle returned from the SemaphoreP_create represents that instance and is used in the other instance based functions (e.g. SemaphoreP_post or SemaphoreP_pend, etc.).
| typedef uint32_t SemaphoreP_Mode |
Mode of the semaphore.
| SemaphoreP_Handle SemaphoreP_create | ( | uint32_t | count, |
| const SemaphoreP_Params * | semParams | ||
| ) |
Function to create a semaphore.
| count | Initial count of the semaphore. For binary semaphores, only values of 0 or 1 are valid. |
| semParams | Pointer to the instance configuration parameters. NULL denotes to use the default parameters (SemaphoreP default parameters as noted in SemaphoreP_Params_init. |
| SemaphoreP_Status SemaphoreP_delete | ( | SemaphoreP_Handle | semPhandle | ) |
Function to delete a semaphore.
| semPhandle | A SemaphoreP_Handle returned from SemaphoreP_create |
| void SemaphoreP_Params_init | ( | SemaphoreP_Params * | semParams | ) |
Initialize params structure to default values.
The default parameters are:
| semParams | Pointer to the instance configuration parameters. |
| SemaphoreP_Status SemaphoreP_pend | ( | SemaphoreP_Handle | semPhandle, |
| uint32_t | timeout | ||
| ) |
Function to pend (wait) on a semaphore.
| semPhandle | A SemaphoreP_Handle returned from SemaphoreP_create |
| timeout | Timeout (in ticks) to wait for the semaphore to be posted (signalled). |
| SemaphoreP_Status SemaphoreP_post | ( | SemaphoreP_Handle | semPhandle | ) |
Function to post (signal) a semaphore.
| semPhandle | A SemaphoreP_Handle returned from SemaphoreP_create |
| SemaphoreP_Status SemaphoreP_postFromClock | ( | SemaphoreP_Handle | semPhandle | ) |
Function to post (signal) a semaphore from an ClockP function.
| semPhandle | A SemaphoreP_Handle returned from SemaphoreP_create |
| SemaphoreP_Status SemaphoreP_postFromISR | ( | SemaphoreP_Handle | semPhandle | ) |
Function to post (signal) a semaphore from an ISR.
| semPhandle | A SemaphoreP_Handle returned from SemaphoreP_create |
| int32_t SemaphoreP_getCount | ( | SemaphoreP_Handle | semPhandle | ) |
Function to return the count of a semaphore.
| semPhandle | A SemaphoreP_Handle returned from SemaphoreP_create |
| char* SemaphoreP_Params::name |
Name of the semaphore instance. Memory must persist for the life of the semaphore instance
| SemaphoreP_Mode SemaphoreP_Params::mode |
Mode for the semaphore SemaphoreP_Mode
| uint32_t SemaphoreP_Params::maxCount |
The max count allowed for counting semaphore