Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Baremetal OS abstraction for RTOS integration

OS abstraction functions - in baremetal (no rtos) these are just stubs! More...

Collaboration diagram for Baremetal OS abstraction for RTOS integration:

Macros

#define CA_OS_LOCKED(x)
 Shorthand to perform an action with the API Lock taken. More...
 

Typedefs

typedef void * ca_mutex
 Generic mutex type. More...
 

Functions

void CA_OS_Init (void)
 Initialise the CA_OS subsystem. More...
 
void CA_OS_Yield (void)
 Yield the CPU to a different task. More...
 
ca_mutex CA_OS_MutexInit (void)
 Initialise a mutex for inter-thread control in an OS-independent manner. More...
 
void CA_OS_MutexLock (ca_mutex *aMutex)
 Claim a mutex, blocking until it is taken Mutex must be initialised with CA_OS_MutexInit Counterpart is CA_OS_MutexUnlock. More...
 
void CA_OS_MutexUnlock (ca_mutex *aMutex)
 Unlock a claimed mutex Counterpart is CA_OS_MutexLock. More...
 
void CA_OS_SchedulerSuspend (void)
 Suspend the scheduler so that it will not pre-emptively context switch to another task. More...
 
void CA_OS_SchedulerResume (void)
 Resume the scheduler so pre-emption begins again. More...
 
void CA_OS_LockAPI (void)
 Lock the Cascoda API thread, for safely calling Cascoda API functions. More...
 
void CA_OS_UnlockAPI (void)
 Release the Cascoda API lock. More...
 

Detailed Description

OS abstraction functions - in baremetal (no rtos) these are just stubs!

Macro Definition Documentation

◆ CA_OS_LOCKED

#define CA_OS_LOCKED (   x)
Value:
do \
{ \
CA_OS_LockAPI(); \
x; \
CA_OS_UnlockAPI(); \
} while (0)

Shorthand to perform an action with the API Lock taken.

Typedef Documentation

◆ ca_mutex

typedef void* ca_mutex

Generic mutex type.

Function Documentation

◆ CA_OS_Init()

void CA_OS_Init ( void  )

Initialise the CA_OS subsystem.

This should be called before the scheduler is started. In non-OS applications it is called by EVBME_Initialise.

◆ CA_OS_LockAPI()

void CA_OS_LockAPI ( void  )

Lock the Cascoda API thread, for safely calling Cascoda API functions.

Implemented with a counter, so can be called multiple times as long as CA_OS_UnlockAPI is called the same number of times. Counterpart is CA_OS_UnlockAPI

◆ CA_OS_MutexInit()

ca_mutex CA_OS_MutexInit ( void  )

Initialise a mutex for inter-thread control in an OS-independent manner.

Non-recursive mutex.

Returns
An initialised mutex (Or null if no memory)

◆ CA_OS_MutexLock()

void CA_OS_MutexLock ( ca_mutex aMutex)

Claim a mutex, blocking until it is taken Mutex must be initialised with CA_OS_MutexInit Counterpart is CA_OS_MutexUnlock.

Parameters
aMutexThe mutex to lock

◆ CA_OS_MutexUnlock()

void CA_OS_MutexUnlock ( ca_mutex aMutex)

Unlock a claimed mutex Counterpart is CA_OS_MutexLock.

Parameters
aMutexthe mutex to unlock

◆ CA_OS_SchedulerResume()

void CA_OS_SchedulerResume ( void  )

Resume the scheduler so pre-emption begins again.

Counterpart is CA_OS_SchedulerSuspend.

◆ CA_OS_SchedulerSuspend()

void CA_OS_SchedulerSuspend ( void  )

Suspend the scheduler so that it will not pre-emptively context switch to another task.

Useful for system initialisation such as initialising a mutex. Implemented with a counter, so can be called multiple times as long as CA_OS_SchedulerResume is called the same number of times. Counterpart is CA_OS_SchedulerResume.

◆ CA_OS_UnlockAPI()

void CA_OS_UnlockAPI ( void  )

Release the Cascoda API lock.

Counterpart is CA_OS_LockAPI

◆ CA_OS_Yield()

void CA_OS_Yield ( void  )

Yield the CPU to a different task.