52#define __NO_RETURN __declspec(noreturn)
53#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
54#define __NO_RETURN __attribute__((__noreturn__))
55#elif defined(__GNUC__)
56#define __NO_RETURN __attribute__((__noreturn__))
57#elif defined(__ICCARM__)
58#define __NO_RETURN __noreturn
173#define osWaitForever 0xFFFFFFFFU
176#define osFlagsWaitAny 0x00000000U
177#define osFlagsWaitAll 0x00000001U
178#define osFlagsNoClear 0x00000002U
181#define osFlagsError 0x80000000U
182#define osFlagsErrorUnknown 0xFFFFFFFFU
183#define osFlagsErrorTimeout 0xFFFFFFFEU
184#define osFlagsErrorResource 0xFFFFFFFDU
185#define osFlagsErrorParameter 0xFFFFFFFCU
186#define osFlagsErrorISR 0xFFFFFFFAU
189#define osThreadDetached 0x00000000U
190#define osThreadJoinable 0x00000001U
193#define osMutexRecursive 0x00000001U
194#define osMutexPrioInherit 0x00000002U
195#define osMutexRobust 0x00000008U
uint32_t osMemoryPoolGetSpace(osMemoryPoolId_t mp_id)
Get number of memory blocks available in a Memory Pool.
osKernelState_t
Kernel state.
@ osKernelSuspended
Suspended.
@ osKernelRunning
Running.
@ osKernelReserved
Prevents enum down-size compiler optimization.
@ osKernelInactive
Inactive.
osStatus_t osSemaphoreRelease(osSemaphoreId_t semaphore_id)
Release a Semaphore token up to the initial maximum count.
osPriority_t osThreadGetPriority(osThreadId_t thread_id)
Get current priority of a thread.
const char * osMutexGetName(osMutexId_t mutex_id)
Get name of a Mutex object.
void * osMessageQueueId_t
osMessageQueueId_t osMessageQueueNew(uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr)
Create and Initialize a Message Queue object.
osSemaphoreId_t osSemaphoreNew(uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr)
Create and Initialize a Semaphore object.
osStatus_t osThreadTerminate(osThreadId_t thread_id)
Terminate execution of a thread.
uint32_t osEventFlagsSet(osEventFlagsId_t ef_id, uint32_t flags)
Set the specified Event Flags.
osStatus_t osDelayUntil(uint32_t ticks)
Wait until specified time.
osStatus_t osThreadResume(osThreadId_t thread_id)
Resume execution of a thread.
osStatus_t osThreadJoin(osThreadId_t thread_id)
Wait for specified thread to terminate.
osKernelState_t osKernelGetState(void)
Get the current RTOS Kernel state.
osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr)
Create a thread and add it to Active Threads.
uint32_t osThreadGetCount(void)
Get number of active threads.
osMemoryPoolId_t osMemoryPoolNew(uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr)
Create and Initialize a Memory Pool object.
uint32_t osKernelGetSysTimerFreq(void)
Get the RTOS kernel system timer frequency.
uint32_t osEventFlagsWait(osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout)
Wait for one or more Event Flags to become signaled.
uint32_t osThreadEnumerate(osThreadId_t *thread_array, uint32_t array_items)
Enumerate active threads.
const char * osEventFlagsGetName(osEventFlagsId_t ef_id)
Get name of an Event Flags object.
uint32_t osThreadFlagsClear(uint32_t flags)
Clear the specified Thread Flags of current running thread.
uint32_t osTimerIsRunning(osTimerId_t timer_id)
Check if a timer is running.
uint32_t osMessageQueueGetCount(osMessageQueueId_t mq_id)
Get number of queued messages in a Message Queue.
osStatus_t
Status code values returned by CMSIS-RTOS functions.
@ osErrorISR
Not allowed in ISR context: the function cannot be called from interrupt service routines.
@ osStatusReserved
Prevents enum down-size compiler optimization.
@ osErrorResource
Resource not available.
@ osErrorTimeout
Operation not completed within the timeout period.
@ osOK
Operation completed successfully.
@ osError
Unspecified RTOS error: run-time error but no other error message fits.
@ osErrorParameter
Parameter error.
@ osErrorNoMemory
System is out of memory: it was impossible to allocate or reserve memory for the operation.
osStatus_t osKernelGetInfo(osVersion_t *version, char *id_buf, uint32_t id_size)
Get RTOS Kernel Information.
uint32_t osThreadFlagsSet(osThreadId_t thread_id, uint32_t flags)
Set the specified Thread Flags of a thread.
uint32_t osSemaphoreGetCount(osSemaphoreId_t semaphore_id)
Get current Semaphore token count.
void(* osTimerFunc_t)(void *argument)
Timer callback function.
const char * osTimerGetName(osTimerId_t timer_id)
Get name of a timer.
uint32_t osKernelGetTickFreq(void)
Get the RTOS kernel tick frequency.
osStatus_t osEventFlagsDelete(osEventFlagsId_t ef_id)
Delete an Event Flags object.
@ osTimerPeriodic
Repeating timer.
@ osTimerOnce
One-shot timer.
osStatus_t osSemaphoreAcquire(osSemaphoreId_t semaphore_id, uint32_t timeout)
Acquire a Semaphore token or timeout if no tokens are available.
osThreadId_t osMutexGetOwner(osMutexId_t mutex_id)
Get Thread which owns a Mutex object.
osStatus_t osSemaphoreDelete(osSemaphoreId_t semaphore_id)
Delete a Semaphore object.
uint32_t osKernelGetTickCount(void)
Get the RTOS kernel tick count.
uint32_t osThreadFlagsGet(void)
Get the current Thread Flags of current running thread.
osStatus_t osThreadSetPriority(osThreadId_t thread_id, osPriority_t priority)
Change priority of a thread.
uint32_t osEventFlagsGet(osEventFlagsId_t ef_id)
Get the current Event Flags.
osStatus_t osMemoryPoolDelete(osMemoryPoolId_t mp_id)
Delete a Memory Pool object.
void osKernelResume(uint32_t sleep_ticks)
Resume the RTOS Kernel scheduler.
osThreadId_t osThreadGetId(void)
Return the thread ID of the current running thread.
void * osMemoryPoolAlloc(osMemoryPoolId_t mp_id, uint32_t timeout)
Allocate a memory block from a Memory Pool.
void(* osThreadFunc_t)(void *argument)
Entry point of a thread.
uint32_t osEventFlagsClear(osEventFlagsId_t ef_id, uint32_t flags)
Clear the specified Event Flags.
int32_t osKernelLock(void)
Lock the RTOS Kernel scheduler.
const char * osSemaphoreGetName(osSemaphoreId_t semaphore_id)
Get name of a Semaphore object.
uint32_t osMemoryPoolGetCount(osMemoryPoolId_t mp_id)
Get number of memory blocks used in a Memory Pool.
uint32_t osMessageQueueGetMsgSize(osMessageQueueId_t mq_id)
Get maximum message size in a Message Queue.
osStatus_t osKernelStart(void)
Start the RTOS Kernel scheduler.
uint32_t osThreadGetStackSpace(osThreadId_t thread_id)
Get available stack space of a thread based on stack watermark recording during execution.
osStatus_t osMessageQueuePut(osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
Put a Message into a Queue or timeout if Queue is full.
osStatus_t osThreadSuspend(osThreadId_t thread_id)
Suspend execution of a thread.
osStatus_t osThreadDetach(osThreadId_t thread_id)
Detach a thread (thread storage can be reclaimed when thread terminates).
osEventFlagsId_t osEventFlagsNew(const osEventFlagsAttr_t *attr)
Create and Initialize an Event Flags object.
uint32_t osMemoryPoolGetBlockSize(osMemoryPoolId_t mp_id)
Get memory block size in a Memory Pool.
const char * osMemoryPoolGetName(osMemoryPoolId_t mp_id)
Get name of a Memory Pool object.
osStatus_t osTimerStart(osTimerId_t timer_id, uint32_t ticks)
Start or restart a timer.
osMutexId_t osMutexNew(const osMutexAttr_t *attr)
Create and Initialize a Mutex object.
uint32_t osThreadGetStackSize(osThreadId_t thread_id)
Get stack size of a thread.
osStatus_t osMessageQueueDelete(osMessageQueueId_t mq_id)
Delete a Message Queue object.
osStatus_t osMemoryPoolFree(osMemoryPoolId_t mp_id, void *block)
Return an allocated memory block back to a Memory Pool.
osStatus_t osMutexAcquire(osMutexId_t mutex_id, uint32_t timeout)
Acquire a Mutex or timeout if it is locked.
osStatus_t osTimerStop(osTimerId_t timer_id)
Stop a timer.
osStatus_t osMutexDelete(osMutexId_t mutex_id)
Delete a Mutex object.
uint32_t osThreadFlagsWait(uint32_t flags, uint32_t options, uint32_t timeout)
Wait for one or more Thread Flags of the current running thread to become signaled.
uint32_t osMessageQueueGetCapacity(osMessageQueueId_t mq_id)
Get maximum number of messages in a Message Queue.
const char * osThreadGetName(osThreadId_t thread_id)
Get name of a thread.
osStatus_t osMessageQueueReset(osMessageQueueId_t mq_id)
Reset a Message Queue to initial empty state.
osThreadState_t osThreadGetState(osThreadId_t thread_id)
Get current thread state of a thread.
osStatus_t osTimerDelete(osTimerId_t timer_id)
Delete a timer.
osStatus_t osThreadYield(void)
Pass control to next thread that is in state READY.
osThreadState_t
Thread state.
@ osThreadBlocked
Blocked.
@ osThreadRunning
Running.
@ osThreadInactive
Inactive.
@ osThreadReserved
Prevents enum down-size compiler optimization.
@ osThreadTerminated
Terminated.
osPriority_t
Priority values.
@ osPriorityNormal7
Priority: normal + 7.
@ osPriorityHigh3
Priority: high + 3.
@ osPriorityBelowNormal5
Priority: below normal + 5.
@ osPriorityRealtime
Priority: realtime.
@ osPriorityAboveNormal
Priority: above normal.
@ osPriorityHigh1
Priority: high + 1.
@ osPriorityBelowNormal
Priority: below normal.
@ osPriorityBelowNormal3
Priority: below normal + 3.
@ osPriorityNormal2
Priority: normal + 2.
@ osPriorityLow3
Priority: low + 3.
@ osPriorityBelowNormal4
Priority: below normal + 4.
@ osPriorityISR
Reserved for ISR deferred thread.
@ osPriorityNormal1
Priority: normal + 1.
@ osPriorityRealtime3
Priority: realtime + 3.
@ osPriorityNormal3
Priority: normal + 3.
@ osPriorityHigh2
Priority: high + 2.
@ osPriorityNormal
Priority: normal.
@ osPriorityBelowNormal2
Priority: below normal + 2.
@ osPriorityIdle
Reserved for Idle thread.
@ osPriorityHigh6
Priority: high + 6.
@ osPriorityHigh5
Priority: high + 5.
@ osPriorityLow4
Priority: low + 4.
@ osPriorityLow7
Priority: low + 7.
@ osPriorityLow
Priority: low.
@ osPriorityAboveNormal6
Priority: above normal + 6.
@ osPriorityHigh7
Priority: high + 7.
@ osPriorityNormal5
Priority: normal + 5.
@ osPriorityNone
No priority (not initialized).
@ osPriorityAboveNormal4
Priority: above normal + 4.
@ osPriorityLow2
Priority: low + 2.
@ osPriorityRealtime6
Priority: realtime + 6.
@ osPriorityNormal6
Priority: normal + 6.
@ osPriorityAboveNormal2
Priority: above normal + 2.
@ osPriorityBelowNormal1
Priority: below normal + 1.
@ osPriorityHigh
Priority: high.
@ osPriorityNormal4
Priority: normal + 4.
@ osPriorityRealtime7
Priority: realtime + 7.
@ osPriorityBelowNormal7
Priority: below normal + 7.
@ osPriorityRealtime2
Priority: realtime + 2.
@ osPriorityLow1
Priority: low + 1.
@ osPriorityBelowNormal6
Priority: below normal + 6.
@ osPriorityAboveNormal1
Priority: above normal + 1.
@ osPriorityLow6
Priority: low + 6.
@ osPriorityReserved
Prevents enum down-size compiler optimization.
@ osPriorityAboveNormal3
Priority: above normal + 3.
@ osPriorityLow5
Priority: low + 5.
@ osPriorityAboveNormal7
Priority: above normal + 7.
@ osPriorityError
System cannot determine priority or illegal priority.
@ osPriorityAboveNormal5
Priority: above normal + 5.
@ osPriorityRealtime4
Priority: realtime + 4.
@ osPriorityRealtime1
Priority: realtime + 1.
@ osPriorityHigh4
Priority: high + 4.
@ osPriorityRealtime5
Priority: realtime + 5.
osTimerId_t osTimerNew(osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
Create and Initialize a timer.
uint32_t osMemoryPoolGetCapacity(osMemoryPoolId_t mp_id)
Get maximum number of memory blocks in a Memory Pool.
osStatus_t osMessageQueueGet(osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
Get a Message from a Queue or timeout if Queue is empty.
__NO_RETURN void osThreadExit(void)
Terminate execution of current running thread.
uint32_t osMessageQueueGetSpace(osMessageQueueId_t mq_id)
Get number of available slots for messages in a Message Queue.
uint32_t osKernelGetSysTimerCount(void)
Get the RTOS kernel system timer count.
uint32_t osKernelSuspend(void)
Suspend the RTOS Kernel scheduler.
const char * osMessageQueueGetName(osMessageQueueId_t mq_id)
Get name of a Message Queue object.
int32_t osKernelRestoreLock(int32_t lock)
Restore the RTOS Kernel scheduler lock state.
osStatus_t osKernelInitialize(void)
Initialize the RTOS Kernel.
osStatus_t osMutexRelease(osMutexId_t mutex_id)
Release a Mutex that was acquired by osMutexAcquire.
int32_t osKernelUnlock(void)
Unlock the RTOS Kernel scheduler.
osStatus_t osDelay(uint32_t ticks)
Wait for Timeout (Time Delay).
Attributes structure for event flags.
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
const char * name
name of the event flags
void * cb_mem
memory for control block
Attributes structure for memory pool.
uint32_t mp_size
size of provided memory for data storage
const char * name
name of the memory pool
void * cb_mem
memory for control block
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
void * mp_mem
memory for data storage
Attributes structure for message queue.
const char * name
name of the message queue
uint32_t attr_bits
attribute bits
void * cb_mem
memory for control block
uint32_t mq_size
size of provided memory for data storage
uint32_t cb_size
size of provided memory for control block
void * mq_mem
memory for data storage
Attributes structure for mutex.
uint32_t cb_size
size of provided memory for control block
uint32_t attr_bits
attribute bits
const char * name
name of the mutex
void * cb_mem
memory for control block
Attributes structure for semaphore.
const char * name
name of the semaphore
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
void * cb_mem
memory for control block
Attributes structure for thread.
void * cb_mem
memory for control block
uint32_t reserved
reserved (must be 0)
TZ_ModuleId_t tz_module
TrustZone module identifier.
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
void * stack_mem
memory for stack
osPriority_t priority
initial thread priority (default: osPriorityNormal)
uint32_t stack_size
size of stack
const char * name
name of the thread
Attributes structure for timer.
void * cb_mem
memory for control block
const char * name
name of the timer
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
uint32_t api
API version (major.minor.rev: mmnnnrrrr dec).
uint32_t kernel
Kernel version (major.minor.rev: mmnnnrrrr dec).