CMSIS-RTOS RTX
Version 4.80
CMSIS-RTOS RTX: Real-Time Operating System for Cortex-M processor-based devices
|
Provide version/system information and start the RTOS Kernel. More...
Macros | |
#define | osFeature_MainThread 1 |
main can be thread | |
#define | osFeature_SysTick 1 |
osKernelSysTick functions available | |
#define | osCMSIS 0x10002U |
CMSIS-RTOS API version (main [31:16] .sub [15:0]) | |
#define | osCMSIS_RTX ((4<<16)|80) |
RTOS identification and version (main [31:16] .sub [15:0]) | |
#define | osKernelSystemId "RTX V4.80" |
RTOS identification string. | |
#define | osKernelSysTickFrequency os_tickfreq |
The RTOS kernel system timer frequency in Hz. | |
#define | osKernelSysTickMicroSec(microsec) ((microsec * os_tickus_i) + ((microsec * os_tickus_f) >> 16)) |
Convert a microseconds value to a RTOS kernel system timer value. | |
Functions | |
osStatus | osKernelInitialize (void) |
Initialize the RTOS Kernel for creating objects. | |
osStatus | osKernelStart (void) |
Start the RTOS Kernel. | |
int32_t | osKernelRunning (void) |
Check if the RTOS kernel is already started. | |
uint32_t | osKernelSysTick (void) |
Get the RTOS kernel system timer counter. | |
The Kernel Information and Control function group allow to:
The function main is a special thread function that may be started at system initialization. In this case it has the initial priority osPriorityNormal.
Example
#define osCMSIS 0x10002U |
Version information of the CMSIS RTOS API whereby major version is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.
#define osCMSIS_RTX ((4<<16)|80) |
Identifies the CMSIS-RTOS RTX kernel and version number.
#define osFeature_MainThread 1 |
CMSIS-RTOS RTX starts with 'main'. The RTOS kernel is in this case already started.
#define osFeature_SysTick 1 |
CMSIS-RTOS RTX provides access to the RTOS kernel system timer with osKernelSysTick, osKernelSysTickFrequency, and osKernelSysTickMicroSec.
#define osKernelSystemId "RTX V4.80" |
Defines the CMSIS-RTOS RTX Kernel and provides version information.
#define osKernelSysTickFrequency os_tickfreq |
Specifies the frequency of the Kernel SysTick timer in Hz. The value is typically use to scale a time value and is for example used in osKernelSysTickMicroSec.
#define osKernelSysTickMicroSec | ( | microsec | ) | ((microsec * os_tickus_i) + ((microsec * os_tickus_f) >> 16)) |
Allows to scale a microsecond value to the frequency of the Kernel SysTick timer. This macro is typically used to check for short timeouts in polling loops.
microsec | time value in microseconds. |
osStatus osKernelInitialize | ( | void | ) |
Initialize of the RTOS Kernel to allow peripheral setup and creation of other RTOS objects with the functions:
CMSIS-RTOS RTX Kernel starts thread execution with the function main. In this case, the function osKernelInitialize stops thread switching. This allows to setup the system to a defined state before thread switching is resumed with osKernelStart.
Example
int32_t osKernelRunning | ( | void | ) |
Identifies if the RTOS kernel is started. For CMSIS-RTOS RTX, this allows to identify that the RTOS kernel is already running.
Example
osStatus osKernelStart | ( | void | ) |
Start the RTOS Kernel and begin thread switching. CMSIS-RTOS RTX starts thread execution with the function main. In this case, the function osKernelStart resumes thread switching. The main thread will continue executing after osKernelStart.
Example
uint32_t osKernelSysTick | ( | void | ) |
Get the value of the Kernel SysTick timer for time comparison. The value is a rolling 32-bit counter that is typically composed of the kernel system interrupt timer value and an counter that counts these interrupts.
This function allows the implementation of timeout checks. These are for example required when checking for a busy status in a device or peripheral initialization routine.
Example