XDK API  3.6.0
Documentation
Data Structures | Macros | Typedefs | Functions
nonos.h File Reference
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  _SlNonOsCB_t
 
struct  _SlNonOsSpawnEntry_t
 

Macros

#define __NON_OS_LOCK_OBJ_LOCK_VALUE   0x44
 
#define __NON_OS_LOCK_OBJ_UNLOCK_VALUE   0x33
 
#define __NON_OS_SYNC_OBJ_CLEAR_VALUE   0x11
 
#define __NON_OS_SYNC_OBJ_SIGNAL_VALUE   0x22
 
#define _SlLockObj_t   _SlNonOsSemObj_t
 
#define _SlNonOsLockObjCreate(pLockObj)   _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
 This function creates a locking object. More...
 
#define _SlNonOsLockObjDelete(pLockObj)   _SlNonOsSemSet(pLockObj,0)
 This function deletes a locking object. More...
 
#define _SlNonOsLockObjLock(pLockObj, Timeout)   _SlNonOsSemGet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE,__NON_OS_LOCK_OBJ_LOCK_VALUE,Timeout)
 This function locks a locking object. More...
 
#define _SlNonOsLockObjUnlock(pLockObj)   _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
 This function unlock a locking object. More...
 
#define _SlNonOsSyncObjClear(pSyncObj)   _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_CLEAR_VALUE)
 This function clears a sync object. More...
 
#define _SlNonOsSyncObjCreate(pSyncObj)   _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_CLEAR_VALUE)
 This function creates a sync object. More...
 
#define _SlNonOsSyncObjDelete(pSyncObj)   _SlNonOsSemSet(pSyncObj,0)
 This function deletes a sync object. More...
 
#define _SlNonOsSyncObjSignal(pSyncObj)   _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE)
 This function generates a sync signal for the object. More...
 
#define _SlNonOsSyncObjWait(pSyncObj, Timeout)   _SlNonOsSemGet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE,__NON_OS_SYNC_OBJ_CLEAR_VALUE,Timeout)
 This function waits for a sync signal of the specific sync object. More...
 
#define _SlSyncObj_t   _SlNonOsSemObj_t
 
#define _SlTaskEntry   _SlNonOsMainLoopTask
 
#define _SlTime_t   _SlNonOsTime_t
 
#define NONOS_MAX_SPAWN_ENTRIES   5
 
#define NONOS_NO_WAIT   (0x00000000)
 
#define NONOS_RET_ERR   (0xFF)
 
#define NONOS_RET_OK   (0)
 
#define NONOS_WAIT_FOREVER   (0xFFFFFFFF)
 
#define OSI_OK   NONOS_RET_OK
 
#define sl_LockObjCreate(pLockObj, pName)   _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
 
#define sl_LockObjDelete(pLockObj)   _SlNonOsSemSet(pLockObj,0)
 
#define sl_LockObjLock(pLockObj, Timeout)   _SlNonOsSemGet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE,__NON_OS_LOCK_OBJ_LOCK_VALUE,Timeout)
 
#define sl_LockObjUnlock(pLockObj)   _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
 
#define SL_OS_NO_WAIT   NONOS_NO_WAIT
 
#define SL_OS_RET_CODE_OK   NONOS_RET_OK
 
#define SL_OS_WAIT_FOREVER   NONOS_WAIT_FOREVER
 
#define sl_Spawn(pEntry, pValue, flags)   _SlNonOsSpawn(pEntry,pValue,flags)
 
#define sl_SyncObjCreate(pSyncObj, pName)   _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_CLEAR_VALUE)
 
#define sl_SyncObjDelete(pSyncObj)   _SlNonOsSemSet(pSyncObj,0)
 
#define sl_SyncObjSignal(pSyncObj)   _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE)
 
#define sl_SyncObjSignalFromIRQ(pSyncObj)   _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE)
 
#define sl_SyncObjWait(pSyncObj, Timeout)   _SlNonOsSemGet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE,__NON_OS_SYNC_OBJ_CLEAR_VALUE,Timeout)
 

Typedefs

typedef _i8 _SlNonOsRetVal_t
 type definition for the return values of this adaptation layer More...
 
typedef _u8 _SlNonOsSemObj_t
 type definition for a sync object container More...
 
typedef _u32 _SlNonOsTime_t
 type definition for a time value More...
 

Functions

_SlNonOsRetVal_t _SlNonOsMainLoopTask (void)
 This function must be called from the main loop in non-os paltforms. More...
 
_SlNonOsRetVal_t _SlNonOsSemGet (_SlNonOsSemObj_t *pSyncObj, _SlNonOsSemObj_t WaitValue, _SlNonOsSemObj_t SetValue, _SlNonOsTime_t Timeout)
 
_SlNonOsRetVal_t _SlNonOsSemSet (_SlNonOsSemObj_t *pSemObj, _SlNonOsSemObj_t Value)
 
_SlNonOsRetVal_t _SlNonOsSpawn (_SlSpawnEntryFunc_t pEntry, void *pValue, _u32 flags)
 This function call the pEntry callback from a different context. More...
 

Macro Definition Documentation

