XDK API  3.6.0
Documentation
Macros | Functions | Variables
osi_freertos.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
#include "semphr.h"
#include "portmacro.h"
#include <osi.h>
+ Include dependency graph for osi_freertos.c:

Macros

#define slQUEUE_SIZE   ( 3 )
 

Functions

void mem_copy (void *pDst, void *pSrc, size_t Size)
 This function call the memcopy function. More...
 
void mem_Free (void *pMem)
 This function to call the memory de-allocation function of the FREERTOS. More...
 
void * mem_Malloc (unsigned long Size)
 This function to call the memory de-allocation function of the FREERTOS. More...
 
void mem_set (void *pBuf, int Val, size_t Size)
 This function call the memset function. More...
 
void osi_ContextRestore ()
 This function used to restore the OS context after sleep. More...
 
void osi_ContextSave ()
 This function used to save the OS context before sleep. More...
 
unsigned long osi_EnterCritical (void)
 This function use to entering into critical section. More...
 
void osi_ExitCritical (unsigned long ulKey)
 This function use to exit critical section. 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, unsigned long MsgSize, unsigned long 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_MsgQRead (OsiMsgQ_t *pMsgQ, void *pMsg, OsiTime_t Timeout)
 This function is used to read data from 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...
 
void osi_Sleep (unsigned int MilliSecs)
 This function used to suspend the task for the specified number of milli secs. More...
 
OsiReturnVal_e osi_Spawn (P_OSI_SPAWN_ENTRY pEntry, void *pValue, unsigned long flags)
 This function call the pEntry callback from a different context. More...
 
void osi_start ()
 This function used to start the scheduler. More...
 
OsiReturnVal_e osi_SyncObjClear (OsiSyncObj_t *pSyncObj)
 This function clears a sync object. 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_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...
 
unsigned long osi_TaskDisable (void)
 This function used to disable the tasks. More...
 
void osi_TaskEnable (unsigned long key)
 This function used to resume all the tasks. More...
 
void VDeleteSimpleLinkSpawnTask (void)
 This is the API to delete SL spawn task and delete the SL queue. More...
 
static void vSimpleLinkSpawnTask (void *pvParameters)
 This is the simplelink spawn task to call SL callback from a different context. More...
 
OsiReturnVal_e VStartSimpleLinkSpawnTask (unsigned portBASE_TYPE uxPriority)
 This is the API to create SL spawn task and create the SL queue. More...
 

Variables

portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE
 
QueueHandle_t xSimpleLinkSpawnQueue = NULL
 
TaskHandle_t xSimpleLinkSpawnTaskHndl = NULL
 

Macro Definition Documentation

#define slQUEUE_SIZE   ( 3 )

Function Documentation

void mem_copy ( void *  pDst,
void *  pSrc,
size_t  Size 
)

Copy Memory.

Parameters
pDst- pointer to the destination
pSrc- pointer to the source
Size- Size of the memory which needs to be copy
Returns
- void
Note
Warning
void mem_Free ( void *  pMem)

Deallocates Memory.

Parameters
pMem- pointer to the memory which needs to be freed
Returns
- void
Note
Warning

+ Here is the call graph for this function:

void* mem_Malloc ( unsigned long  Size)

Allocates Memory on Heap.

Parameters
Size- size of memory to alloc in bytes
Returns
- void *
Note
Warning

+ Here is the call graph for this function:

void mem_set ( void *  pBuf,
int  Val,
size_t  Size 
)

Set Memory.

Parameters
pBuf- pointer to the memory to be fill
Val- Value to be fill
Size- Size of the memory which needs to be fill
Returns
- void
Note
Warning
void osi_ContextRestore ( )

This function used to retrieve the context after sleep.

Parameters
void
Returns
- void
Note
Warning
void osi_ContextSave ( )

This function used to save the os context before sleep.

Parameters
void
Returns
- void
Note
Warning
unsigned long osi_EnterCritical ( void  )

Enter Critical Section.

Parameters
void
Returns
- void
Note
Warning
void osi_ExitCritical ( unsigned long  ulKey)

Exit Critical Section.

Parameters
void
Returns
- void
Note
Warning
OsiReturnVal_e osi_LockObjCreate ( OsiLockObj_t pLockObj)

The locking object is used for protecting a shared resources between different threads.

Parameters
pLockObj- pointer to the locking object control block
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
OsiReturnVal_e osi_LockObjDelete ( OsiLockObj_t pLockObj)
Parameters
pLockObj- pointer to the locking object control block
Returns
upon successful deletion the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
OsiReturnVal_e osi_LockObjLock ( OsiLockObj_t pLockObj,
OsiTime_t  Timeout 
)

All other threads that call this function before this thread calls the osi_LockObjUnlock would be suspended

Parameters
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:
  • OSI_WAIT_FOREVER
  • OSI_NO_WAIT
