![]() |
SuperTinyKernel™ RTOS 1.06.0
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 (STK). 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 (STK).
| #define osErrorId 0xFFFFFFFFU |
osError (-1).
Definition at line 249 of file cmsis_os2.h.
| #define osFlagsError 0x80000000U |
Error indicator.
Definition at line 209 of file cmsis_os2.h.
Referenced by osEventFlagsClear(), osEventFlagsSet(), osEventFlagsWait(), and osThreadFlagsSet().
| #define osFlagsErrorISR 0xFFFFFFFAU |
osErrorISR (-6).
Definition at line 214 of file cmsis_os2.h.
Referenced by osThreadFlagsWait(), and StkFlagsResultToCmsis().
| #define osFlagsErrorParameter 0xFFFFFFFCU |
osErrorParameter (-4).
Definition at line 213 of file cmsis_os2.h.
Referenced by osEventFlagsClear(), osEventFlagsSet(), osEventFlagsWait(), osThreadFlagsSet(), and StkFlagsResultToCmsis().
| #define osFlagsErrorResource 0xFFFFFFFDU |
osErrorResource (-3).
Definition at line 212 of file cmsis_os2.h.
| #define osFlagsErrorSafetyClass 0xFFFFFFF9U |
osErrorSafetyClass (-7).
Definition at line 215 of file cmsis_os2.h.
| #define osFlagsErrorTimeout 0xFFFFFFFEU |
osErrorTimeout (-2).
Definition at line 211 of file cmsis_os2.h.
Referenced by StkFlagsResultToCmsis().
| #define osFlagsErrorUnknown 0xFFFFFFFFU |
osError (-1).
Definition at line 210 of file cmsis_os2.h.
Referenced by osThreadFlagsClear(), osThreadFlagsWait(), and StkFlagsResultToCmsis().
| #define osFlagsNoClear 0x00000002U |
Do not clear flags which have been specified to wait for.
Definition at line 206 of file cmsis_os2.h.
Referenced by CmsisFlagsOptionsToStk().
| #define osFlagsWaitAll 0x00000001U |
Wait for all flags.
Definition at line 205 of file cmsis_os2.h.
Referenced by CmsisFlagsOptionsToStk().
| #define osFlagsWaitAny 0x00000000U |
Wait for any flag (default).
Definition at line 204 of file cmsis_os2.h.
| #define osMutexPrioInherit 0x00000002U |
Priority inherit protocol.
Definition at line 234 of file cmsis_os2.h.
| #define osMutexRecursive 0x00000001U |
Recursive mutex.
Definition at line 233 of file cmsis_os2.h.
| #define osMutexRobust 0x00000008U |
Robust mutex.
Definition at line 235 of file cmsis_os2.h.
| #define osSafetyClass | ( | n | ) |
Safety class.
Definition at line 241 of file cmsis_os2.h.
| #define osSafetyClass_Msk (0x0FUL << osSafetyClass_Pos) |
Safety class mask.
Definition at line 239 of file cmsis_os2.h.
| #define osSafetyClass_Pos 16U |
Safety class position.
Definition at line 238 of file cmsis_os2.h.
| #define osSafetyClass_Valid (0x10UL << osSafetyClass_Pos) |
Safety class valid flag.
Definition at line 240 of file cmsis_os2.h.
| #define osSafetyWithLowerClass 0x00000002U |
Objects with lower safety class.
Definition at line 246 of file cmsis_os2.h.
| #define osSafetyWithSameClass 0x00000001U |
Objects with same safety class.
Definition at line 245 of file cmsis_os2.h.
| #define osThreadDetached 0x00000000U |
Thread created in detached mode (default).
Definition at line 218 of file cmsis_os2.h.
| #define osThreadJoinable 0x00000001U |
Thread created in joinable mode.
Definition at line 219 of file cmsis_os2.h.
Referenced by osThreadNew().
| #define osThreadPrivileged 0x00000004U |
Thread runs in privileged mode.
Definition at line 221 of file cmsis_os2.h.
| #define osThreadProcessor | ( | n | ) |
Thread processor number for SMP systems.
Definition at line 230 of file cmsis_os2.h.
| #define osThreadUnprivileged 0x00000002U |
Thread runs in unprivileged mode.
Definition at line 220 of file cmsis_os2.h.
| #define osThreadZone | ( | n | ) |
MPU zone value in attribute bit field format.
Definition at line 226 of file cmsis_os2.h.
| #define osThreadZone_Msk (0x3FUL << osThreadZone_Pos) |
MPU protected zone mask.
Definition at line 224 of file cmsis_os2.h.
| #define osThreadZone_Pos 8U |
MPU protected zone position.
Definition at line 223 of file cmsis_os2.h.
| #define osThreadZone_Valid (0x80UL << osThreadZone_Pos) |
MPU protected zone valid flag.
Definition at line 225 of file cmsis_os2.h.
| #define osWaitForever 0xFFFFFFFFU |
Wait forever timeout value.
Definition at line 201 of file cmsis_os2.h.
| #define TZ_MODULEID_T |
Definition at line 288 of file cmsis_os2.h.
| typedef void* osEventFlagsId_t |
Event Flags ID identifies the event flags.
Definition at line 272 of file cmsis_os2.h.
| typedef void* osMemoryPoolId_t |
Memory Pool ID identifies the memory pool.
Definition at line 281 of file cmsis_os2.h.
| typedef void* osMessageQueueId_t |
Message Queue ID identifies the message queue.
Definition at line 284 of file cmsis_os2.h.
| typedef void* osMutexId_t |
Mutex ID identifies the mutex.
Definition at line 275 of file cmsis_os2.h.
| typedef void* osSemaphoreId_t |
Semaphore ID identifies the semaphore.
Definition at line 278 of file cmsis_os2.h.
| typedef void(* osThreadFunc_t) (void *argument) |
Entry point of a thread.
Definition at line 189 of file cmsis_os2.h.
| typedef void* osThreadId_t |
Thread ID identifies the thread.
Definition at line 266 of file cmsis_os2.h.
| typedef void(* osTimerFunc_t) (void *argument) |
Timer callback function.
Definition at line 192 of file cmsis_os2.h.
| typedef void* osTimerId_t |
Timer ID identifies the timer.
Definition at line 269 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 290 of file cmsis_os2.h.
| enum osKernelState_t |
Kernel state.
Definition at line 110 of file cmsis_os2.h.
| enum osPriority_t |
Priority values.
Definition at line 132 of file cmsis_os2.h.
| enum osStatus_t |
Status code values returned by CMSIS-RTOS functions.
Definition at line 252 of file cmsis_os2.h.
| enum osThreadState_t |
Thread state.
Definition at line 121 of file cmsis_os2.h.
| enum osTimerType_t |
Timer type.
| Enumerator | |
|---|---|
| osTimerOnce | One-shot timer. |
| osTimerPeriodic | Repeating timer. |
Definition at line 195 of file cmsis_os2.h.
| osStatus_t osDelay | ( | uint32_t | ticks | ) |
Wait for Timeout (Time Delay).
| [in] | ticks | time ticks value |
Definition at line 1064 of file cmsis_os2_stk.cpp.
References CmsisTimeoutToStk(), IsIrqContext(), osError, osErrorISR, osKernelGetState(), osKernelInactive, osOK, and stk::Sleep().
| osStatus_t osDelayUntil | ( | uint32_t | ticks | ) |
Wait until specified time.
| [in] | ticks | absolute time in ticks |
Definition at line 1077 of file cmsis_os2_stk.cpp.
References IsIrqContext(), osError, osErrorISR, osKernelGetState(), osKernelInactive, osOK, and stk::SleepUntil().
| 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 1203 of file cmsis_os2_stk.cpp.
References osFlagsError, osFlagsErrorParameter, and StkFlagsResultToCmsis().
| osStatus_t osEventFlagsDelete | ( | osEventFlagsId_t | ef_id | ) |
Delete an Event Flags object.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
Definition at line 1232 of file cmsis_os2_stk.cpp.
References IsIrqContext(), ObjDestroy(), 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 1212 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 1186 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 1173 of file cmsis_os2_stk.cpp.
References osEventFlagsAttr_t::cb_mem, osEventFlagsAttr_t::cb_size, IsIrqContext(), osEventFlagsAttr_t::name, and PlacementNewOrHeap().
| 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 1194 of file cmsis_os2_stk.cpp.
References osFlagsError, osFlagsErrorParameter, and StkFlagsResultToCmsis().
| 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 1220 of file cmsis_os2_stk.cpp.
References CmsisFlagsOptionsToStk(), CmsisTimeoutToStk(), osFlagsError, osFlagsErrorParameter, and StkFlagsResultToCmsis().
| void osFaultResume | ( | void | ) |
Resume normal operation when exiting exception faults.
| 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. |
| 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 519 of file cmsis_os2_stk.cpp.
References osVersion_t::api, osVersion_t::kernel, osOK, 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 542 of file cmsis_os2_stk.cpp.
References g_StkKernel, g_StkKernelLocked, osKernelError, osKernelInactive, osKernelLocked, osKernelReady, osKernelRunning, osKernelSuspended, stk::IKernel::STATE_INACTIVE, stk::IKernel::STATE_READY, stk::IKernel::STATE_RUNNING, and stk::IKernel::STATE_SUSPENDED.
Referenced by osDelay(), osDelayUntil(), osKernelGetTickCount(), osKernelGetTickFreq(), osKernelInitialize(), osKernelResume(), osKernelStart(), osKernelSuspend(), osThreadEnumerate(), osThreadGetCount(), osThreadGetId(), osThreadNew(), osThreadResume(), osThreadSuspend(), osThreadTerminate(), osThreadYield(), and osTimerNew().
| uint32_t osKernelGetSysTimerCount | ( | void | ) |
Get the RTOS kernel system timer count.
Definition at line 659 of file cmsis_os2_stk.cpp.
References stk::GetSysTimerCount().
| uint64_t osKernelGetSysTimerCount64 | ( | void | ) |
Get the RTOS kernel system timer count.
Definition at line 664 of file cmsis_os2_stk.cpp.
References stk::GetSysTimerCount().
| uint32_t osKernelGetSysTimerFreq | ( | void | ) |
Get the RTOS kernel system timer frequency.
Definition at line 669 of file cmsis_os2_stk.cpp.
References stk::GetSysTimerFrequency().
| uint32_t osKernelGetTickCount | ( | void | ) |
Get the RTOS kernel tick count.
Definition at line 639 of file cmsis_os2_stk.cpp.
References stk::GetTicks(), osKernelGetState(), and osKernelInactive.
| uint32_t osKernelGetTickFreq | ( | void | ) |
Get the RTOS kernel tick frequency.
Definition at line 647 of file cmsis_os2_stk.cpp.
References stk::GetTickResolution(), osKernelGetState(), and osKernelInactive.
| osStatus_t osKernelInitialize | ( | void | ) |
Initialize the RTOS Kernel.
Definition at line 507 of file cmsis_os2_stk.cpp.
References g_StkKernel, IsIrqContext(), osError, osErrorISR, osKernelGetState(), osKernelInactive, and osOK.
| int32_t osKernelLock | ( | void | ) |
Lock the RTOS Kernel scheduler.
Definition at line 571 of file cmsis_os2_stk.cpp.
References stk::hw::CriticalSection::Enter(), g_StkKernelLocked, IsIrqContext(), and osErrorISR.
| osStatus_t osKernelProtect | ( | uint32_t | safety_class | ) |
Protect the RTOS Kernel scheduler access.
| [in] | safety_class | safety class. |
| 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 593 of file cmsis_os2_stk.cpp.
References stk::hw::CriticalSection::Enter(), stk::hw::CriticalSection::Exit(), g_StkKernelLocked, IsIrqContext(), osErrorISR, and osErrorResource.
| 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 628 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 557 of file cmsis_os2_stk.cpp.
References g_StkKernel, IsIrqContext(), osError, osErrorISR, osKernelGetState(), osKernelReady, and osOK.
| uint32_t osKernelSuspend | ( | void | ) |
Suspend the RTOS Kernel scheduler.
Definition at line 615 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.
Definition at line 581 of file cmsis_os2_stk.cpp.
References stk::hw::CriticalSection::Exit(), g_StkKernelLocked, IsIrqContext(), osErrorISR, and osErrorResource.
| 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 1454 of file cmsis_os2_stk.cpp.
References CmsisTimeoutToStk(), and IsIrqContext().
| osStatus_t osMemoryPoolDelete | ( | osMemoryPoolId_t | mp_id | ) |
Delete a Memory Pool object.
| [in] | mp_id | memory pool ID obtained by osMemoryPoolNew. |
Definition at line 1509 of file cmsis_os2_stk.cpp.
References IsIrqContext(), ObjDestroy(), 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 1466 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 1485 of file cmsis_os2_stk.cpp.
References StkMemPool::m_mpool.
| 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 1477 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 1493 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 1446 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 1501 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 1400 of file cmsis_os2_stk.cpp.
References osMemoryPoolAttr_t::cb_mem, osMemoryPoolAttr_t::cb_size, IsIrqContext(), StkMemPool::m_mpool, osMemoryPoolAttr_t::mp_mem, osMemoryPoolAttr_t::mp_size, osMemoryPoolAttr_t::name, ObjDestroy(), and PlacementNewOrHeap().
| osStatus_t osMessageQueueDelete | ( | osMessageQueueId_t | mq_id | ) |
Delete a Message Queue object.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 1650 of file cmsis_os2_stk.cpp.
References IsIrqContext(), ObjDestroy(), 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 1589 of file cmsis_os2_stk.cpp.
References CmsisTimeoutToStk(), IsIrqContext(), stk::NO_WAIT, osErrorISR, osErrorParameter, osErrorResource, osErrorTimeout, 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 1608 of file cmsis_os2_stk.cpp.
References stk::sync::MessageQueue::GetCapacity(), and StkMessageQueue::m_mq.
| 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 1624 of file cmsis_os2_stk.cpp.
References stk::sync::MessageQueue::GetCount(), and StkMessageQueue::m_mq.
| 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 1616 of file cmsis_os2_stk.cpp.
References stk::sync::MessageQueue::GetMsgSize(), and StkMessageQueue::m_mq.
| 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 1565 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 1632 of file cmsis_os2_stk.cpp.
References stk::sync::MessageQueue::GetSpace(), and StkMessageQueue::m_mq.
| 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 1524 of file cmsis_os2_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, osMessageQueueAttr_t::cb_mem, osMessageQueueAttr_t::cb_size, stk::sync::MessageQueue::GetBuffer(), IsIrqContext(), StkMessageQueue::m_mq, osMessageQueueAttr_t::mq_mem, osMessageQueueAttr_t::mq_size, osMessageQueueAttr_t::name, ObjDestroy(), and PlacementNewOrHeap().
| 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 1573 of file cmsis_os2_stk.cpp.
References CmsisTimeoutToStk(), IsIrqContext(), stk::NO_WAIT, osErrorISR, osErrorParameter, osErrorResource, osErrorTimeout, and osOK.
| 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 1640 of file cmsis_os2_stk.cpp.
References IsIrqContext(), 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 1269 of file cmsis_os2_stk.cpp.
References CmsisTimeoutToStk(), IsIrqContext(), StkMutex::m_mutex, stk::NO_WAIT, osErrorISR, osErrorParameter, osErrorResource, osErrorTimeout, osOK, and stk::sync::Mutex::TimedLock().
| osStatus_t osMutexDelete | ( | osMutexId_t | mutex_id | ) |
Delete a Mutex object.
| [in] | mutex_id | mutex ID obtained by osMutexNew. |
Definition at line 1309 of file cmsis_os2_stk.cpp.
References IsIrqContext(), ObjDestroy(), 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 1261 of file cmsis_os2_stk.cpp.
| 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 1297 of file cmsis_os2_stk.cpp.
| osMutexId_t osMutexNew | ( | const osMutexAttr_t * | attr | ) |
Create and Initialize a Mutex object.
| [in] | attr | mutex attributes; NULL: default values. |
Definition at line 1246 of file cmsis_os2_stk.cpp.
References osMutexAttr_t::cb_mem, osMutexAttr_t::cb_size, IsIrqContext(), osMutexAttr_t::name, and PlacementNewOrHeap().
| 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 1286 of file cmsis_os2_stk.cpp.
References IsIrqContext(), osErrorISR, osErrorParameter, and osOK.
| 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 1352 of file cmsis_os2_stk.cpp.
References CmsisTimeoutToStk(), IsIrqContext(), StkSemaphore::m_semaphore, stk::NO_WAIT, osErrorISR, osErrorParameter, osErrorResource, osErrorTimeout, osOK, and stk::sync::Semaphore::Wait().
| osStatus_t osSemaphoreDelete | ( | osSemaphoreId_t | semaphore_id | ) |
Delete a Semaphore object.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 1386 of file cmsis_os2_stk.cpp.
References IsIrqContext(), ObjDestroy(), 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 1378 of file cmsis_os2_stk.cpp.
References stk::sync::Semaphore::GetCount(), and StkSemaphore::m_semaphore.
| const char * osSemaphoreGetName | ( | osSemaphoreId_t | semaphore_id | ) |
Get name of a Semaphore object.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 1344 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 1323 of file cmsis_os2_stk.cpp.
References osSemaphoreAttr_t::cb_mem, osSemaphoreAttr_t::cb_size, stk::sync::Semaphore::COUNT_MAX, IsIrqContext(), stk::Min(), osSemaphoreAttr_t::name, and PlacementNewOrHeap().
| 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 1369 of file cmsis_os2_stk.cpp.
References osErrorParameter, 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 872 of file cmsis_os2_stk.cpp.
References StkThread::Detached, StkThread::Exited, IsIrqContext(), StkThread::Joinable, StkThread::Joined, StkThread::m_join_state, ObjDestroy(), 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 996 of file cmsis_os2_stk.cpp.
References g_StkKernel, osKernelGetState(), and osKernelInactive.
| void osThreadExit | ( | void | ) |
Terminate execution of current running thread.
Definition at line 949 of file cmsis_os2_stk.cpp.
References __NO_RETURN, g_StkKernel, osThreadGetId(), and stk::Yield().
| 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 |
| 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 1021 of file cmsis_os2_stk.cpp.
References stk::sync::EventFlags::Clear(), StkThread::m_thread_flags, osFlagsErrorUnknown, osThreadGetId(), and StkFlagsResultToCmsis().
| uint32_t osThreadFlagsGet | ( | void | ) |
Get the current Thread Flags of current running thread.
Definition at line 1033 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 1010 of file cmsis_os2_stk.cpp.
References StkThread::m_thread_flags, osFlagsError, osFlagsErrorParameter, stk::sync::EventFlags::Set(), and StkFlagsResultToCmsis().
| 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 1042 of file cmsis_os2_stk.cpp.
References CmsisFlagsOptionsToStk(), CmsisTimeoutToStk(), IsIrqContext(), StkThread::m_thread_flags, osFlagsErrorISR, osFlagsErrorUnknown, osThreadGetId(), StkFlagsResultToCmsis(), and stk::sync::EventFlags::Wait().
| 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. |
| uint32_t osThreadGetClass | ( | osThreadId_t | thread_id | ) |
Get safety class of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
| uint32_t osThreadGetCount | ( | void | ) |
Get number of active threads.
Definition at line 985 of file cmsis_os2_stk.cpp.
References g_StkKernel, osKernelGetState(), and osKernelInactive.
| osThreadId_t osThreadGetId | ( | void | ) |
Return the thread ID of the current running thread.
Definition at line 761 of file cmsis_os2_stk.cpp.
References stk::GetTid(), IsIrqContext(), osKernelGetState(), and osKernelInactive.
Referenced by osThreadExit(), osThreadFlagsClear(), osThreadFlagsGet(), osThreadFlagsWait(), osThreadGetState(), and osThreadJoin().
| 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 753 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 822 of file cmsis_os2_stk.cpp.
References IsIrqContext(), StkThread::m_stk_priority, osPriorityError, and StkPrioToCmsis().
| 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 790 of file cmsis_os2_stk.cpp.
References StkThread::GetStackSizeBytes().
| 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 799 of file cmsis_os2_stk.cpp.
References stk::IStackMemory::GetStackSpace().
| 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 774 of file cmsis_os2_stk.cpp.
References IsIrqContext(), StkThread::m_suspended, 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. |
References __NO_RETURN.
| 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 907 of file cmsis_os2_stk.cpp.
References StkThread::Detached, StkThread::Exited, IsIrqContext(), StkThread::Joined, StkThread::m_join_cv, StkThread::m_join_state, ObjDestroy(), osError, osErrorISR, osErrorParameter, osOK, osThreadGetId(), stk::sync::ConditionVariable::Wait(), and stk::WAIT_INFINITE.
| 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 679 of file cmsis_os2_stk.cpp.
References osThreadAttr_t::attr_bits, osThreadAttr_t::cb_mem, osThreadAttr_t::cb_size, CMSIS_STK_DEFAULT_STACK_WORDS, CMSIS_STK_MIN_STACK_WORDS, CmsisPrioToStk(), StkThread::Detached, g_StkKernel, IsIrqContext(), StkThread::Joinable, StkThread::m_argument, StkThread::m_func, StkThread::m_join_state, StkThread::m_name, StkThread::m_stack, StkThread::m_stack_owned, StkThread::m_stack_size, StkThread::m_stk_priority, osThreadAttr_t::name, ObjDestroy(), osKernelGetState(), osKernelInactive, osPriorityIdle, osPriorityISR, osPriorityNone, osPriorityNormal, osThreadJoinable, PlacementNewOrHeap(), osThreadAttr_t::priority, osThreadAttr_t::stack_mem, and osThreadAttr_t::stack_size.
| osStatus_t osThreadProtectPrivileged | ( | void | ) |
Protect creation of privileged threads.
| 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 854 of file cmsis_os2_stk.cpp.
References g_StkKernel, IsIrqContext(), StkThread::m_suspended, osErrorISR, osErrorParameter, osKernelGetState(), osKernelInactive, and osOK.
| 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. |
| 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. |
| 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 808 of file cmsis_os2_stk.cpp.
References CmsisPrioToStk(), IsIrqContext(), StkThread::m_stk_priority, osErrorISR, osErrorParameter, osOK, osPriorityIdle, and osPriorityISR.
| 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 842 of file cmsis_os2_stk.cpp.
References g_StkKernel, IsIrqContext(), StkThread::m_suspended, osErrorISR, osErrorParameter, osKernelGetState(), osKernelInactive, and osOK.
| 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. |
| 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 960 of file cmsis_os2_stk.cpp.
References StkThread::Detached, g_StkKernel, StkThread::m_join_state, ObjDestroy(), osErrorParameter, osKernelGetState(), osKernelInactive, and osOK.
| osStatus_t osThreadTerminateZone | ( | uint32_t | zone | ) |
Terminate execution of threads assigned to a specified MPU protected zone.
| [in] | zone | MPU protected zone. |
| osStatus_t osThreadYield | ( | void | ) |
Pass control to next thread that is in state READY.
Definition at line 831 of file cmsis_os2_stk.cpp.
References IsIrqContext(), osError, osErrorISR, osKernelGetState(), osKernelInactive, osOK, and stk::Yield().
| osStatus_t osTimerDelete | ( | osTimerId_t | timer_id | ) |
Delete a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 1154 of file cmsis_os2_stk.cpp.
References g_TimerHost, stk::time::TimerHost::Timer::IsActive(), IsIrqContext(), ObjDestroy(), osErrorISR, osErrorParameter, and osOK.
| const char * osTimerGetName | ( | osTimerId_t | timer_id | ) |
Get name of a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 1110 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 1146 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 1093 of file cmsis_os2_stk.cpp.
References osTimerAttr_t::cb_mem, osTimerAttr_t::cb_size, StkTimer::EnsureTimerHostCreated(), IsIrqContext(), osTimerAttr_t::name, osKernelGetState(), osKernelInactive, and PlacementNewOrHeap().
| 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 1118 of file cmsis_os2_stk.cpp.
References g_TimerHost, IsIrqContext(), StkTimer::m_period_ticks, StkTimer::m_type, osError, osErrorISR, osErrorParameter, osOK, and osTimerPeriodic.
| osStatus_t osTimerStop | ( | osTimerId_t | timer_id | ) |
Stop a timer.
| [in] | timer_id | timer ID obtained by osTimerNew. |
Definition at line 1132 of file cmsis_os2_stk.cpp.
References g_TimerHost, stk::time::TimerHost::Timer::IsActive(), IsIrqContext(), osError, osErrorISR, osErrorParameter, osErrorResource, and osOK.
| uint32_t osWatchdogAlarm_Handler | ( | osThreadId_t | thread_id | ) |
Handler for expired thread watchdogs.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
| void osZoneSetup_Callback | ( | uint32_t | zone | ) |
Setup MPU protected zone (called when zone changes).
| [in] | zone | zone number. |