1.4.4 Library Interface

OSAL library provides the following interfaces:

Functions

NameDescription
OSAL_SEM_CreateCreates an OSAL Semaphore
OSAL_SEM_DeleteDeletes an OSAL Semaphore
OSAL_SEM_PendWaits on a semaphore. Returns true if the semaphore was obtained within the time limit
OSAL_SEM_PostPosts a semaphore or increments a counting semaphore
OSAL_SEM_PostISRPosts a semaphore or increments a counting semaphore from within an Interrupt Service Routine (ISR)
OSAL_SEM_GetCountReturns the current value of a counting semaphore
OSAL_CRIT_EnterEnters a critical section with the specified severity level
OSAL_CRIT_LeaveLeaves a critical section with the specified severity level
OSAL_MUTEX_CreateCreates a mutex
OSAL_MUTEX_DeleteDeletes a mutex
OSAL_MUTEX_LockLocks a mutex
OSAL_MUTEX_UnlockUnlocks a mutex
OSAL_MallocAllocates memory using the OSAL default allocator
OSAL_FreeDeallocates a block of memory and return to the default pool
OSAL_InitializePerforms OSAL initialization
OSAL_NameObtains the name of the underlying RTOS

Data types and constants

NameTypeDescription
OSAL_SEM_TYPEEnumEnumerated type representing the possible types of semaphore
OSAL_CRIT_TYPEEnumEnumerated type representing the possible types of critical section
OSAL_RESULTEnumEnumerated type representing the general return value from OSAL functions
OSAL_SEM_DECLAREMacroDeclares an OSAL semaphore
OSAL_MUTEX_DECLAREMacroDeclares an OSAL mutex