|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
CMSIS RTOS2 interface for C++ API of SuperTinyKernel RTOS. More...
Classes | |
| struct | osVersion_t |
| Version information. More... | |
| struct | osThreadAttr_t |
| Attributes structure for thread. More... | |
| struct | osTimerAttr_t |
| Attributes structure for timer. More... | |
| struct | osEventFlagsAttr_t |
| Attributes structure for event flags. More... | |
| struct | osMutexAttr_t |
| Attributes structure for mutex. More... | |
| struct | osSemaphoreAttr_t |
| Attributes structure for semaphore. More... | |
| struct | osMemoryPoolAttr_t |
| Attributes structure for memory pool. More... | |
| struct | osMessageQueueAttr_t |
| Attributes structure for message queue. More... | |
Macros | |
| #define | osWaitForever 0xFFFFFFFFU |
| Wait forever timeout value. | |
| #define | osFlagsWaitAny 0x00000000U |
| Wait for any flag (default). | |
| #define | osFlagsWaitAll 0x00000001U |
| Wait for all flags. | |
| #define | osFlagsNoClear 0x00000002U |
| Do not clear flags which have been specified to wait for. | |
| #define | osFlagsError 0x80000000U |
| Error indicator. | |
| #define | osFlagsErrorUnknown 0xFFFFFFFFU |
| osError (-1). | |
| #define | osFlagsErrorTimeout 0xFFFFFFFEU |
| osErrorTimeout (-2). | |
| #define | osFlagsErrorResource 0xFFFFFFFDU |
| osErrorResource (-3). | |
| #define | osFlagsErrorParameter 0xFFFFFFFCU |
| osErrorParameter (-4). | |
| #define | osFlagsErrorISR 0xFFFFFFFAU |
| osErrorISR (-6). | |
| #define | osFlagsErrorSafetyClass 0xFFFFFFF9U |
| osErrorSafetyClass (-7). | |
| #define | osThreadDetached 0x00000000U |
| Thread created in detached mode (default). | |
| #define | osThreadJoinable 0x00000001U |
| Thread created in joinable mode. | |
| #define | osThreadUnprivileged 0x00000002U |
| Thread runs in unprivileged mode. | |
| #define | osThreadPrivileged 0x00000004U |
| Thread runs in privileged mode. | |
| #define | osThreadZone_Pos 8U |
| MPU protected zone position. | |
| #define | osThreadZone_Msk (0x3FUL << osThreadZone_Pos) |
| MPU protected zone mask. | |
| #define | osThreadZone_Valid (0x80UL << osThreadZone_Pos) |
| MPU protected zone valid flag. | |
| #define | osThreadZone(n) |
| MPU zone value in attribute bit field format. | |
| #define | osThreadProcessor(n) |
| Thread processor number for SMP systems. | |
| #define | osMutexRecursive 0x00000001U |
| Recursive mutex. | |
| #define | osMutexPrioInherit 0x00000002U |
| Priority inherit protocol. | |
| #define | osMutexRobust 0x00000008U |
| Robust mutex. | |
| #define | osSafetyClass_Pos 16U |
| Safety class position. | |
| #define | osSafetyClass_Msk (0x0FUL << osSafetyClass_Pos) |
| Safety class mask. | |
| #define | osSafetyClass_Valid (0x10UL << osSafetyClass_Pos) |
| Safety class valid flag. | |
| #define | osSafetyClass(n) |
| Safety class. | |
| #define | osSafetyWithSameClass 0x00000001U |
| Objects with same safety class. | |
| #define | osSafetyWithLowerClass 0x00000002U |
| Objects with lower safety class. | |
| #define | osErrorId 0xFFFFFFFFU |
| osError (-1). | |
| #define | TZ_MODULEID_T |
Typedefs | |
| typedef void(* | osThreadFunc_t) (void *argument) |
| Entry point of a thread. | |
| typedef void(* | osTimerFunc_t) (void *argument) |
| Timer callback function. | |
| typedef void * | osThreadId_t |
| typedef void * | osTimerId_t |
| typedef void * | osEventFlagsId_t |
| typedef void * | osMutexId_t |
| typedef void * | osSemaphoreId_t |
| typedef void * | osMemoryPoolId_t |
| typedef void * | osMessageQueueId_t |
| typedef uint32_t | TZ_ModuleId_t |
CMSIS RTOS2 interface for C++ API of SuperTinyKernel RTOS.
Maps the CMSIS RTOS2 C API (cmsis_os2.h) onto the STK C++ API.
Supported:
Design notes:
Limitations / deviations from the specification:
| #define osErrorId 0xFFFFFFFFU |
osError (-1).
Definition at line 306 of file cmsis_os2.h.
Referenced by osThreadGetClass(), and osThreadGetZone().
| #define osFlagsError 0x80000000U |
Error indicator.
Definition at line 266 of file cmsis_os2.h.
Referenced by osEventFlagsClear(), osEventFlagsSet(), osEventFlagsWait(), and osThreadFlagsSet().
| #define osFlagsErrorISR 0xFFFFFFFAU |
| #define osFlagsErrorParameter 0xFFFFFFFCU |
osErrorParameter (-4).
Definition at line 270 of file cmsis_os2.h.
Referenced by osEventFlagsClear(), osEventFlagsSet(), osEventFlagsWait(), and osThreadFlagsSet().
| #define osFlagsErrorResource 0xFFFFFFFDU |
osErrorResource (-3).
Definition at line 269 of file cmsis_os2.h.
| #define osFlagsErrorSafetyClass 0xFFFFFFF9U |
osErrorSafetyClass (-7).
Definition at line 272 of file cmsis_os2.h.
| #define osFlagsErrorTimeout 0xFFFFFFFEU |
osErrorTimeout (-2).
Definition at line 268 of file cmsis_os2.h.
| #define osFlagsErrorUnknown 0xFFFFFFFFU |
osError (-1).
Definition at line 267 of file cmsis_os2.h.
Referenced by osThreadFlagsClear(), and osThreadFlagsWait().
| #define osFlagsNoClear 0x00000002U |
Do not clear flags which have been specified to wait for.
Definition at line 263 of file cmsis_os2.h.
| #define osFlagsWaitAll 0x00000001U |
Wait for all flags.
Definition at line 262 of file cmsis_os2.h.
| #define osFlagsWaitAny 0x00000000U |
Wait for any flag (default).
Definition at line 261 of file cmsis_os2.h.
Referenced by clock(), phaseA(), phaseB(), phaseC(), and phaseD().
| #define osMutexPrioInherit 0x00000002U |
Priority inherit protocol.
Definition at line 291 of file cmsis_os2.h.
| #define osMutexRecursive 0x00000001U |
| #define osMutexRobust 0x00000008U |
| #define osSafetyClass | ( | n | ) |
Safety class.
Definition at line 298 of file cmsis_os2.h.
| #define osSafetyClass_Msk (0x0FUL << osSafetyClass_Pos) |
| #define osSafetyClass_Pos 16U |
| #define osSafetyClass_Valid (0x10UL << osSafetyClass_Pos) |
| #define osSafetyWithLowerClass 0x00000002U |
Objects with lower safety class.
Definition at line 303 of file cmsis_os2.h.
Referenced by StkApplyToThreads(), and StkCheckClassArgs().
| #define osSafetyWithSameClass 0x00000001U |
Objects with same safety class.
Definition at line 302 of file cmsis_os2.h.
Referenced by StkApplyToThreads(), and StkCheckClassArgs().
| #define osThreadDetached 0x00000000U |
Thread created in detached mode (default).
Definition at line 275 of file cmsis_os2.h.
| #define osThreadJoinable 0x00000001U |
Thread created in joinable mode.
Definition at line 276 of file cmsis_os2.h.
Referenced by osThreadNew().
| #define osThreadPrivileged 0x00000004U |
Thread runs in privileged mode.
Definition at line 278 of file cmsis_os2.h.
Referenced by osThreadNew().
| #define osThreadProcessor | ( | n | ) |
Thread processor number for SMP systems.
Definition at line 287 of file cmsis_os2.h.
Referenced by osThreadGetAffinityMask(), and osThreadSetAffinityMask().
| #define osThreadUnprivileged 0x00000002U |
Thread runs in unprivileged mode.
Definition at line 277 of file cmsis_os2.h.
| #define osThreadZone | ( | n | ) |
MPU zone value in attribute bit field format.
Definition at line 283 of file cmsis_os2.h.
| #define osThreadZone_Msk (0x3FUL << osThreadZone_Pos) |
| #define osThreadZone_Pos 8U |
MPU protected zone position.
Definition at line 280 of file cmsis_os2.h.
Referenced by osThreadNew().
| #define osThreadZone_Valid (0x80UL << osThreadZone_Pos) |
MPU protected zone valid flag.
Definition at line 282 of file cmsis_os2.h.
Referenced by osThreadNew().
| #define osWaitForever 0xFFFFFFFFU |
Wait forever timeout value.
Definition at line 258 of file cmsis_os2.h.
Referenced by app_main(), clock(), HighPrioThread(), LowPrioThread(), phaseA(), phaseB(), phaseC(), and phaseD().
| #define TZ_MODULEID_T |
Definition at line 345 of file cmsis_os2.h.
| typedef void* osEventFlagsId_t |
Event Flags ID identifies the event flags.
Definition at line 329 of file cmsis_os2.h.
| typedef void* osMemoryPoolId_t |
Memory Pool ID identifies the memory pool.
Definition at line 338 of file cmsis_os2.h.
| typedef void* osMessageQueueId_t |
Message Queue ID identifies the message queue.
Definition at line 341 of file cmsis_os2.h.
| typedef void* osMutexId_t |
Mutex ID identifies the mutex.
Definition at line 332 of file cmsis_os2.h.
| typedef void* osSemaphoreId_t |
Semaphore ID identifies the semaphore.
Definition at line 335 of file cmsis_os2.h.
| typedef void(* osThreadFunc_t) (void *argument) |
Entry point of a thread.
Definition at line 246 of file cmsis_os2.h.
| typedef void* osThreadId_t |
Thread ID identifies the thread.
Definition at line 323 of file cmsis_os2.h.
| typedef void(* osTimerFunc_t) (void *argument) |
Timer callback function.
Definition at line 249 of file cmsis_os2.h.
| typedef void* osTimerId_t |
Timer ID identifies the timer.
Definition at line 326 of file cmsis_os2.h.
| typedef uint32_t TZ_ModuleId_t |
Data type that identifies secure software modules called by a process.
Definition at line 347 of file cmsis_os2.h.
| enum osKernelState_t |
Kernel state.
Definition at line 167 of file cmsis_os2.h.
| enum osPriority_t |
Priority values.
Definition at line 189 of file cmsis_os2.h.
| enum osStatus_t |
Status code values returned by CMSIS-RTOS functions.
Definition at line 309 of file cmsis_os2.h.
| enum osThreadState_t |
Thread state.
Definition at line 178 of file cmsis_os2.h.
| enum osTimerType_t |
Timer type.
| Enumerator | |
|---|---|
| osTimerOnce | One-shot timer. |
| osTimerPeriodic | Repeating timer. |
Definition at line 252 of file cmsis_os2.h.
| osStatus_t osDelay | ( | uint32_t | ticks | ) |
Wait for Timeout (Time Delay).
| [in] | ticks | time ticks value |
Definition at line 2251 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osOK, and stk::Sleep().
Referenced by app_main(), clock(), HighPrioThread(), LowPrioThread(), MidPrioThread(), and signal_func().
| osStatus_t osDelayUntil | ( | uint32_t | ticks | ) |
Wait until specified time.
| [in] | ticks | absolute time in ticks |
Definition at line 2272 of file cmsis_os2_stk.cpp.
References stk::GetTicks(), osError, osErrorISR, osErrorParameter, osOK, and stk::Sleep().
| uint32_t osEventFlagsClear | ( | osEventFlagsId_t | ef_id, |
| uint32_t | flags ) |
Clear the specified Event Flags.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
| [in] | flags | specifies the flags that shall be cleared. |
Definition at line 2549 of file cmsis_os2_stk.cpp.
References osFlagsError, and osFlagsErrorParameter.
| osStatus_t osEventFlagsDelete | ( | osEventFlagsId_t | ef_id | ) |
Delete an Event Flags object.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
Definition at line 2598 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| uint32_t osEventFlagsGet | ( | osEventFlagsId_t | ef_id | ) |
Get the current Event Flags.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
Definition at line 2565 of file cmsis_os2_stk.cpp.
| const char * osEventFlagsGetName | ( | osEventFlagsId_t | ef_id | ) |
Get name of an Event Flags object.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
Definition at line 2517 of file cmsis_os2_stk.cpp.
| osEventFlagsId_t osEventFlagsNew | ( | const osEventFlagsAttr_t * | attr | ) |
Create and Initialize an Event Flags object.
| [in] | attr | event flags attributes; NULL: default values. |
Definition at line 2496 of file cmsis_os2_stk.cpp.
References osEventFlagsAttr_t::cb_mem, osEventFlagsAttr_t::cb_size, and osEventFlagsAttr_t::name.
| uint32_t osEventFlagsSet | ( | osEventFlagsId_t | ef_id, |
| uint32_t | flags ) |
Set the specified Event Flags.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
| [in] | flags | specifies the flags that shall be set. |
Definition at line 2533 of file cmsis_os2_stk.cpp.
References osFlagsError, and osFlagsErrorParameter.
| 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.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
| [in] | flags | specifies the flags to wait for. |
| [in] | options | specifies flags options (osFlagsXxxx). |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2581 of file cmsis_os2_stk.cpp.
References osFlagsError, and osFlagsErrorParameter.
| void osFaultResume | ( | void | ) |
Resume normal operation when exiting exception faults.
Definition at line 1872 of file cmsis_os2_stk.cpp.
| osStatus_t osKernelDestroyClass | ( | uint32_t | safety_class, |
| uint32_t | mode ) |
Destroy objects for specified safety classes.
| [in] | safety_class | safety class. |
| [in] | mode | safety mode. |
Definition at line 2048 of file cmsis_os2_stk.cpp.
References ACT_TERMINATE, osOK, StkApplyToThreads(), and StkCheckClassArgs().
| osStatus_t osKernelGetInfo | ( | osVersion_t * | version, |
| char * | id_buf, | ||
| uint32_t | id_size ) |
Get RTOS Kernel Information.
| [out] | version | pointer to buffer for retrieving version information. |
| [out] | id_buf | pointer to buffer for retrieving kernel identification string. |
| [in] | id_size | size of buffer for kernel identification string. |
Definition at line 946 of file cmsis_os2_stk.cpp.
References osVersion_t::api, osVersion_t::kernel, osOK, stk::STK_MEMCPY(), STK_WRAPPER_API_VERSION, STK_WRAPPER_KERNEL_ID, and STK_WRAPPER_KERNEL_VERSION.
| osKernelState_t osKernelGetState | ( | void | ) |
Get the current RTOS Kernel state.
Definition at line 971 of file cmsis_os2_stk.cpp.
References stk::IKernel::KSTATE_INACTIVE, stk::IKernel::KSTATE_LOCKED, stk::IKernel::KSTATE_READY, stk::IKernel::KSTATE_RUNNING, stk::IKernel::KSTATE_SUSPENDED, osKernelError, osKernelInactive, osKernelLocked, osKernelReady, osKernelRunning, and osKernelSuspended.
Referenced by app_run(), osKernelInitialize(), osKernelResume(), osKernelStart(), osKernelSuspend(), osThreadEnumerate(), osThreadGetCount(), osThreadNew(), and osTimerNew().
| uint32_t osKernelGetSysTimerCount | ( | void | ) |
Get the RTOS kernel system timer count.
Definition at line 1149 of file cmsis_os2_stk.cpp.
References stk::GetSysTimerCount().
| uint64_t osKernelGetSysTimerCount64 | ( | void | ) |
Get the RTOS kernel system timer count.
Definition at line 1154 of file cmsis_os2_stk.cpp.
References stk::GetSysTimerCount().
| uint32_t osKernelGetSysTimerFreq | ( | void | ) |
Get the RTOS kernel system timer frequency.
Definition at line 1159 of file cmsis_os2_stk.cpp.
References stk::GetSysTimerFrequency().
| uint32_t osKernelGetTickCount | ( | void | ) |
Get the RTOS kernel tick count.
Definition at line 1109 of file cmsis_os2_stk.cpp.
References stk::GetTicks().
| uint32_t osKernelGetTickFreq | ( | void | ) |
Get the RTOS kernel tick frequency.
Definition at line 1125 of file cmsis_os2_stk.cpp.
References stk::GetTickResolution().
| osStatus_t osKernelInitialize | ( | void | ) |
Initialize the RTOS Kernel.
Definition at line 925 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osKernelGetState(), osKernelInactive, and osOK.
Referenced by app_run().
| int32_t osKernelLock | ( | void | ) |
Lock the RTOS Kernel scheduler.
Disables task switching only, the kernel tick, timeouts and ISRs keep running. The lock holder must not block, sleep, yield or exit while the scheduler is locked.
Definition at line 1025 of file cmsis_os2_stk.cpp.
| osStatus_t osKernelProtect | ( | uint32_t | safety_class | ) |
Protect the RTOS Kernel scheduler access.
| [in] | safety_class | safety class. |
Definition at line 1877 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| int32_t osKernelRestoreLock | ( | int32_t | lock | ) |
Restore the RTOS Kernel scheduler lock state.
| [in] | lock | lock state obtained by osKernelLock or osKernelUnlock. |
Definition at line 1037 of file cmsis_os2_stk.cpp.
References stk::IKernel::KSTATE_LOCKED, stk::IKernel::KSTATE_RUNNING, osError, and osErrorISR.
| void osKernelResume | ( | uint32_t | sleep_ticks | ) |
Resume the RTOS Kernel scheduler.
| [in] | sleep_ticks | time in ticks for how long the system was in sleep or power-down mode. |
Definition at line 1096 of file cmsis_os2_stk.cpp.
References stk::IKernelService::GetInstance(), osKernelGetState(), osKernelInactive, stk::IKernelService::Resume(), and STK_UNUSED.
| osStatus_t osKernelStart | ( | void | ) |
Start the RTOS Kernel scheduler.
Definition at line 1000 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osKernelGetState(), osKernelReady, and osOK.
Referenced by app_run().
| uint32_t osKernelSuspend | ( | void | ) |
Suspend the RTOS Kernel scheduler.
Definition at line 1075 of file cmsis_os2_stk.cpp.
References stk::IKernelService::GetInstance(), osKernelGetState(), osKernelInactive, and stk::IKernelService::Suspend().
| int32_t osKernelUnlock | ( | void | ) |
Unlock the RTOS Kernel scheduler.
A thread made ready during the lock is switched in on the next kernel tick.
Definition at line 1031 of file cmsis_os2_stk.cpp.
| void * osMemoryPoolAlloc | ( | osMemoryPoolId_t | mp_id, |
| uint32_t | timeout ) |
Allocate a memory block from a Memory Pool.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2968 of file cmsis_os2_stk.cpp.
| osStatus_t osMemoryPoolDelete | ( | osMemoryPoolId_t | mp_id | ) |
Delete a Memory Pool object.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 3073 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| osStatus_t osMemoryPoolFree | ( | osMemoryPoolId_t | mp_id, |
| void * | block ) |
Return an allocated memory block back to a Memory Pool.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
| [in] | block | address of the allocated memory block to be returned to the memory pool. |
Definition at line 2989 of file cmsis_os2_stk.cpp.
References osErrorParameter, and osOK.
| uint32_t osMemoryPoolGetBlockSize | ( | osMemoryPoolId_t | mp_id | ) |
Get memory block size in a Memory Pool.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 3025 of file cmsis_os2_stk.cpp.
| uint32_t osMemoryPoolGetCapacity | ( | osMemoryPoolId_t | mp_id | ) |
Get maximum number of memory blocks in a Memory Pool.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 3009 of file cmsis_os2_stk.cpp.
| uint32_t osMemoryPoolGetCount | ( | osMemoryPoolId_t | mp_id | ) |
Get number of memory blocks used in a Memory Pool.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 3041 of file cmsis_os2_stk.cpp.
| const char * osMemoryPoolGetName | ( | osMemoryPoolId_t | mp_id | ) |
Get name of a Memory Pool object.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 2952 of file cmsis_os2_stk.cpp.
| uint32_t osMemoryPoolGetSpace | ( | osMemoryPoolId_t | mp_id | ) |
Get number of memory blocks available in a Memory Pool.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 3057 of file cmsis_os2_stk.cpp.
| osMemoryPoolId_t osMemoryPoolNew | ( | uint32_t | block_count, |
| uint32_t | block_size, | ||
| const osMemoryPoolAttr_t * | attr ) |
Create and Initialize a Memory Pool object.
| [in] | block_count | maximum number of memory blocks in memory pool. |
| [in] | block_size | memory block size in bytes. |
| [in] | attr | memory pool attributes; NULL: default values. |
Definition at line 2901 of file cmsis_os2_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize(), osMemoryPoolAttr_t::cb_mem, osMemoryPoolAttr_t::cb_size, stk::memory::BlockMemoryPool::IsStorageValid(), osMemoryPoolAttr_t::mp_mem, osMemoryPoolAttr_t::mp_size, and osMemoryPoolAttr_t::name.
| osStatus_t osMessageQueueDelete | ( | osMessageQueueId_t | mq_id | ) |
Delete a Message Queue object.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3304 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| 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.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
| [out] | msg_ptr | pointer to buffer for message to get from a queue. |
| [out] | msg_prio | pointer to buffer for message priority or NULL. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 3190 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| uint32_t osMessageQueueGetCapacity | ( | osMessageQueueId_t | mq_id | ) |
Get maximum number of messages in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3219 of file cmsis_os2_stk.cpp.
| uint32_t osMessageQueueGetCount | ( | osMessageQueueId_t | mq_id | ) |
Get number of queued messages in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3251 of file cmsis_os2_stk.cpp.
| uint32_t osMessageQueueGetMsgSize | ( | osMessageQueueId_t | mq_id | ) |
Get maximum message size in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3235 of file cmsis_os2_stk.cpp.
| const char * osMessageQueueGetName | ( | osMessageQueueId_t | mq_id | ) |
Get name of a Message Queue object.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3150 of file cmsis_os2_stk.cpp.
| uint32_t osMessageQueueGetSpace | ( | osMessageQueueId_t | mq_id | ) |
Get number of available slots for messages in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3267 of file cmsis_os2_stk.cpp.
| osMessageQueueId_t osMessageQueueNew | ( | uint32_t | msg_count, |
| uint32_t | msg_size, | ||
| const osMessageQueueAttr_t * | attr ) |
Create and Initialize a Message Queue object.
| [in] | msg_count | maximum number of messages in queue. |
| [in] | msg_size | maximum message size in bytes. |
| [in] | attr | message queue attributes; NULL: default values. |
Definition at line 3099 of file cmsis_os2_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, osMessageQueueAttr_t::cb_mem, osMessageQueueAttr_t::cb_size, stk::sync::MessageQueue::IsStorageValid(), osMessageQueueAttr_t::mq_mem, osMessageQueueAttr_t::mq_size, and osMessageQueueAttr_t::name.
| 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.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
| [in] | msg_ptr | pointer to buffer with message to put into a queue. |
| [in] | msg_prio | message priority. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 3166 of file cmsis_os2_stk.cpp.
References osErrorISR, and osErrorParameter.
| osStatus_t osMessageQueueReset | ( | osMessageQueueId_t | mq_id | ) |
Reset a Message Queue to initial empty state.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 3283 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| osStatus_t osMutexAcquire | ( | osMutexId_t | mutex_id, |
| uint32_t | timeout ) |
Acquire a Mutex or timeout if it is locked.
| [in] | mutex_id | mutex ID obtained by osMutexNew. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2685 of file cmsis_os2_stk.cpp.
References mutex_id, osErrorISR, and osErrorParameter.
Referenced by HighPrioThread(), and LowPrioThread().
| osStatus_t osMutexDelete | ( | osMutexId_t | mutex_id | ) |
Delete a Mutex object.
| [in] | mutex_id | mutex ID obtained by osMutexNew. |
Definition at line 2756 of file cmsis_os2_stk.cpp.
References mutex_id, osErrorISR, osErrorParameter, and osOK.
| const char * osMutexGetName | ( | osMutexId_t | mutex_id | ) |
Get name of a Mutex object.
| [in] | mutex_id | mutex ID obtained by osMutexNew. |
Definition at line 2669 of file cmsis_os2_stk.cpp.
References mutex_id.
| osThreadId_t osMutexGetOwner | ( | osMutexId_t | mutex_id | ) |
Get Thread which owns a Mutex object.
| [in] | mutex_id | mutex ID obtained by osMutexNew. |
Definition at line 2736 of file cmsis_os2_stk.cpp.
References mutex_id, and stk::TID_NONE.
| osMutexId_t osMutexNew | ( | const osMutexAttr_t * | attr | ) |
Create and Initialize a Mutex object.
| [in] | attr | mutex attributes; NULL: default values. |
Definition at line 2625 of file cmsis_os2_stk.cpp.
References osMutexAttr_t::attr_bits, osMutexAttr_t::cb_mem, osMutexAttr_t::cb_size, osMutexAttr_t::name, osMutexRecursive, osMutexRobust, STK_ASSERT, and STK_CMSIS_USE_FAST_MUTEX.
Referenced by app_main().
| osStatus_t osMutexRelease | ( | osMutexId_t | mutex_id | ) |
Release a Mutex that was acquired by osMutexAcquire.
| [in] | mutex_id | mutex ID obtained by osMutexNew. |
Definition at line 2705 of file cmsis_os2_stk.cpp.
References stk::GetTid(), mutex_id, osErrorISR, osErrorParameter, osErrorResource, and osOK.
Referenced by HighPrioThread(), and LowPrioThread().
| osStatus_t osSemaphoreAcquire | ( | osSemaphoreId_t | semaphore_id, |
| uint32_t | timeout ) |
Acquire a Semaphore token or timeout if no tokens are available.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2819 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and stk::sync::SemaphoreT< T >::WaitEx().
| osStatus_t osSemaphoreDelete | ( | osSemaphoreId_t | semaphore_id | ) |
Delete a Semaphore object.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2875 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, and osOK.
| uint32_t osSemaphoreGetCount | ( | osSemaphoreId_t | semaphore_id | ) |
Get current Semaphore token count.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2859 of file cmsis_os2_stk.cpp.
| const char * osSemaphoreGetName | ( | osSemaphoreId_t | semaphore_id | ) |
Get name of a Semaphore object.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2803 of file cmsis_os2_stk.cpp.
| osSemaphoreId_t osSemaphoreNew | ( | uint32_t | max_count, |
| uint32_t | initial_count, | ||
| const osSemaphoreAttr_t * | attr ) |
Create and Initialize a Semaphore object.
| [in] | max_count | maximum number of available tokens. |
| [in] | initial_count | initial number of available tokens. |
| [in] | attr | semaphore attributes; NULL: default values. |
Definition at line 2781 of file cmsis_os2_stk.cpp.
References osSemaphoreAttr_t::cb_mem, osSemaphoreAttr_t::cb_size, and osSemaphoreAttr_t::name.
| osStatus_t osSemaphoreRelease | ( | osSemaphoreId_t | semaphore_id | ) |
Release a Semaphore token up to the initial maximum count.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2842 of file cmsis_os2_stk.cpp.
References osErrorParameter, osErrorResource, and osOK.
| osStatus_t osThreadDetach | ( | osThreadId_t | thread_id | ) |
Detach a thread (thread storage can be reclaimed when thread terminates).
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1577 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osErrorParameter, and osOK.
| uint32_t osThreadEnumerate | ( | osThreadId_t * | thread_array, |
| uint32_t | array_items ) |
Enumerate active threads.
| [out] | thread_array | pointer to array for retrieving thread IDs. |
| [in] | array_items | maximum number of items in array for retrieving thread IDs. |
Definition at line 2129 of file cmsis_os2_stk.cpp.
References stk::GetTidFromUserTask(), osKernelGetState(), and osKernelInactive.
Referenced by StkApplyToThreads().
| void osThreadExit | ( | void | ) |
Terminate execution of current running thread.
Definition at line 1724 of file cmsis_os2_stk.cpp.
References __NO_RETURN, and stk::ExitTask().
Referenced by osThreadTerminate().
| osStatus_t osThreadFeedWatchdog | ( | uint32_t | ticks | ) |
Feed watchdog of the current running thread.
| [in] | ticks | interval in kernel ticks until the thread watchdog expires, or 0 to stop the watchdog |
Definition at line 1782 of file cmsis_os2_stk.cpp.
References CMSIS_STK_MAX_THREADS, osError, osErrorISR, osErrorResource, osOK, osThreadGetId(), stk::time::TimerHost::RES_INACTIVE, stk::time::TimerHost::RES_OK, stk::time::TimerHost::RES_QUEUED, stk::time::TimerHost::RestartSync(), stk::time::TimerHost::StopSync(), and stk::WAIT_INFINITE.
| uint32_t osThreadFlagsClear | ( | uint32_t | flags | ) |
Clear the specified Thread Flags of current running thread.
| [in] | flags | specifies the flags of the thread that shall be cleared. |
Definition at line 2186 of file cmsis_os2_stk.cpp.
References stk::sync::EventFlagsT< T >::Clear(), osFlagsErrorUnknown, and osThreadGetId().
| uint32_t osThreadFlagsGet | ( | void | ) |
Get the current Thread Flags of current running thread.
Definition at line 2204 of file cmsis_os2_stk.cpp.
References osThreadGetId().
| uint32_t osThreadFlagsSet | ( | osThreadId_t | thread_id, |
| uint32_t | flags ) |
Set the specified Thread Flags of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
| [in] | flags | specifies the flags of the thread that shall be set. |
Definition at line 2169 of file cmsis_os2_stk.cpp.
References osFlagsError, osFlagsErrorParameter, and stk::sync::EventFlagsT< T >::Set().
Referenced by app_main(), and signal_func().
| 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.
| [in] | flags | specifies the flags to wait for. |
| [in] | options | specifies flags options (osFlagsXxxx). |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2221 of file cmsis_os2_stk.cpp.
References osFlagsErrorISR, osFlagsErrorUnknown, and osThreadGetId().
Referenced by clock(), phaseA(), phaseB(), phaseC(), and phaseD().
| uint32_t osThreadGetAffinityMask | ( | osThreadId_t | thread_id | ) |
Get current processor affinity mask of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 2095 of file cmsis_os2_stk.cpp.
References osThreadProcessor.
| uint32_t osThreadGetClass | ( | osThreadId_t | thread_id | ) |
Get safety class of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1918 of file cmsis_os2_stk.cpp.
References osErrorId.
| uint32_t osThreadGetCount | ( | void | ) |
Get number of active threads.
Definition at line 2100 of file cmsis_os2_stk.cpp.
References osKernelGetState(), osKernelInactive, and stk::time::TimerHost::TASK_COUNT.
| osThreadId_t osThreadGetId | ( | void | ) |
Return the thread ID of the current running thread.
Definition at line 1326 of file cmsis_os2_stk.cpp.
References stk::GetTid().
Referenced by osThreadFeedWatchdog(), osThreadFlagsClear(), osThreadFlagsGet(), osThreadFlagsWait(), osThreadGetState(), osThreadJoin(), osThreadTerminate(), and StkApplyToThreads().
| const char * osThreadGetName | ( | osThreadId_t | thread_id | ) |
Get name of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1310 of file cmsis_os2_stk.cpp.
| osPriority_t osThreadGetPriority | ( | osThreadId_t | thread_id | ) |
Get current priority of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1458 of file cmsis_os2_stk.cpp.
References osPriorityError.
| uint32_t osThreadGetStackSize | ( | osThreadId_t | thread_id | ) |
Get stack size of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1370 of file cmsis_os2_stk.cpp.
| uint32_t osThreadGetStackSpace | ( | osThreadId_t | thread_id | ) |
Get available stack space of a thread based on stack watermark recording during execution.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1387 of file cmsis_os2_stk.cpp.
| osThreadState_t osThreadGetState | ( | osThreadId_t | thread_id | ) |
Get current thread state of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1345 of file cmsis_os2_stk.cpp.
References osThreadBlocked, osThreadError, osThreadGetId(), osThreadReady, and osThreadRunning.
| uint32_t osThreadGetZone | ( | osThreadId_t | thread_id | ) |
Get MPU protected zone of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1924 of file cmsis_os2_stk.cpp.
References osErrorId.
| osStatus_t osThreadJoin | ( | osThreadId_t | thread_id | ) |
Wait for specified thread to terminate.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1638 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osErrorParameter, osOK, osThreadGetId(), stk::WAIT_INFINITE, stk::WAIT_RESULT_FAIL, and stk::sync::ConditionVariable::WaitEx().
| osThreadId_t osThreadNew | ( | osThreadFunc_t | func, |
| void * | argument, | ||
| const osThreadAttr_t * | attr ) |
Create a thread and add it to Active Threads.
| [in] | func | thread function. |
| [in] | argument | pointer that is passed to the thread function as start argument. |
| [in] | attr | thread attributes; NULL: default values. |
Definition at line 1169 of file cmsis_os2_stk.cpp.
References stk::ADD_OK, stk::memory::MemoryAllocator::AllocateArrayT(), osThreadAttr_t::attr_bits, osThreadAttr_t::cb_mem, osThreadAttr_t::cb_size, CMSIS_STK_DEFAULT_STACK_WORDS, CMSIS_STK_MIN_STACK_WORDS, stk::Max(), osThreadAttr_t::name, osKernelGetState(), osKernelInactive, osPriorityIdle, osPriorityISR, osPriorityNone, osPriorityNormal, osSafetyClass_Msk, osSafetyClass_Pos, osSafetyClass_Valid, osThreadJoinable, osThreadPrivileged, osThreadZone_Msk, osThreadZone_Pos, osThreadZone_Valid, osThreadAttr_t::priority, osThreadAttr_t::stack_mem, osThreadAttr_t::stack_size, and STK_ASSERT.
Referenced by app_main(), and app_run().
| osStatus_t osThreadProtectPrivileged | ( | void | ) |
Protect creation of privileged threads.
Definition at line 1901 of file cmsis_os2_stk.cpp.
References osErrorISR, and osOK.
| osStatus_t osThreadResume | ( | osThreadId_t | thread_id | ) |
Resume execution of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1538 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, osErrorResource, osOK, stk::RESUME_DONE, and stk::RESUME_LIFTED.
Referenced by StkApplyToThreads().
| osStatus_t osThreadResumeClass | ( | uint32_t | safety_class, |
| uint32_t | mode ) |
Resume execution of threads for specified safety classes.
| [in] | safety_class | safety class. |
| [in] | mode | safety mode. |
Definition at line 2041 of file cmsis_os2_stk.cpp.
References ACT_RESUME, osOK, StkApplyToThreads(), and StkCheckClassArgs().
| osStatus_t osThreadSetAffinityMask | ( | osThreadId_t | thread_id, |
| uint32_t | affinity_mask ) |
Set processor affinity mask of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
| [in] | affinity_mask | processor affinity mask for the thread. |
Definition at line 2075 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, osOK, and osThreadProcessor.
| osStatus_t osThreadSetPriority | ( | osThreadId_t | thread_id, |
| osPriority_t | priority ) |
Change priority of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
| [in] | priority | new priority value for the thread function. |
Definition at line 1404 of file cmsis_os2_stk.cpp.
References stk::ADD_OK, stk::GetTidFromUserTask(), osError, osErrorISR, osErrorParameter, osOK, osPriorityIdle, osPriorityISR, and stk::SetWeight().
| osStatus_t osThreadSuspend | ( | osThreadId_t | thread_id | ) |
Suspend execution of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1496 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osErrorParameter, osOK, and stk::SUSPEND_FAIL.
Referenced by StkApplyToThreads().
| osStatus_t osThreadSuspendClass | ( | uint32_t | safety_class, |
| uint32_t | mode ) |
Suspend execution of threads for specified safety classes.
| [in] | safety_class | safety class. |
| [in] | mode | safety mode. |
Definition at line 2035 of file cmsis_os2_stk.cpp.
References ACT_SUSPEND, osOK, StkApplyToThreads(), and StkCheckClassArgs().
| osStatus_t osThreadTerminate | ( | osThreadId_t | thread_id | ) |
Terminate execution of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1735 of file cmsis_os2_stk.cpp.
References osErrorISR, osErrorParameter, osOK, osThreadExit(), and osThreadGetId().
Referenced by StkApplyToThreads().
| osStatus_t osThreadTerminateZone | ( | uint32_t | zone | ) |
Terminate execution of threads assigned to a specified MPU protected zone.
| [in] | zone | MPU protected zone. |
Definition at line 2054 of file cmsis_os2_stk.cpp.
References ACT_TERMINATE, osErrorISR, osErrorParameter, and StkApplyToThreads().
| osStatus_t osThreadYield | ( | void | ) |
Pass control to next thread that is in state READY.
Definition at line 1475 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osOK, and stk::Yield().
Referenced by MidPrioThread().
| osStatus_t osTimerDelete | ( | osTimerId_t | timer_id | ) |
Delete a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 2450 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osErrorParameter, osOK, stk::time::TimerHost::RES_INACTIVE, stk::time::TimerHost::RES_OK, and stk::time::TimerHost::StopSync().
| const char * osTimerGetName | ( | osTimerId_t | timer_id | ) |
Get name of a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 2341 of file cmsis_os2_stk.cpp.
| uint32_t osTimerIsRunning | ( | osTimerId_t | timer_id | ) |
Check if a timer is running.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 2434 of file cmsis_os2_stk.cpp.
| osTimerId_t osTimerNew | ( | osTimerFunc_t | func, |
| osTimerType_t | type, | ||
| void * | argument, | ||
| const osTimerAttr_t * | attr ) |
Create and Initialize a timer.
| [in] | func | function pointer to callback function. |
| [in] | type | osTimerOnce for one-shot or osTimerPeriodic for periodic behavior. |
| [in] | argument | argument to the timer callback function. |
| [in] | attr | timer attributes; NULL: default values. |
Definition at line 2308 of file cmsis_os2_stk.cpp.
References osTimerAttr_t::cb_mem, osTimerAttr_t::cb_size, osTimerAttr_t::name, osKernelGetState(), and osKernelInactive.
| osStatus_t osTimerStart | ( | osTimerId_t | timer_id, |
| uint32_t | ticks ) |
Start or restart a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
| [in] | ticks | time ticks value of the timer. |
Definition at line 2357 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osErrorParameter, osOK, osTimerPeriodic, stk::time::TimerHost::RES_OK, stk::time::TimerHost::RES_QUEUED, stk::time::TimerHost::RestartSync(), and stk::WAIT_INFINITE.
| osStatus_t osTimerStop | ( | osTimerId_t | timer_id | ) |
Stop a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 2396 of file cmsis_os2_stk.cpp.
References osError, osErrorISR, osErrorParameter, osErrorResource, osOK, stk::time::TimerHost::RES_INACTIVE, stk::time::TimerHost::RES_OK, stk::time::TimerHost::RES_QUEUED, and stk::time::TimerHost::StopSync().
| __stk_weak uint32_t osWatchdogAlarm_Handler | ( | osThreadId_t | thread_id | ) |
Handler for expired thread watchdogs.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 1861 of file cmsis_os2_stk.cpp.
References __stk_weak.
| void osZoneSetup_Callback | ( | uint32_t | zone | ) |
Setup MPU protected zone (called when zone changes).
| [in] | zone | zone number. |
Definition at line 1867 of file cmsis_os2_stk.cpp.
References __stk_weak.