This section contains APIs for providing abstraction between PDK OSAL and MCU+SDK DPL.
◆ APP_RTOS_STATUS_SUCCESS
#define APP_RTOS_STATUS_SUCCESS (0) |
◆ APP_RTOS_STATUS_FAILURE
#define APP_RTOS_STATUS_FAILURE (-(int32_t)1) |
API completed successfully
◆ APP_RTOS_STATUS_TIMEOUT
#define APP_RTOS_STATUS_TIMEOUT (-(int32_t)2) |
◆ APP_RTOS_SEMAPHORE_MODE_COUNTING
#define APP_RTOS_SEMAPHORE_MODE_COUNTING (0x0U) |
◆ APP_RTOS_SEMAPHORE_MODE_BINARY
#define APP_RTOS_SEMAPHORE_MODE_BINARY (0x1U) |
◆ APP_RTOS_SEMAPHORE_MODE_MUTEX
#define APP_RTOS_SEMAPHORE_MODE_MUTEX (0x2U) |
◆ APP_RTOS_SEMAPHORE_WAIT_FOREVER
#define APP_RTOS_SEMAPHORE_WAIT_FOREVER (~((uint32_t)0U)) |
◆ APP_RTOS_SEMAPHORE_NO_WAIT
#define APP_RTOS_SEMAPHORE_NO_WAIT ((uint32_t)0U) |
◆ app_rtos_status_t
Status codes for App Rtos APIs.
◆ app_rtos_semaphore_mode_t
◆ app_rtos_semaphore_handle_t
Opaque client reference to an instance of a semaphore.
◆ app_rtos_task_handle_t
Opaque client reference to an instance of a task.
◆ appRtosSemaphoreParamsInit()
Initialize params structure to default values.
The default parameters are:
- mode: APP_RTOS_SEMAPHORE_MODE_COUNTING
- maxValue: 255
- initValue: 0
- Parameters
-
params | Pointer to the instance configuration parameters. |
◆ appRtosSemaphoreCreate()
Creates a semaphore instance.
- Parameters
-
params | [in] parameters for semaphore creation |
- Returns
- app_rtos_semaphore_handle_t on success or a NULL on an error
◆ appRtosSemaphoreDelete()
Function to delete a semaphore.
- Parameters
-
- Returns
- Status of the functions
- APP_RTOS_STATUS_SUCCESS: Deleted the semaphore instance
- APP_RTOS_STATUS_FAILURE: Failed to delete the semaphore instance
◆ appRtosSemaphorePend()
Function to pend (wait) on a semaphore.
- Parameters
-
semhandle | A app_rtos_semaphore_handle_t returned from appRtosSemaphoreCreate |
timeout | Timeout (in milliseconds) to wait for the semaphore to be posted (signaled). |
- Returns
- Status of the functions
- APP_RTOS_STATUS_SUCCESS: Obtain the semaphore
- APP_RTOS_STATUS_TIMEOUT: Timed out. Semaphore was not obtained.
- APP_RTOS_STATUS_FAILURE: Non-time out failure.
◆ appRtosSemaphorePost()
Function to post (signal) a semaphore.
- Parameters
-
- Returns
- Status of the functions
- APP_RTOS_STATUS_SUCCESS: Released the semaphore
- APP_RTOS_STATUS_FAILURE: Failed to post the semaphore
◆ appRtosSemaphoreReset()
Function to clear a semaphore for reuse.
- Parameters
-
- Returns
- Status of the functions
- APP_RTOS_STATUS_SUCCESS: Reset the semaphore
- APP_RTOS_STATUS_FAILURE: Failed to reset the semaphore
◆ appRtosTaskParamsInit()
Initialize params structure to default values.
- Parameters
-
params | Pointer to the instance configuration parameters. |
◆ appRtosTaskCreate()
Function to create a task.
- Parameters
-
params | Pointer to the instance configuration parameters. |
- Returns
- app_rtos_task_handle_t on success or a NULL on an error
◆ appRtosTaskDelete()
Function to delete a task.
- Parameters
-
- Returns
- Status of the functions
- APP_RTOS_STATUS_SUCCESS: Deleted the task
- APP_RTOS_STATUS_FAILURE: Failed to delete the task
◆ appRtosTaskIsTerminated()
Check if task is terminated.
Typically a task MUST be terminated before it can be deleted.
- Returns
- 0: task is not terminated, 1: task is terminated
◆ appRtosTaskYield()
void appRtosTaskYield |
( |
void |
| ) |
|
◆ appRtosTaskSleep()
void appRtosTaskSleep |
( |
uint32_t |
timeout | ) |
|
Function for Task sleep in units of OS tick.
- Parameters
-
◆ appRtosTaskSleepInMsecs()
void appRtosTaskSleepInMsecs |
( |
uint32_t |
timeoutInMsecs | ) |
|
Function for Task sleep in units of msecs.
- Parameters
-
timeoutInMsecs | sleep in units of msecs. |