- CMSIS
- Overview
- Summary
- Data Structures
- Macros
- Typedefs
- Enumerations
- Functions
- Details
- Macro Definition Documentation
- osFlagsError
- osFlagsErrorParameter
- osFlagsErrorResource
- osFlagsErrorTimeout
- osFlagsErrorUnknown
- osFlagsNoClear
- osFlagsWaitAll
- osFlagsWaitAny
- osNoWait
- osWaitForever
- Typedef Documentation
- osEventFlagsId_t
- osMessageQueueId_t
- osMutexId_t
- osSemaphoreId_t
- osThreadFunc_t
- osThreadId_t
- osTimerFunc_t
- osTimerId_t
- TZ_ModuleId_t
- Enumeration Type Documentation
- os_timer_align_type
- os_timer_rouses_type
- osKernelState_t
- osPriority_t
- osStatus_t
- osThreadState_t
- osTimerType_t
- Function Documentation
- osDelay()
- osDelayUntil()
- osEventFlagsClear()
- osEventFlagsDelete()
- osEventFlagsGet()
- osEventFlagsNew()
- osEventFlagsSet()
- osEventFlagsWait()
- osKernelGetInfo()
- osKernelGetState()
- osKernelGetSysTimerCount()
- osKernelGetSysTimerFreq()
- osKernelGetTickFreq()
- osKernelInitialize()
- osKernelLock()
- osKernelRestoreLock()
- osKernelStart()
- osKernelUnlock()
- osMessageQueueDelete()
- osMessageQueueGet()
- osMessageQueueGetCapacity()
- osMessageQueueGetCount()
- osMessageQueueGetMsgSize()
- osMessageQueueGetSpace()
- osMessageQueueNew()
- osMessageQueuePut()
- osMutexAcquire()
- osMutexDelete()
- osMutexGetOwner()
- osMutexNew()
- osMutexRelease()
- osSemaphoreAcquire()
- osSemaphoreDelete()
- osSemaphoreGetCount()
- osSemaphoreNew()
- osSemaphoreRelease()
- osThreadGetCount()
- osThreadGetId()
- osThreadGetName()
- osThreadGetPriority()
- osThreadGetStackSize()
- osThreadGetStackSpace()
- osThreadGetState()
- osThreadNew()
- osThreadResume()
- osThreadSetPriority()
- osThreadSuspend()
- osThreadTerminate()
- osThreadYield()
- osTimerDelete()
- osTimerIsRunning()
- osTimerNew()
- osTimerStart()
- osTimerStop()
- Variable Documentation
- api
- attr_bits [1/6]
- attr_bits [2/6]
- attr_bits [3/6]
- attr_bits [4/6]
- attr_bits [5/6]
- attr_bits [6/6]
- cb_mem [1/6]
- cb_mem [2/6]
- cb_mem [3/6]
- cb_mem [4/6]
- cb_mem [5/6]
- cb_mem [6/6]
- cb_size [1/6]
- cb_size [2/6]
- cb_size [3/6]
- cb_size [4/6]
- cb_size [5/6]
- cb_size [6/6]
- kernel
- mq_mem
- mq_size
- name [1/6]
- name [2/6]
- name [3/6]
- name [4/6]
- name [5/6]
- name [6/6]
- priority
- reserved
- stack_mem
- stack_size
- tz_module
CMSIS
Overview
Provides standard, universal real-time operating system (RTOS) APIs.
These APIs comply with ARM CMSIS and are used for thread management, timer management, inter-process communications, and semaphores.
Since:
1.0
Version:
1.0
Summary
Data Structures
Macros
osWaitForever 0xFFFFFFFFU |
Indicates that the RTOS waits forever unless an event flag is received. |
osNoWait 0x0U |
|
osFlagsWaitAny 0x00000000U |
Indicates that the RTOS waits until any event flag is triggered. |
osFlagsWaitAll 0x00000001U |
Indicates that the system waits until all event flags are triggered. |
osFlagsNoClear 0x00000002U |
|
osFlagsError 0x80000000U |
|
osFlagsErrorUnknown 0xFFFFFFFFU |
|
osFlagsErrorTimeout 0xFFFFFFFEU |
|
osFlagsErrorResource 0xFFFFFFFDU |
|
osFlagsErrorParameter 0xFFFFFFFCU |
Typedefs
osThreadFunc_t) (void argument) |
|
osTimerFunc_t) (void argument) |
|
Enumerations
Functions
osKernelInitialize (void) |
|
osKernelGetInfo (osVersion_t version, char id_buf, uint32_t id_size) |
|
osKernelGetState (void) |
|
osKernelStart (void) |
|
osKernelLock (void) |
|
osKernelUnlock (void) |
|
osKernelRestoreLock (int32_t lock) |
|
osKernelGetTickFreq (void) |
|
osKernelGetSysTimerCount (void) |
|
osKernelGetSysTimerFreq (void) |
|
osThreadNew (osThreadFunc_t func, void argument, const osThreadAttr_t attr) |
|
osThreadGetName (osThreadId_t thread_id) |
|
osThreadGetId (void) |
|
osThreadGetState (osThreadId_t thread_id) |
|
osThreadGetStackSize (osThreadId_t thread_id) |
|
osThreadGetStackSpace (osThreadId_t thread_id) |
Obtains the size of the available stack space for a thread based on the stack watermark. |
osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority) |
|
osThreadGetPriority (osThreadId_t thread_id) |
|
osThreadYield (void) |
|
osThreadSuspend (osThreadId_t thread_id) |
|
osThreadResume (osThreadId_t thread_id) |
|
osThreadTerminate (osThreadId_t thread_id) |
|
osThreadGetCount (void) |
|
osDelay (uint32_t ticks) |
|
osDelayUntil (uint64_t ticks) |
|
osTimerNew (osTimerFunc_t func, osTimerType_t type, void argument, const osTimerAttr_t attr) |
|
osTimerStart (osTimerId_t timer_id, uint32_t ticks) |
|
osTimerStop (osTimerId_t timer_id) |
|
osTimerIsRunning (osTimerId_t timer_id) |
|
osTimerDelete (osTimerId_t timer_id) |
|
osEventFlagsNew (const osEventFlagsAttr_t attr) |
|
osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) |
|
osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags) |
|
osEventFlagsGet (osEventFlagsId_t ef_id) |
|
osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout) |
|
osEventFlagsDelete (osEventFlagsId_t ef_id) |
|
osMutexNew (const osMutexAttr_t attr) |
|
osMutexAcquire (osMutexId_t mutex_id, uint32_t timeout) |
|
osMutexRelease (osMutexId_t mutex_id) |
|
osMutexGetOwner (osMutexId_t mutex_id) |
|
osMutexDelete (osMutexId_t mutex_id) |
|
osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t attr) |
|
osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout) |
|
osSemaphoreRelease (osSemaphoreId_t semaphore_id) |
|
osSemaphoreGetCount (osSemaphoreId_t semaphore_id) |
Obtains the number of available tokens of a semaphore object. |
osSemaphoreDelete (osSemaphoreId_t semaphore_id) |
|
osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t attr) |
|
osMessageQueuePut (osMessageQueueId_t mq_id, const void msg_ptr, uint8_t msg_prio, uint32_t timeout) |
|
osMessageQueueGet (osMessageQueueId_t mq_id, void msg_ptr, uint8_t msg_prio, uint32_t timeout) |
|
Obtains the maximum number of messages that can be placed in a message queue. |
|
Obtains the maximum size of messages that can be placed in a message queue. |
|
Obtains the number of available slots for messages in a message queue. |
|
Details
Macro Definition Documentation
osFlagsError
#define osFlagsError 0x80000000U
Description:
Indicates a flag error.
osFlagsErrorParameter
#define osFlagsErrorParameter 0xFFFFFFFCU
Description:
Indicates an incorrect parameter.
osFlagsErrorResource
#define osFlagsErrorResource 0xFFFFFFFDU
Description:
Indicates a resource error.
osFlagsErrorTimeout
#define osFlagsErrorTimeout 0xFFFFFFFEU
Description:
Indicates a timeout.
osFlagsErrorUnknown
#define osFlagsErrorUnknown 0xFFFFFFFFU
Description:
Indicates an unknown error.
osFlagsNoClear
#define osFlagsNoClear 0x00000002U
Description:
Indicates that defined flags are not cleared.
osFlagsWaitAll
#define osFlagsWaitAll 0x00000001U
Description:
Indicates that the system waits until all event flags are triggered.
osFlagsWaitAny
#define osFlagsWaitAny 0x00000000U
Description:
Indicates that the RTOS waits until any event flag is triggered.
osNoWait
#define osNoWait 0x0U
Description:
Indicates that the RTOS does not wait.
osWaitForever
#define osWaitForever 0xFFFFFFFFU
Description:
Indicates that the RTOS waits forever unless an event flag is received.
Typedef Documentation
osEventFlagsId_t
typedef void* [osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd)
Description:
Identifies an event flag.
osMessageQueueId_t
typedef void* [osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317)
Description:
Identifies a message queue.
osMutexId_t
typedef void* [osMutexId_t]($api-api-LinkIoT-CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7)
Description:
Identifies a mutex.
osSemaphoreId_t
typedef void* [osSemaphoreId_t]($api-api-LinkIoT-CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1)
Description:
Identifies a semaphore object.
osThreadFunc_t
typedef void(* osThreadFunc_t) (void *argument)
Description:
Callback for thread scheduling.
osThreadId_t
typedef void* [osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217)
Description:
Identifies a thread.
osTimerFunc_t
typedef void(* osTimerFunc_t) (void *argument)
Description:
Callback for timer triggering.
osTimerId_t
typedef void* [osTimerId_t]($api-api-LinkIoT-CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44)
Description:
Identifies a timer.
TZ_ModuleId_t
typedef uint32_t [TZ_ModuleId_t]($api-api-LinkIoT-CMSIS.md#gad5ef21485fe5f60263bc0b48006202cb)
Description:
Identifies a TrustZone module call process.
Enumeration Type Documentation
os_timer_align_type
enum [os_timer_align_type]($api-api-LinkIoT-CMSIS.md#ga3d617b70715d7fb2c7c6f06809ee3913)
Description:
Enumerates timer alignment modes.
osTimerAlignIgnore | |
osTimerAlignAllow |
os_timer_rouses_type
enum [os_timer_rouses_type]($api-api-LinkIoT-CMSIS.md#ga6274cbe33c6db824bbc40dc6eaa8e578)
Description:
Enumerates timer permissions.
osTimerRousesIgnore | |
osTimerRousesAllow |
osKernelState_t
enum [osKernelState_t]($api-api-LinkIoT-CMSIS.md#ga08326469274b668140ca934b168a5ad4)
Description:
Enumerates kernel states.
osKernelInactive | |
osKernelReady | |
osKernelRunning | |
osKernelLocked | |
osKernelSuspended | |
osKernelError | |
osKernelReserved |
osPriority_t
enum [osPriority_t]($api-api-LinkIoT-CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec)
Description:
Enumerates thread priorities.
osStatus_t
enum [osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e)
Description:
Enumerates return values of CMSIS-RTOS.
osOK | |
osError | |
osErrorTimeout | |
osErrorResource | |
osErrorParameter | |
osErrorNoMemory | |
osErrorISR | Service interruption |
osStatusReserved | Reserved. It is used to prevent the compiler from optimizing enumerations. |
osThreadState_t
enum [osThreadState_t]($api-api-LinkIoT-CMSIS.md#gad3dc89e942e38d9f3af858a0269a820d)
Description:
Enumerates thread states.
osThreadInactive | |
osThreadReady | |
osThreadRunning | |
osThreadBlocked | |
osThreadTerminated | |
osThreadError | |
osThreadReserved |
osTimerType_t
enum [osTimerType_t]($api-api-LinkIoT-CMSIS.md#ga7dc24a4c2b90334427081c3da7a71915)
Description:
Enumerates timer types.
osTimerOnce | |
osTimerPeriodic |
Function Documentation
osDelay()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osDelay (uint32_t ticks)
Description:
Waits for a period of time.
Parameters:
ticks | Indicates the number of ticks to wait for. |
Returns:
Returns the CMSIS-RTOS running result.
osDelayUntil()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osDelayUntil (uint64_t ticks)
Description:
Waits until a specified time arrives.
Parameters:
ticks | Indicates the number of ticks converted from the absolute time. |
Returns:
Returns the CMSIS-RTOS running result.
osEventFlagsClear()
uint32_t osEventFlagsClear ([osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) ef_id, uint32_t flags )
Description:
Clears event flags.
Parameters:
ef_id | Indicates the event flags ID, which is obtained using osEventFlagsNew. |
flags | Indicates the event flags to clear. |
Returns:
Returns the event flags; returns osFlagsErrorParameter in the case of an error.
osEventFlagsDelete()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osEventFlagsDelete ([osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) ef_id)
Description:
Deletes an event flags object.
Parameters:
ef_id | Indicates the event flags ID, which is obtained using osEventFlagsNew. |
Returns:
Returns the CMSIS-RTOS running result.
osEventFlagsGet()
uint32_t osEventFlagsGet ([osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) ef_id)
Description:
Obtains event flags.
Parameters:
ef_id | Indicates the event flags ID, which is obtained using osEventFlagsNew. |
Returns:
Returns the event flags triggered.
osEventFlagsNew()
[osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) osEventFlagsNew (const [osEventFlagsAttr_t]($api-api-LinkIoT-osEventFlagsAttr_t.md) * attr)
Description:
Creates and initializes an event flags object.
Parameters:
attr | Indicates the pointer to the event flags attributes. This parameter is not used. |
Returns:
Returns the event flags ID; returns NULL in the case of an error.
osEventFlagsSet()
uint32_t osEventFlagsSet ([osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) ef_id, uint32_t flags )
Description:
Sets event flags.
Parameters:
ef_id | Indicates the event flags ID, which is obtained using osEventFlagsNew. |
flags | Indicates the event flags to set. |
Returns:
Returns the event flags; returns osFlagsErrorParameter in the case of an error.
osEventFlagsWait()
uint32_t osEventFlagsWait ([osEventFlagsId_t]($api-api-LinkIoT-CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) ef_id, uint32_t flags, uint32_t options, uint32_t timeout )
Description:
Waits for event flags to trigger.
Parameters:
ef_id | Indicates the event flags ID, which is obtained using osEventFlagsNew. |
flags | Indicates the event flags to trigger. |
options | Indicates the configuration of the event flags to trigger. |
timeout | Indicates the timeout duration. |
Returns:
Returns the triggered event flags; returns an error value in the case of an error.
osKernelGetInfo()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osKernelGetInfo ([osVersion_t]($api-api-LinkIoT-osVersion_t.md) * version, char * id_buf, uint32_t id_size )
Description:
Obtains the system version and name.
Parameters:
version | Indicates the pointer to the buffer for storing the version. |
id_buf | Indicates the pointer to the buffer for storing the kernel ID. |
id_size | Indicates the size of the buffer for storing the kernel ID. |
Returns:
Returns the CMSIS-RTOS running result.
osKernelGetState()
[osKernelState_t]($api-api-LinkIoT-CMSIS.md#ga08326469274b668140ca934b168a5ad4) osKernelGetState (void )
Description:
Obtains the kernel state.
Returns:
Returns the kernel state.
osKernelGetSysTimerCount()
uint32_t osKernelGetSysTimerCount (void )
Description:
Obtains the kernel system timer.
Returns:
Returns the kernel system timer.
osKernelGetSysTimerFreq()
uint32_t osKernelGetSysTimerFreq (void )
Description:
Obtains the frequency of the system timer.
Returns:
Returns the system timer frequency.
osKernelGetTickFreq()
uint32_t osKernelGetTickFreq (void )
Description:
Obtains the number of kernel ticks per second.
Returns:
Returns the number of kernel ticks.
osKernelInitialize()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osKernelInitialize (void )
Description:
Initializes the RTOS kernel.
Returns:
Returns the CMSIS-RTOS running result.
osKernelLock()
int32_t osKernelLock (void )
Description:
Locks the kernel.
Returns:
Returns 1 if the kernel is locked successfully; returns 0 if the lock starts; returns a negative value in the case of an error.
osKernelRestoreLock()
int32_t osKernelRestoreLock (int32_t lock)
Description:
Restores the previous lock state of the kernel.
Parameters:
locks | Indicates the lock state to restore to. The value 1 indicates the locked state, and 0 indicates the unlocked state. |
Returns:
Returns 1 if the kernel is locked; returns 0 if the kernel is not locked; returns a negative value in the case of an error.
osKernelStart()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osKernelStart (void )
Description:
Starts the kernel.
Returns:
Returns the CMSIS-RTOS running result.
osKernelUnlock()
int32_t osKernelUnlock (void )
Description:
Unlocks the kernel.
Returns:
Returns 1 if the kernel is unlocked successfully; returns 0 if the kernel is not locked; returns a negative value in the case of an error.
osMessageQueueDelete()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMessageQueueDelete ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id)
Description:
Deletes a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
Returns:
Returns the CMSIS-RTOS running result.
osMessageQueueGet()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMessageQueueGet ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id, void * msg_ptr, uint8_t * msg_prio, uint32_t timeout )
Description:
Obtains a message in a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
msg_ptr | Indicates the pointer to the buffer for storing the message to be retrieved from the message queue. |
msg_prio | Indicates the pointer to the buffer for storing the priority of the message to be retrieved from the message queue. This parameter can be left empty. |
timeout | Indicates the timeout duration. |
Returns:
Returns the CMSIS-RTOS running result.
osMessageQueueGetCapacity()
uint32_t osMessageQueueGetCapacity ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id)
Description:
Obtains the maximum number of messages that can be placed in a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
Returns:
Returns the maximum number.
osMessageQueueGetCount()
uint32_t osMessageQueueGetCount ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id)
Description:
Obtains the number of queued messages in a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
Returns:
Returns the number of queued messages.
osMessageQueueGetMsgSize()
uint32_t osMessageQueueGetMsgSize ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id)
Description:
Obtains the maximum size of messages that can be placed in a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
Returns:
Returns the maximum message size.
osMessageQueueGetSpace()
uint32_t osMessageQueueGetSpace ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id)
Description:
Obtains the number of available slots for messages in a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
Returns:
Returns the number of available slots for messages.
osMessageQueueNew()
[osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const [osMessageQueueAttr_t]($api-api-LinkIoT-osMessageQueueAttr_t.md) * attr )
Description:
Creates and initializes a message queue.
Parameters:
msg_count | Indicates the number of messages in the message queue. |
msg_size | Indicates the size of messages in the message queue. |
attr | Indicates the pointer to the message queue attributes. This parameter is not used. |
Returns:
Returns the message queue ID; returns NULL in the case of an error.
osMessageQueuePut()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMessageQueuePut ([osMessageQueueId_t]($api-api-LinkIoT-CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) mq_id, const void * msg_ptr, uint8_t msg_prio, uint32_t timeout )
Description:
Places a message in a message queue.
Parameters:
osMessageQueueId_t | Indicates the message queue ID, which is obtained using osMessageQueueNew. |
msg_ptr | Indicates the pointer to the buffer for storing the message to be placed in the message queue. |
msg_prio | Indicates the priority of the message to be placed in the message queue. |
timeout | Indicates the timeout duration. |
Returns:
Returns the CMSIS-RTOS running result.
osMutexAcquire()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMutexAcquire ([osMutexId_t]($api-api-LinkIoT-CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7) mutex_id, uint32_t timeout )
Description:
Obtains a mutex.
Parameters:
mutex_id | Indicates the mutex ID, which is obtained using osMutexNew. |
timeout | Indicates the timeout duration. |
Returns:
Returns the CMSIS-RTOS running result.
osMutexDelete()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMutexDelete ([osMutexId_t]($api-api-LinkIoT-CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7) mutex_id)
Description:
Deletes a mutex.
Parameters:
mutex_id | Indicates the mutex ID, which is obtained using osMutexNew. |
Returns:
Returns the CMSIS-RTOS running result.
osMutexGetOwner()
[osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) osMutexGetOwner ([osMutexId_t]($api-api-LinkIoT-CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7) mutex_id)
Description:
Obtains the thread ID of the currently acquired mutex.
Parameters:
mutex_id | Indicates the mutex ID, which is obtained using osMutexNew. |
Returns:
Returns the thread ID.
osMutexNew()
[osMutexId_t]($api-api-LinkIoT-CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7) osMutexNew (const [osMutexAttr_t]($api-api-LinkIoT-osMutexAttr_t.md) * attr)
Description:
Creates and initializes a mutex.
Parameters:
attr | Indicates the pointer to the mutex attributes. This parameter is not used. |
Returns:
Returns the mutex ID; returns NULL in the case of an error.
osMutexRelease()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMutexRelease ([osMutexId_t]($api-api-LinkIoT-CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7) mutex_id)
Description:
Releases a mutex.
Parameters:
mutex_id | Indicates the mutex ID, which is obtained using osMutexNew. |
Returns:
Returns the CMSIS-RTOS running result.
osSemaphoreAcquire()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osSemaphoreAcquire ([osSemaphoreId_t]($api-api-LinkIoT-CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1) semaphore_id, uint32_t timeout )
Description:
Acquires a token of a semaphore object.
Parameters:
semaphore_id | Indicates the semaphore ID, which is obtained using osSemaphoreNew. |
timeout | Indicates the timeout duration. |
Returns:
Returns the CMSIS-RTOS running result.
osSemaphoreDelete()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osSemaphoreDelete ([osSemaphoreId_t]($api-api-LinkIoT-CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1) semaphore_id)
Description:
Deletes a semaphore object.
Parameters:
semaphore_id | Indicates the semaphore ID, which is obtained using osSemaphoreNew. |
Returns:
Returns the CMSIS-RTOS running result.
osSemaphoreGetCount()
uint32_t osSemaphoreGetCount ([osSemaphoreId_t]($api-api-LinkIoT-CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1) semaphore_id)
Description:
Obtains the number of available tokens of a semaphore object.
Parameters:
semaphore_id | Indicates the semaphore ID, which is obtained using osSemaphoreNew. |
Returns:
Returns the number of available tokens.
osSemaphoreNew()
[osSemaphoreId_t]($api-api-LinkIoT-CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1) osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const [osSemaphoreAttr_t]($api-api-LinkIoT-osSemaphoreAttr_t.md) * attr )
Description:
Creates and initializes a semaphore object.
Parameters:
max_count | Indicates the maximum number of available tokens that can be applied for. |
initial_count | Indicates the initial number of available tokens. |
attr | Indicates the pointer to the semaphore attributes. This parameter is not used. |
Returns:
Returns the semaphore ID; returns NULL in the case of an error.
osSemaphoreRelease()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osSemaphoreRelease ([osSemaphoreId_t]($api-api-LinkIoT-CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1) semaphore_id)
Description:
Releases a token of a semaphore object.
Parameters:
semaphore_id | Indicates the semaphore ID, which is obtained using osSemaphoreNew. |
Returns:
Returns the CMSIS-RTOS running result.
osThreadGetCount()
uint32_t osThreadGetCount (void )
Description:
Obtains the number of active threads.
Returns:
Returns the number; returns 0 in the case of an error.
osThreadGetId()
[osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) osThreadGetId (void )
Description:
Obtains the ID of the currently running thread.
Returns:
Returns the thread ID; returns NULL in the case of an error.
osThreadGetName()
const char* osThreadGetName ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Obtains the name of a thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the thread name; returns NULL in the case of an error.
osThreadGetPriority()
[osPriority_t]($api-api-LinkIoT-CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec) osThreadGetPriority ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Gets the prority of an active thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the prority of the thread.
osThreadGetStackSize()
uint32_t osThreadGetStackSize ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Obtains the stack size of a thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the stack size, in bytes; returns 0 in the case of an error.
osThreadGetStackSpace()
uint32_t osThreadGetStackSpace ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Obtains the size of the available stack space for a thread based on the stack watermark.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the available stack size, in bytes; returns 0 in the case of an error.
osThreadGetState()
[osThreadState_t]($api-api-LinkIoT-CMSIS.md#gad3dc89e942e38d9f3af858a0269a820d) osThreadGetState ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Obtains the state of a thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the thread state.
osThreadNew()
[osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) osThreadNew ([osThreadFunc_t]($api-api-LinkIoT-CMSIS.md#ga8ef2773ed8ef63ab8727e0d06ebec4d2) func, void * argument, const [osThreadAttr_t]($api-api-LinkIoT-osThreadAttr_t.md) * attr )
Description:
Creates an active thread.
Parameters:
func | Indicates the entry of the thread callback function. |
argument | Indicates the pointer to the argument passed to the thread. |
attr | Indicates the thread attributes. If this parameter is left unspecified, the default value 0 is used. |
Returns:
Returns the thread ID; returns NULL in the case of an error.
osThreadResume()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadResume ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Resumes a thread from the suspended state.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the CMSIS-RTOS running result.
osThreadSetPriority()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadSetPriority ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id, [osPriority_t]($api-api-LinkIoT-CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec) priority )
Description:
Changes the priority of a thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
priority | Indicates the new priority. |
Returns:
Returns the CMSIS-RTOS running result.
osThreadSuspend()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadSuspend ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Suspends a thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the CMSIS-RTOS running result.
osThreadTerminate()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadTerminate ([osThreadId_t]($api-api-LinkIoT-CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id)
Description:
Terminates a thread.
Parameters:
thread_id | Indicates the thread ID, which is obtained using osThreadNew or osThreadGetId. |
Returns:
Returns the CMSIS-RTOS running result.
osThreadYield()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadYield (void )
Description:
Sets the currently running thread to the ready state.
Returns:
Returns the CMSIS-RTOS running result.
osTimerDelete()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osTimerDelete ([osTimerId_t]($api-api-LinkIoT-CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44) timer_id)
Description:
Deletes a timer.
Parameters:
timer_id | Indicates the timer ID, which is obtained using osTimerNew. |
Returns:
Returns the CMSIS-RTOS running result.
osTimerIsRunning()
uint32_t osTimerIsRunning ([osTimerId_t]($api-api-LinkIoT-CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44) timer_id)
Description:
Checks whether a timer is running.
Parameters:
timer_id | Indicates the timer ID, which is obtained using osTimerNew. |
Returns:
Returns 1 if the timer is running; returns 0 otherwise.
osTimerNew()
[osTimerId_t]($api-api-LinkIoT-CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44) osTimerNew ([osTimerFunc_t]($api-api-LinkIoT-CMSIS.md#ga77a298218f3c8382b39a09a6d134d040) func, [osTimerType_t]($api-api-LinkIoT-CMSIS.md#ga7dc24a4c2b90334427081c3da7a71915) type, void * argument, const [osTimerAttr_t]($api-api-LinkIoT-osTimerAttr_t.md) * attr )
Description:
Creates and initializes a timer.
Parameters:
func | Indicates the entry of the timer callback function. |
type | Indicates the timer type. |
argument | Indicates the pointer to the argument used in timer callback. |
attr | Indicates the pointer to the timer attributes. This parameter is not used. |
Returns:
Returns the timer ID; returns NULL in the case of an error.
osTimerStart()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osTimerStart ([osTimerId_t]($api-api-LinkIoT-CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44) timer_id, uint32_t ticks )
Description:
Starts or restarts a timer.
Parameters:
timer_id | Indicates the timer ID, which is obtained using osTimerNew. |
ticks | Indicates the number of ticks since the timer starts running. |
Returns:
Returns the CMSIS-RTOS running result.
osTimerStop()
[osStatus_t]($api-api-LinkIoT-CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osTimerStop ([osTimerId_t]($api-api-LinkIoT-CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44) timer_id)
Description:
Stops a timer.
Parameters:
timer_id | Indicates the timer ID, which is obtained using osTimerNew. |
Returns:
Returns the CMSIS-RTOS running result.
Variable Documentation
api
uint32_t osVersion_t::api
Description:
API version
attr_bits [1/6]
uint32_t osThreadAttr_t::attr_bits
Description:
Thread attribute bits
attr_bits [2/6]
uint32_t osTimerAttr_t::attr_bits
Description:
Reserved attribute bits
attr_bits [3/6]
uint32_t osEventFlagsAttr_t::attr_bits
Description:
Reserved attribute bits
attr_bits [4/6]
uint32_t osMutexAttr_t::attr_bits
Description:
Reserved attribute bits
attr_bits [5/6]
uint32_t osSemaphoreAttr_t::attr_bits
Description:
Reserved attribute bits
attr_bits [6/6]
uint32_t osMessageQueueAttr_t::attr_bits
Description:
Reserved attribute bits
cb_mem [1/6]
void* osThreadAttr_t::cb_mem
Description:
Memory for the thread control block
cb_mem [2/6]
void* osTimerAttr_t::cb_mem
Description:
Memory for the timer control block
cb_mem [3/6]
void* osEventFlagsAttr_t::cb_mem
Description:
Memory for the event control block
cb_mem [4/6]
void* osMutexAttr_t::cb_mem
Description:
Memory for the mutex control block
cb_mem [5/6]
void* osSemaphoreAttr_t::cb_mem
Description:
Memory for the semaphore control block
cb_mem [6/6]
void* osMessageQueueAttr_t::cb_mem
Description:
Memory for the message queue control block
cb_size [1/6]
uint32_t osThreadAttr_t::cb_size
Description:
Size of the memory for the thread control block
cb_size [2/6]
uint32_t osTimerAttr_t::cb_size
Description:
Size of the memory for the timer control block
cb_size [3/6]
uint32_t osEventFlagsAttr_t::cb_size
Description:
Size of the memory for the event control block
cb_size [4/6]
uint32_t osMutexAttr_t::cb_size
Description:
Size of the memory for the mutex control block
cb_size [5/6]
uint32_t osSemaphoreAttr_t::cb_size
Description:
Size of the memory for the semaphore control block
cb_size [6/6]
uint32_t osMessageQueueAttr_t::cb_size
Description:
Size of the memory for the message queue control block
kernel
uint32_t osVersion_t::kernel
Description:
Kernel version
mq_mem
void* osMessageQueueAttr_t::mq_mem
Description:
Memory for storing data in the message queue
mq_size
uint32_t osMessageQueueAttr_t::mq_size
Description:
Size of the memory for storing data in the message queue
name [1/6]
const char* osThreadAttr_t::name
Description:
Thread name
name [2/6]
const char* osTimerAttr_t::name
Description:
Timer name
name [3/6]
const char* osEventFlagsAttr_t::name
Description:
Event name
name [4/6]
const char* osMutexAttr_t::name
Description:
Mutex name
name [5/6]
const char* osSemaphoreAttr_t::name
Description:
Semaphore name
name [6/6]
const char* osMessageQueueAttr_t::name
Description:
Message queue name
priority
[osPriority_t]($api-api-LinkIoT-CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec) osThreadAttr_t::priority
Description:
Thread priority
reserved
uint32_t osThreadAttr_t::reserved
Description:
Reserved
stack_mem
void* osThreadAttr_t::stack_mem
Description:
Memory for the thread stack
stack_size
uint32_t osThreadAttr_t::stack_size
Description:
Size of the thread stack
tz_module
[TZ_ModuleId_t]($api-api-LinkIoT-CMSIS.md#gad5ef21485fe5f60263bc0b48006202cb) osThreadAttr_t::tz_module
Description:
TrustZone module of the thread