同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
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 |
osThreadFunc_t) (void *argument) |
|
osTimerFunc_t) (void *argument) |
|
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. |
|
#define osFlagsError 0x80000000U
Description:
Indicates a flag error.
#define osFlagsErrorParameter 0xFFFFFFFCU
Description:
Indicates an incorrect parameter.
#define osFlagsErrorResource 0xFFFFFFFDU
Description:
Indicates a resource error.
#define osFlagsErrorTimeout 0xFFFFFFFEU
Description:
Indicates a timeout.
#define osFlagsErrorUnknown 0xFFFFFFFFU
Description:
Indicates an unknown error.
#define osFlagsNoClear 0x00000002U
Description:
Indicates that defined flags are not cleared.
#define osFlagsWaitAll 0x00000001U
Description:
Indicates that the system waits until all event flags are triggered.
#define osFlagsWaitAny 0x00000000U
Description:
Indicates that the RTOS waits until any event flag is triggered.
#define osNoWait 0x0U
Description:
Indicates that the RTOS does not wait.
#define osWaitForever 0xFFFFFFFFU
Description:
Indicates that the RTOS waits forever unless an event flag is received.
typedef void* [osEventFlagsId_t](CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd)
Description:
Identifies an event flag.
typedef void* [osMessageQueueId_t](CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317)
Description:
Identifies a message queue.
typedef void* [osMutexId_t](CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7)
Description:
Identifies a mutex.
typedef void* [osSemaphoreId_t](CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1)
Description:
Identifies a semaphore object.
typedef void(* osThreadFunc_t) (void *argument)
Description:
Callback for thread scheduling.
typedef void* [osThreadId_t](CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217)
Description:
Identifies a thread.
typedef void(* osTimerFunc_t) (void *argument)
Description:
Callback for timer triggering.
typedef void* [osTimerId_t](CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44)
Description:
Identifies a timer.
typedef uint32_t [TZ_ModuleId_t](CMSIS.md#gad5ef21485fe5f60263bc0b48006202cb)
Description:
Identifies a TrustZone module call process.
enum [os_timer_align_type](CMSIS.md#ga3d617b70715d7fb2c7c6f06809ee3913)
Description:
Enumerates timer alignment modes.
osTimerAlignIgnore | |
osTimerAlignAllow |
enum [os_timer_rouses_type](CMSIS.md#ga6274cbe33c6db824bbc40dc6eaa8e578)
Description:
Enumerates timer permissions.
osTimerRousesIgnore | |
osTimerRousesAllow |
enum [osKernelState_t](CMSIS.md#ga08326469274b668140ca934b168a5ad4)
Description:
Enumerates kernel states.
osKernelInactive | |
osKernelReady | |
osKernelRunning | |
osKernelLocked | |
osKernelSuspended | |
osKernelError | |
osKernelReserved |
enum [osPriority_t](CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec)
Description:
Enumerates thread priorities.
enum [osStatus_t](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. |
enum [osThreadState_t](CMSIS.md#gad3dc89e942e38d9f3af858a0269a820d)
Description:
Enumerates thread states.
osThreadInactive | |
osThreadReady | |
osThreadRunning | |
osThreadBlocked | |
osThreadTerminated | |
osThreadError | |
osThreadReserved |
enum [osTimerType_t](CMSIS.md#ga7dc24a4c2b90334427081c3da7a71915)
Description:
Enumerates timer types.
osTimerOnce | |
osTimerPeriodic |
[osStatus_t](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.
[osStatus_t](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.
uint32_t osEventFlagsClear ([osEventFlagsId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osEventFlagsDelete ([osEventFlagsId_t](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.
uint32_t osEventFlagsGet ([osEventFlagsId_t](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.
[osEventFlagsId_t](CMSIS.md#gaf0a3ba8f502ca6581ed1009005c0dadd) osEventFlagsNew (const [osEventFlagsAttr_t](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.
uint32_t osEventFlagsSet ([osEventFlagsId_t](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.
uint32_t osEventFlagsWait ([osEventFlagsId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osKernelGetInfo ([osVersion_t](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.
[osKernelState_t](CMSIS.md#ga08326469274b668140ca934b168a5ad4) osKernelGetState (void )
Description:
Obtains the kernel state.
Returns:
Returns the kernel state.
uint32_t osKernelGetSysTimerCount (void )
Description:
Obtains the kernel system timer.
Returns:
Returns the kernel system timer.
uint32_t osKernelGetSysTimerFreq (void )
Description:
Obtains the frequency of the system timer.
Returns:
Returns the system timer frequency.
uint32_t osKernelGetTickFreq (void )
Description:
Obtains the number of kernel ticks per second.
Returns:
Returns the number of kernel ticks.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osKernelInitialize (void )
Description:
Initializes the RTOS kernel.
Returns:
Returns the CMSIS-RTOS running result.
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.
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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osKernelStart (void )
Description:
Starts the kernel.
Returns:
Returns the CMSIS-RTOS running result.
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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMessageQueueDelete ([osMessageQueueId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMessageQueueGet ([osMessageQueueId_t](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.
uint32_t osMessageQueueGetCapacity ([osMessageQueueId_t](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.
uint32_t osMessageQueueGetCount ([osMessageQueueId_t](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.
uint32_t osMessageQueueGetMsgSize ([osMessageQueueId_t](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.
uint32_t osMessageQueueGetSpace ([osMessageQueueId_t](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.
[osMessageQueueId_t](CMSIS.md#ga206dbc05367e03c39fc6d4d1ebcff317) osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const [osMessageQueueAttr_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMessageQueuePut ([osMessageQueueId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMutexAcquire ([osMutexId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMutexDelete ([osMutexId_t](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.
[osThreadId_t](CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) osMutexGetOwner ([osMutexId_t](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.
[osMutexId_t](CMSIS.md#ga29b7ba721f4fe0b11c84c55d079cc3e7) osMutexNew (const [osMutexAttr_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osMutexRelease ([osMutexId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osSemaphoreAcquire ([osSemaphoreId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osSemaphoreDelete ([osSemaphoreId_t](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.
uint32_t osSemaphoreGetCount ([osSemaphoreId_t](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.
[osSemaphoreId_t](CMSIS.md#ga5abc2c02a86678b63a711e13894ac5b1) osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const [osSemaphoreAttr_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osSemaphoreRelease ([osSemaphoreId_t](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.
uint32_t osThreadGetCount (void )
Description:
Obtains the number of active threads.
Returns:
Returns the number; returns 0 in the case of an error.
[osThreadId_t](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.
const char* osThreadGetName ([osThreadId_t](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.
[osPriority_t](CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec) osThreadGetPriority ([osThreadId_t](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.
uint32_t osThreadGetStackSize ([osThreadId_t](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.
uint32_t osThreadGetStackSpace ([osThreadId_t](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.
[osThreadState_t](CMSIS.md#gad3dc89e942e38d9f3af858a0269a820d) osThreadGetState ([osThreadId_t](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.
[osThreadId_t](CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) osThreadNew ([osThreadFunc_t](CMSIS.md#ga8ef2773ed8ef63ab8727e0d06ebec4d2) func, void * argument, const [osThreadAttr_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadResume ([osThreadId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadSetPriority ([osThreadId_t](CMSIS.md#ga6333e016ba9b008e6dd76851c38b9217) thread_id, [osPriority_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadSuspend ([osThreadId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadTerminate ([osThreadId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osThreadYield (void )
Description:
Sets the currently running thread to the ready state.
Returns:
Returns the CMSIS-RTOS running result.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osTimerDelete ([osTimerId_t](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.
uint32_t osTimerIsRunning ([osTimerId_t](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.
[osTimerId_t](CMSIS.md#gac2000ac2a8c6740700fd8e6c938cff44) osTimerNew ([osTimerFunc_t](CMSIS.md#ga77a298218f3c8382b39a09a6d134d040) func, [osTimerType_t](CMSIS.md#ga7dc24a4c2b90334427081c3da7a71915) type, void * argument, const [osTimerAttr_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osTimerStart ([osTimerId_t](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.
[osStatus_t](CMSIS.md#ga6c0dbe6069e4e7f47bb4cd32ae2b813e) osTimerStop ([osTimerId_t](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.
uint32_t osVersion_t::api
Description:
API version
uint32_t osThreadAttr_t::attr_bits
Description:
Thread attribute bits
uint32_t osTimerAttr_t::attr_bits
Description:
Reserved attribute bits
uint32_t osEventFlagsAttr_t::attr_bits
Description:
Reserved attribute bits
uint32_t osMutexAttr_t::attr_bits
Description:
Reserved attribute bits
uint32_t osSemaphoreAttr_t::attr_bits
Description:
Reserved attribute bits
uint32_t osMessageQueueAttr_t::attr_bits
Description:
Reserved attribute bits
void* osThreadAttr_t::cb_mem
Description:
Memory for the thread control block
void* osTimerAttr_t::cb_mem
Description:
Memory for the timer control block
void* osEventFlagsAttr_t::cb_mem
Description:
Memory for the event control block
void* osMutexAttr_t::cb_mem
Description:
Memory for the mutex control block
void* osSemaphoreAttr_t::cb_mem
Description:
Memory for the semaphore control block
void* osMessageQueueAttr_t::cb_mem
Description:
Memory for the message queue control block
uint32_t osThreadAttr_t::cb_size
Description:
Size of the memory for the thread control block
uint32_t osTimerAttr_t::cb_size
Description:
Size of the memory for the timer control block
uint32_t osEventFlagsAttr_t::cb_size
Description:
Size of the memory for the event control block
uint32_t osMutexAttr_t::cb_size
Description:
Size of the memory for the mutex control block
uint32_t osSemaphoreAttr_t::cb_size
Description:
Size of the memory for the semaphore control block
uint32_t osMessageQueueAttr_t::cb_size
Description:
Size of the memory for the message queue control block
uint32_t osVersion_t::kernel
Description:
Kernel version
void* osMessageQueueAttr_t::mq_mem
Description:
Memory for storing data in the message queue
uint32_t osMessageQueueAttr_t::mq_size
Description:
Size of the memory for storing data in the message queue
const char* osThreadAttr_t::name
Description:
Thread name
const char* osTimerAttr_t::name
Description:
Timer name
const char* osEventFlagsAttr_t::name
Description:
Event name
const char* osMutexAttr_t::name
Description:
Mutex name
const char* osSemaphoreAttr_t::name
Description:
Semaphore name
const char* osMessageQueueAttr_t::name
Description:
Message queue name
[osPriority_t](CMSIS.md#gad4e3e0971b41f2d17584a8c6837342ec) osThreadAttr_t::priority
Description:
Thread priority
uint32_t osThreadAttr_t::reserved
Description:
Reserved
void* osThreadAttr_t::stack_mem
Description:
Memory for the thread stack
uint32_t osThreadAttr_t::stack_size
Description:
Size of the thread stack
[TZ_ModuleId_t](CMSIS.md#gad5ef21485fe5f60263bc0b48006202cb) osThreadAttr_t::tz_module
Description:
TrustZone module of the thread
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。