Returns
upon successful reception of the locking object the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
OsiReturnVal_e osi_LockObjUnlock ( OsiLockObj_t pLockObj)
Parameters
pLockObj- pointer to the locking object control block
Returns
upon successful unlocking the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
OsiReturnVal_e osi_MsgQCreate ( OsiMsgQ_t pMsgQ,
char *  pMsgQName,
unsigned long  MsgSize,
unsigned long  MaxMsgs 
)
Parameters
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
Returns
- OsiReturnVal_e
Note
Warning
OsiReturnVal_e osi_MsgQDelete ( OsiMsgQ_t pMsgQ)
Parameters
pMsgQ- pointer to the message queue
Returns
- OsiReturnVal_e
Note
Warning

+ Here is the call graph for this function:

OsiReturnVal_e osi_MsgQRead ( OsiMsgQ_t pMsgQ,
void *  pMsg,
OsiTime_t  Timeout 
)
Parameters
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
Returns
- OsiReturnVal_e
Note
Warning

+ Here is the call graph for this function:

OsiReturnVal_e osi_MsgQWrite ( OsiMsgQ_t pMsgQ,
void *  pMsg,
OsiTime_t  Timeout 
)
Parameters
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
Returns
- OsiReturnVal_e
Note
Warning
void osi_Sleep ( unsigned int  MilliSecs)
Parameters
MilliSecs- Time in millisecs to suspend the task
Returns
- void
Note
Warning

+ Here is the call graph for this function:

OsiReturnVal_e osi_Spawn ( P_OSI_SPAWN_ENTRY  pEntry,
void *  pValue,
unsigned long  flags 
)
Parameters
pEntry- pointer to the entry callback function
pValue- pointer to any type of memory structure that would be passed to pEntry callback from the execution thread.
flags- execution flags - reserved for future usage
Returns
upon successful registration of the spawn the function should return 0 (the function is not blocked till the end of the execution of the function and could be returned before the execution is actually completed) Otherwise, a negative value indicating the error code shall be returned
Note
Warning
void osi_start ( )

This function starts the OS Scheduler.

Parameters
void
Returns
- void
Note
Warning

+ Here is the call graph for this function:

OsiReturnVal_e osi_SyncObjClear ( OsiSyncObj_t pSyncObj)
Parameters
pSyncObj- pointer to the sync object control block
Returns
upon successful clearing the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning

+ Here is the call graph for this function:

OsiReturnVal_e osi_SyncObjCreate ( OsiSyncObj_t pSyncObj)

The sync object is used for synchronization between different thread or ISR and a thread.

Parameters
pSyncObj- pointer to the sync object control block
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
OsiReturnVal_e osi_SyncObjDelete ( OsiSyncObj_t pSyncObj)
Parameters
pSyncObj- pointer to the sync object control block
Returns
upon successful deletion the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
OsiReturnVal_e osi_SyncObjSignal ( OsiSyncObj_t pSyncObj)

All suspended threads waiting on this sync object are resumed

Parameters
pSyncObj- pointer to the sync object control block
Returns
upon successful signaling the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
the function could be called from ISR context
Warning
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

Parameters
pSyncObj- pointer to the sync object control block
Returns
upon successful signalling the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
the function is called from ISR context
Warning
OsiReturnVal_e osi_SyncObjWait ( OsiSyncObj_t pSyncObj,
OsiTime_t  Timeout 
)
Parameters
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:
  • OSI_WAIT_FOREVER
  • OSI_NO_WAIT
Returns
upon successful reception of the signal within the timeout window return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning

+ Here is the caller graph for this function:

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 call the pEntry callback from a different context.

Creates a new Task and add it to the last of tasks that are ready to run

Parameters
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
Returns
upon successful creation the function should return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning

+ Here is the caller graph for this function:

void osi_TaskDelete ( OsiTaskHandle pTaskHandle)

Deletes a Task and remove it from list of running task

Parameters
pTaskHandle- Task Handle
Note
Warning

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned long osi_TaskDisable ( void  )
Parameters
-void
Returns
- Key with the suspended tasks
Note
Warning

+ Here is the call graph for this function:

void osi_TaskEnable ( unsigned long  key)

This function used to enable all tasks.

Parameters
key- returned from suspend tasks
Returns
- void
Note
Warning

+ Here is the call graph for this function:

void VDeleteSimpleLinkSpawnTask ( void  )
Parameters
none
Returns
void
Note
Warning

+ Here is the call graph for this function:

void vSimpleLinkSpawnTask ( void *  pvParameters)
static
Parameters
pvParameters- pointer to the task parameter
Returns
void
Note
Warning

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

OsiReturnVal_e VStartSimpleLinkSpawnTask ( unsigned portBASE_TYPE  uxPriority)
Parameters
uxPriority- task priority
Returns
void
Note
Warning

+ Here is the call graph for this function:

Variable Documentation

portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE
QueueHandle_t xSimpleLinkSpawnQueue = NULL
TaskHandle_t xSimpleLinkSpawnTaskHndl = NULL

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:47 by doxygen 1.8.8