|
CC33XX API Documentation
2.30.00.15
|
This porting file provides the adaptation layer for the OS. More...
Files | |
| file | osi_freertos.c |
| osi_freertos porting file | |
Macros | |
| #define | ASSERT_ON_MALLOC_FAIL |
| #define | TICK_PERIOD_US (1000000 / configTICK_RATE_HZ) |
Typedefs | |
| typedef void(* | func) (void *) |
Functions | |
| void | assert (uint32_t condition) |
| Assert function for the upper MAC library. More... | |
| UINT32 | osi_EnterCritical (void) |
| This function used to enter into critical section. More... | |
| UINT32 | osi_ExitCritical (uint32_t ulKey) |
| This function used to exit critical section. More... | |
| OsiReturnVal_e | osi_SyncObjCreate (OsiSyncObj_t *pSyncObj) |
| This function creates a sync object. More... | |
| OsiReturnVal_e | osi_SyncObjDelete (OsiSyncObj_t *pSyncObj) |
| This function deletes a sync object. More... | |
| OsiReturnVal_e | osi_SyncObjSignal (OsiSyncObj_t *pSyncObj) |
| This function generates a sync signal for the object. More... | |
| OsiReturnVal_e | osi_SyncObjSignalFromISR (OsiSyncObj_t *pSyncObj) |
| This function generates a sync signal for the object from ISR context. More... | |
| OsiReturnVal_e | osi_SyncObjWait (OsiSyncObj_t *pSyncObj, OsiTime_t Timeout) |
| This function waits for a sync signal of the specific sync object. More... | |
| OsiReturnVal_e | osi_SyncObjClear (OsiSyncObj_t *pSyncObj) |
| This function clears a sync object. More... | |
| OsiReturnVal_e | osi_TaskCreate (P_OSI_TASK_ENTRY pEntry, const signed char *const pcName, unsigned short usStackDepth, void *pvParameters, unsigned long uxPriority, OsiTaskHandle *pTaskHandle) |
| This function creates a Task. More... | |
| void | osi_TaskDelete (OsiTaskHandle *pTaskHandle) |
| This function Deletes a Task. More... | |
| OsiReturnVal_e | osi_LockObjCreate (OsiLockObj_t *pLockObj) |
| This function creates a locking object. More... | |
| OsiReturnVal_e | osi_LockObjDelete (OsiLockObj_t *pLockObj) |
| This function deletes a locking object. More... | |
| OsiReturnVal_e | osi_LockObjLock (OsiLockObj_t *pLockObj, OsiTime_t Timeout) |
| This function locks a locking object. More... | |
| OsiReturnVal_e | osi_LockObjUnlock (OsiLockObj_t *pLockObj) |
| This function unlock a locking object. More... | |
| OsiReturnVal_e | osi_MsgQCreate (OsiMsgQ_t *pMsgQ, char *pMsgQName, UINT32 MsgSize, UINT32 MaxMsgs) |
| This function is used to create the MsgQ. More... | |
| OsiReturnVal_e | osi_MsgQDelete (OsiMsgQ_t *pMsgQ) |
| This function is used to delete the MsgQ. More... | |
| OsiReturnVal_e | osi_MsgQWrite (OsiMsgQ_t *pMsgQ, void *pMsg, OsiTime_t Timeout) |
| This function is used to write data to the MsgQ. More... | |
| OsiReturnVal_e | osi_MsgQRead (OsiMsgQ_t *pMsgQ, void *pMsg, OsiTime_t Timeout) |
| This function is used to read data from the MsgQ. More... | |
| UINT32 | osi_MsgQCount (OsiMsgQ_t *pMsgQ) |
| This function returns the number of messages ready in the Queue. More... | |
| BOOLEAN | osi_MsgQIsEmpty (OsiMsgQ_t *pMsgQ) |
| This function returns whether there are any messages ready in the Queue. More... | |
| void * | os_malloc (size_t size) |
| Allocate dynamic memory. More... | |
| void * | os_realloc (void *ptr, size_t newsize) |
| Re-allocate dynamic memory. More... | |
| void * | os_realloc_array (void *ptr, size_t nmemb, size_t size) |
| Re-Allocate and zero memory blocks. More... | |
| void * | os_calloc (size_t nmemb, size_t size) |
| Allocate and zero memory blocks. More... | |
| void * | os_zalloc (size_t size) |
| Allocate and zero memory. More... | |
| void | os_free (void *ptr) |
| Free memory. More... | |
| OsiReturnVal_e | osi_Sleep (OsiTime_t sec) |
| Put the thread to sleep. More... | |
| OsiReturnVal_e | osi_uSleep (OsiTime_t usec) |
| Put the thread to sleep in micro seconds. More... | |
| UINT32 | osi_GetTimeMS () |
| Get free running time in mili seconds. More... | |
| void | timerGeneralCallBack (TimerHandle_t tmr) |
| OsiReturnVal_e | osi_TimerCreate (OsiTimer_t *pTimer, char *pTimerName, P_TIMER_EXPIRY_LEGACY_FUNCTION pExpiryFunc, void *pParam) |
| Creates a timer in the OS. More... | |
| OsiReturnVal_e | osi_TimerDelete (OsiTimer_t *pTimer) |
| Deletes a timer in the OS. More... | |
| OsiReturnVal_e | osi_TimerStart (OsiTimer_t *pTimer, OsiTime_t DurationMiliSec, BOOLEAN Periodic) |
| Start a created timer. More... | |
| OsiReturnVal_e | osi_TimerStop (OsiTimer_t *pTimer) |
| Stops a created timer. More... | |
| OsiTime_t | osi_TimerGetRemainingTime (OsiTimer_t *pTimer) |
| Get the remaining time for a timer to expire. More... | |
| OsiReturnVal_e | osi_ThreadCreate (OsiThread_t *pThread, char *pThreadName, UINT32 StackSize, UINT32 Priority, P_THREAD_ENTRY_FUNCTION pEntryFunc, void *pParam) |
| Creates a thread in the OS. More... | |
| OsiReturnVal_e | osi_ThreadDelete (OsiThread_t *pThread) |
| Deletes a thread in the OS. More... | |
This porting file provides the adaptation layer for the OS.
| void assert | ( | uint32_t | condition | ) |
Assert function for the upper MAC library.
| Condition | if TRUE, assert will occur |
| void* os_calloc | ( | size_t | nmemb, |
| size_t | size | ||
| ) |
Allocate and zero memory blocks.
| nmemb | number of blocks to allocate |
| size | size of each block in bytes |
| void os_free | ( | void * | ptr | ) |
Free memory.
| ptr | - pointer to release |
| void* os_malloc | ( | size_t | size | ) |
Allocate dynamic memory.
| size |
| void* os_realloc | ( | void * | ptr, |
| size_t | newsize | ||
| ) |
Re-allocate dynamic memory.
| ptr | Old buffer from os_malloc() or os_realloc() |
| newsize | of the new buffer |
| void* os_realloc_array | ( | void * | ptr, |
| size_t | nmemb, | ||
| size_t | size | ||
| ) |
Re-Allocate and zero memory blocks.
| ptr | to old array |
| nmemb | number of blocks to allocate |
| size | size of each block in bytes |
| void* os_zalloc | ( | size_t | size | ) |
Allocate and zero memory.
| size | - in bytes |
| UINT32 osi_EnterCritical | ( | void | ) |
This function used to enter into critical section.
| void |
| UINT32 osi_ExitCritical | ( | uint32_t | ulKey | ) |
This function used to exit critical section.
| void |
| UINT32 osi_GetTimeMS | ( | ) |
Get free running time in mili seconds.
| OsiReturnVal_e osi_LockObjCreate | ( | OsiLockObj_t * | pLockObj | ) |
This function creates a locking object.
The locking object is used for protecting a shared resources between different threads.
| pLockObj | - pointer to the locking object control block |
| OsiReturnVal_e osi_LockObjDelete | ( | OsiLockObj_t * | pLockObj | ) |
This function deletes a locking object.
| pLockObj | - pointer to the locking object control block |
| OsiReturnVal_e osi_LockObjLock | ( | OsiLockObj_t * | pLockObj, |
| OsiTime_t | Timeout | ||
| ) |
This function locks a locking object.
All other threads that call this function before this thread calls the osi_LockObjUnlock would be suspended
| pLockObj | - pointer to the locking object control block |
| Timeout | - numeric value specifies the maximum number of mSec to stay suspended while waiting for the locking object Currently, the simple link driver uses only two values:
|
| OsiReturnVal_e osi_LockObjUnlock | ( | OsiLockObj_t * | pLockObj | ) |
This function unlock a locking object.
| pLockObj | - pointer to the locking object control block |
| UINT32 osi_MsgQCount | ( | OsiMsgQ_t * | pMsgQ | ) |
This function returns the number of messages ready in the Queue.
| pMsgQ | - pointer to the message queue |
| OsiReturnVal_e osi_MsgQCreate | ( | OsiMsgQ_t * | pMsgQ, |
| char * | pMsgQName, | ||
| UINT32 | MsgSize, | ||
| UINT32 | MaxMsgs | ||
| ) |
This function is used to create the MsgQ.
| pMsgQ | - pointer to the message queue |
| pMsgQName | - msg queue name |
| MsgSize | - size of message on the queue |
| MaxMsgs | - max. number of msgs that the queue can hold |
| OsiReturnVal_e osi_MsgQDelete | ( | OsiMsgQ_t * | pMsgQ | ) |
This function is used to delete the MsgQ.
| pMsgQ | - pointer to the message queue |
| BOOLEAN osi_MsgQIsEmpty | ( | OsiMsgQ_t * | pMsgQ | ) |
This function returns whether there are any messages ready in the Queue.
| pMsgQ | - pointer to the message queue |
| OsiReturnVal_e osi_MsgQRead | ( | OsiMsgQ_t * | pMsgQ, |
| void * | pMsg, | ||
| OsiTime_t | Timeout | ||
| ) |
This function is used to read data from the MsgQ.
| pMsgQ | - pointer to the message queue |
| pMsg | - pointer to the Msg strut to read into |
| Timeout | - timeout to wait for the Msg to be available |
| OsiReturnVal_e osi_MsgQWrite | ( | OsiMsgQ_t * | pMsgQ, |
| void * | pMsg, | ||
| OsiTime_t | Timeout | ||
| ) |
This function is used to write data to the MsgQ.
| pMsgQ | - pointer to the message queue |
| pMsg | - pointer to the Msg strut to read into |
| Timeout | - timeout to wait for the Msg to be available |
| OsiReturnVal_e osi_Sleep | ( | OsiTime_t | sec | ) |
Put the thread to sleep.
| sec |
| OsiReturnVal_e osi_SyncObjClear | ( | OsiSyncObj_t * | pSyncObj | ) |
This function clears a sync object.
| pSyncObj | - pointer to the sync object control block |
| OsiReturnVal_e osi_SyncObjCreate | ( | OsiSyncObj_t * | pSyncObj | ) |
This function creates a sync object.
The sync object is used for synchronization between different thread or ISR and a thread.
| pSyncObj | - pointer to the sync object control block |
| OsiReturnVal_e osi_SyncObjDelete | ( | OsiSyncObj_t * | pSyncObj | ) |
This function deletes a sync object.
| pSyncObj | - pointer to the sync object control block |
| OsiReturnVal_e osi_SyncObjSignal | ( | OsiSyncObj_t * | pSyncObj | ) |
This function generates a sync signal for the object.
All suspended threads waiting on this sync object are resumed
| pSyncObj | - pointer to the sync object control block |
| OsiReturnVal_e osi_SyncObjSignalFromISR | ( | OsiSyncObj_t * | pSyncObj | ) |
This function generates a sync signal for the object from ISR context.
All suspended threads waiting on this sync object are resumed
| pSyncObj | - pointer to the sync object control block |
| OsiReturnVal_e osi_SyncObjWait | ( | OsiSyncObj_t * | pSyncObj, |
| OsiTime_t | Timeout | ||
| ) |
This function waits for a sync signal of the specific sync object.
| pSyncObj | - pointer to the sync object control block |
| Timeout | - numeric value specifies the maximum number of mSec to stay suspended while waiting for the sync signal Currently, the simple link driver uses only two values:
|
| OsiReturnVal_e osi_TaskCreate | ( | P_OSI_TASK_ENTRY | pEntry, |
| const signed char *const | pcName, | ||
| unsigned short | usStackDepth, | ||
| void * | pvParameters, | ||
| unsigned long | uxPriority, | ||
| OsiTaskHandle * | pTaskHandle | ||
| ) |
This function creates a Task.
Creates a new Task and add it to the last of tasks that are ready to run
| pEntry | - pointer to the Task Function |
| pcName | - Task Name String |
| usStackDepth | - Stack Size in bytes |
| pvParameters | - pointer to structure to be passed to the Task Function |
| uxPriority | - Task Priority - 0 is lowest (IDLE) and (configMAX_PRIORITIES - 1) max |
| pTaskHandle | - output ptr filled with taskHandler |
| void osi_TaskDelete | ( | OsiTaskHandle * | pTaskHandle | ) |
This function Deletes a Task.
Deletes a Task and remove it from list of running task
| pTaskHandle | - Task Handle |
| OsiReturnVal_e osi_ThreadCreate | ( | OsiThread_t * | pThread, |
| char * | pThreadName, | ||
| UINT32 | StackSize, | ||
| UINT32 | Priority, | ||
| P_THREAD_ENTRY_FUNCTION | pEntryFunc, | ||
| void * | pParam | ||
| ) |
Creates a thread in the OS.
| pThread | - return handler for the created thread |
| pThreadName | - thread name |
| StackSize | - stack size to be dynamically allocated inside the create function |
| Priority | - priority - 0 is lowest (IDLE) and (configMAX_PRIORITIES - 1) max |
| pEntryFunc | - thread entry function |
| pParam | - parameters to move to the thread entry function |
| OsiReturnVal_e osi_ThreadDelete | ( | OsiThread_t * | pThread | ) |
Deletes a thread in the OS.
| pThread | - return handler for the created thread |
| OsiReturnVal_e osi_TimerCreate | ( | OsiTimer_t * | pTimer, |
| char * | pTimerName, | ||
| P_TIMER_EXPIRY_LEGACY_FUNCTION | pExpiryFunc, | ||
| void * | pParam | ||
| ) |
Creates a timer in the OS.
| pTimer | - timer object preallocated allocated |
| pTimerName | - timer name |
| pExpiryFunc | - expiry callback function |
| pParam | - expiry callback parameters |
| OsiReturnVal_e osi_TimerDelete | ( | OsiTimer_t * | pTimer | ) |
Deletes a timer in the OS.
| pTimer | - timer object |
| OsiTime_t osi_TimerGetRemainingTime | ( | OsiTimer_t * | pTimer | ) |
Get the remaining time for a timer to expire.
| pTimer | - timer object |
| OsiReturnVal_e osi_TimerStart | ( | OsiTimer_t * | pTimer, |
| OsiTime_t | DurationMiliSec, | ||
| BOOLEAN | Periodic | ||
| ) |
Start a created timer.
| pTimer | - timer object |
| DurationMiliSec | |
| Periodic | - is this timer periodic |
| OsiReturnVal_e osi_TimerStop | ( | OsiTimer_t * | pTimer | ) |
Stops a created timer.
| pTimer | - timer object |
| OsiReturnVal_e osi_uSleep | ( | OsiTime_t | usec | ) |
Put the thread to sleep in micro seconds.
| usec | - time in micro seconds |
1.8.12