#define __NON_OS_LOCK_OBJ_LOCK_VALUE   0x44
#define __NON_OS_LOCK_OBJ_UNLOCK_VALUE   0x33
#define __NON_OS_SYNC_OBJ_CLEAR_VALUE   0x11
#define __NON_OS_SYNC_OBJ_SIGNAL_VALUE   0x22
#define _SlLockObj_t   _SlNonOsSemObj_t
#define _SlNonOsLockObjCreate (   pLockObj)    _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)

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
#define _SlNonOsLockObjDelete (   pLockObj)    _SlNonOsSemSet(pLockObj,0)
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
#define _SlNonOsLockObjLock (   pLockObj,
  Timeout 
)    _SlNonOsSemGet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE,__NON_OS_LOCK_OBJ_LOCK_VALUE,Timeout)

All other threads that call this function before this thread calls the _SlNonOsLockObjUnlock 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:
  • NONOS_WAIT_FOREVER
  • NONOS_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
#define _SlNonOsLockObjUnlock (   pLockObj)    _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
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
#define _SlNonOsSyncObjClear (   pSyncObj)    _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_CLEAR_VALUE)
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
#define _SlNonOsSyncObjCreate (   pSyncObj)    _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_CLEAR_VALUE)

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 return 0 Otherwise, a negative value indicating the error code shall be returned
Note
Warning
#define _SlNonOsSyncObjDelete (   pSyncObj)    _SlNonOsSemSet(pSyncObj,0)
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
#define _SlNonOsSyncObjSignal (   pSyncObj)    _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE)

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
#define _SlNonOsSyncObjWait (   pSyncObj,
  Timeout 
)    _SlNonOsSemGet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE,__NON_OS_SYNC_OBJ_CLEAR_VALUE,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:
  • NONOS_WAIT_FOREVER
  • NONOS_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
#define _SlSyncObj_t   _SlNonOsSemObj_t
#define _SlTaskEntry   _SlNonOsMainLoopTask
#define _SlTime_t   _SlNonOsTime_t
#define NONOS_MAX_SPAWN_ENTRIES   5
#define NONOS_NO_WAIT   (0x00000000)
#define NONOS_RET_ERR   (0xFF)
#define NONOS_RET_OK   (0)
#define NONOS_WAIT_FOREVER   (0xFFFFFFFF)
#define OSI_OK   NONOS_RET_OK
#define sl_LockObjCreate (   pLockObj,
  pName 
)    _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
#define sl_LockObjDelete (   pLockObj)    _SlNonOsSemSet(pLockObj,0)
#define sl_LockObjLock (   pLockObj,
  Timeout 
)    _SlNonOsSemGet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE,__NON_OS_LOCK_OBJ_LOCK_VALUE,Timeout)
#define sl_LockObjUnlock (   pLockObj)    _SlNonOsSemSet(pLockObj,__NON_OS_LOCK_OBJ_UNLOCK_VALUE)
#define SL_OS_NO_WAIT   NONOS_NO_WAIT
#define SL_OS_RET_CODE_OK   NONOS_RET_OK
#define SL_OS_WAIT_FOREVER   NONOS_WAIT_FOREVER
#define sl_Spawn (   pEntry,
  pValue,
  flags 
)    _SlNonOsSpawn(pEntry,pValue,flags)
#define sl_SyncObjCreate (   pSyncObj,
  pName 
)    _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_CLEAR_VALUE)
#define sl_SyncObjDelete (   pSyncObj)    _SlNonOsSemSet(pSyncObj,0)
#define sl_SyncObjSignal (   pSyncObj)    _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE)
#define sl_SyncObjSignalFromIRQ (   pSyncObj)    _SlNonOsSemSet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE)
#define sl_SyncObjWait (   pSyncObj,
  Timeout 
)    _SlNonOsSemGet(pSyncObj,__NON_OS_SYNC_OBJ_SIGNAL_VALUE,__NON_OS_SYNC_OBJ_CLEAR_VALUE,Timeout)

Typedef Documentation

Sync object is object used to synchronize between two threads or thread and interrupt handler. One thread is waiting on the object and the other thread send a signal, which then release the waiting thread. The signal must be able to be sent from interrupt context. This object is generally implemented by binary semaphore or events.

Function Documentation

_SlNonOsRetVal_t _SlNonOsMainLoopTask ( void  )
Parameters
None
Returns
0 - No more activities 1 - Activity still in progress
Note
Warning

+ Here is the caller graph for this function:

_SlNonOsRetVal_t _SlNonOsSemGet ( _SlNonOsSemObj_t pSyncObj,
_SlNonOsSemObj_t  WaitValue,
_SlNonOsSemObj_t  SetValue,
_SlNonOsTime_t  Timeout 
)

+ Here is the call graph for this function:

_SlNonOsRetVal_t _SlNonOsSemSet ( _SlNonOsSemObj_t pSemObj,
_SlNonOsSemObj_t  Value 
)
_SlNonOsRetVal_t _SlNonOsSpawn ( _SlSpawnEntryFunc_t  pEntry,
void *  pValue,
_u32  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 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

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