CMSIS-RTOS API v2 - CMSIS 对RTOS接口的定义的标准


原文 : https://arm-software.github.io/CMSIS_5/RTOS2/html/rtos_api2.html

相关文档:Kernel Information and Control

  • osKernelGetInfo : Get RTOS Kernel Information.
  • osKernelGetState : Get the current RTOS Kernel state.
  • osKernelGetSysTimerCount : Get the RTOS kernel system timer count.
  • osKernelGetSysTimerFreq : Get the RTOS kernel system timer frequency.
  • osKernelInitialize : Initialize the RTOS Kernel.
  • osKernelLock : Lock the RTOS Kernel scheduler.
  • osKernelUnlock : Unlock the RTOS Kernel scheduler.
  • osKernelRestoreLock : Restore the RTOS Kernel scheduler lock state.
  • osKernelResume : Resume the RTOS Kernel scheduler.
  • osKernelStart : Start the RTOS Kernel scheduler.
  • osKernelSuspend : Suspend the RTOS Kernel scheduler.
  • osKernelGetTickCount : Get the RTOS kernel tick count.
  • osKernelGetTickFreq : Get the RTOS kernel tick frequency.
  • Thread Management
    • osThreadDetach : Detach a thread (thread storage can be reclaimed when thread terminates).
    • osThreadEnumerate : Enumerate active threads.
    • osThreadExit : Terminate execution of current running thread.
    • osThreadGetCount : Get number of active threads.
    • osThreadGetId : Return the thread ID of the current running thread.
    • osThreadGetName : Get name of a thread.
    • osThreadGetPriority : Get current priority of a thread.
    • osThreadGetStackSize : Get stack size of a thread.
    • osThreadGetStackSpace : Get available stack space of a thread based on stack watermark recording during execution.
    • osThreadGetState : Get current thread state of a thread.
    • osThreadJoin : Wait for specified thread to terminate.
    • osThreadNew : Create a thread and add it to Active Threads.
    • osThreadResume : Resume execution of a thread.
    • osThreadSetPriority : Change priority of a thread.
    • osThreadSuspend : Suspend execution of a thread.
    • osThreadTerminate : Terminate execution of a thread.
    • osThreadYield : Pass control to next thread that is in state READY.
  • Thread Flags
    • osThreadFlagsSet : Set the specified Thread Flags of a thread.
    • osThreadFlagsClear : Clear the specified Thread Flags of current running thread.
    • osThreadFlagsGet : Get the current Thread Flags of current running thread.
    • osThreadFlagsWait : Wait for one or more Thread Flags of the current running thread to become signaled.
  • Event Flags
    • osEventFlagsGetName : Get name of an Event Flags object.
    • osEventFlagsNew : Create and Initialize an Event Flags object.
    • osEventFlagsDelete : Delete an Event Flags object.
    • osEventFlagsSet : Set the specified Event Flags.
    • osEventFlagsClear : Clear the specified Event Flags.
    • osEventFlagsGet : Get the current Event Flags.
    • osEventFlagsWait : Wait for one or more Event Flags to become signaled.
  • Generic Wait Functions
    • osDelay : Wait for Timeout (Time Delay).
    • osDelayUntil : Wait until specified time.
  • Timer Management
    • osTimerDelete : Delete a timer.
    • osTimerGetName : Get name of a timer.
    • osTimerIsRunning : Check if a timer is running.
    • osTimerNew : Create and Initialize a timer.
    • osTimerStart : Start or restart a timer.
    • osTimerStop : Stop a timer.
  • Mutex Management
    • osMutexAcquire : Acquire a Mutex or timeout if it is locked.
    • osMutexDelete : Delete a Mutex object.
    • osMutexGetName : Get name of a Mutex object.
    • osMutexGetOwner : Get Thread which owns a Mutex object.
    • osMutexNew : Create and Initialize a Mutex object.
    • osMutexRelease : Release a Mutex that was acquired by osMutexAcquire.
  • Semaphores
    • osSemaphoreAcquire : Acquire a Semaphore token or timeout if no tokens are available.
    • osSemaphoreDelete : Delete a Semaphore object.
    • osSemaphoreGetCount : Get current Semaphore token count.
    • osSemaphoreGetName : Get name of a Semaphore object.
    • osSemaphoreNew : Create and Initialize a Semaphore object.
    • osSemaphoreRelease : Release a Semaphore token up to the initial maximum count.
  • Memory Pool
    • osMemoryPoolAlloc : Allocate a memory block from a Memory Pool.
    • osMemoryPoolDelete : Delete a Memory Pool object.
    • osMemoryPoolFree : Return an allocated memory block back to a Memory Pool.
    • osMemoryPoolGetBlockSize : Get memory block size in a Memory Pool.
    • osMemoryPoolGetCapacity : Get maximum number of memory blocks in a Memory Pool.
    • osMemoryPoolGetCount : Get number of memory blocks used in a Memory Pool.
    • osMemoryPoolGetName : Get name of a Memory Pool object.
    • osMemoryPoolGetSpace : Get number of memory blocks available in a Memory Pool.
    • osMemoryPoolNew : Create and Initialize a Memory Pool object.
  • Message Queue
    • osMessageQueueDelete : Delete a Message Queue object.
    • osMessageQueueGet : Get a Message from a Queue or timeout if Queue is empty.
    • osMessageQueueGetCapacity : Get maximum number of messages in a Message Queue.
    • osMessageQueueGetCount : Get number of queued messages in a Message Queue.
    • osMessageQueueGetMsgSize : Get maximum message size in a Message Queue.
    • osMessageQueueGetName : Get name of a Message Queue object.
    • osMessageQueueGetSpace : Get number of available slots for messages in a Message Queue.
    • osMessageQueueNew : Create and Initialize a Message Queue object.
    • osMessageQueuePut : Put a Message into a Queue or timeout if Queue is full.
    • osMessageQueueReset : Reset a Message Queue to initial empty state.
  • The following CMSIS-RTOS C API v2 functions can be called from threads and Interrupt Service Routines (ISR):

    • osKernelGetInfo, osKernelGetState, osKernelGetTickCount, osKernelGetTickFreq, osKernelGetSysTimerCount, osKernelGetSysTimerFreq
    • osThreadGetId, osThreadFlagsSet
    • osEventFlagsSet, osEventFlagsClear, osEventFlagsGet, osEventFlagsWait
    • osSemaphoreAcquire, osSemaphoreRelease, osSemaphoreGetCount
    • osMemoryPoolAlloc, osMemoryPoolFree, osMemoryPoolGetCapacity, osMemoryPoolGetBlockSize, osMemoryPoolGetCount, osMemoryPoolGetSpace
    • osMessageQueuePut, osMessageQueueGet, osMessageQueueGetCapacity, osMessageQueueGetMsgSize, osMessageQueueGetCount, osMessageQueueGetSpace