CMSIS-RTOS
Version 1.03
Real-Time Operating System: API and RTX Reference Implementation.
|
Provide version/system information and start the RTOS Kernel. More...
Macros | |
#define | osFeature_MainThread 1 |
main thread 1=main can be thread, 0=not available More... | |
#define | osFeature_SysTick 1 |
osKernelSysTick functions: 1=available, 0=not available More... | |
#define | osCMSIS 0x10002 |
API version (main [31:16] .sub [15:0]) More... | |
#define | osCMSIS_KERNEL 0x10000 |
RTOS identification and version (main [31:16] .sub [15:0]) More... | |
#define | osKernelSystemId "KERNEL V1.00" |
RTOS identification string. More... | |
#define | osKernelSysTickFrequency 100000000 |
The RTOS kernel system timer frequency in Hz. More... | |
#define | osKernelSysTickMicroSec(microsec) (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000) |
Convert a microseconds value to a RTOS kernel system timer value. More... | |
Functions | |
osStatus | osKernelInitialize (void) |
Initialize the RTOS Kernel for creating objects. More... | |
osStatus | osKernelStart (void) |
Start the RTOS Kernel. More... | |
int32_t | osKernelRunning (void) |
Check if the RTOS kernel is already started. More... | |
uint32_t | osKernelSysTick (void) |
Get the RTOS kernel system timer counter. More... | |
The Kernel Information and Control function group allows 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.
When reaching main, it is necessary to:
Code Example
#define osCMSIS 0x10002 |
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_KERNEL 0x10000 |
Identifies the underlying RTOS kernel and version number. The actual name of that define depends on the RTOS Kernel used in the implementation. For example, osCMSIS_FreeRTOS identifies the FreeRTOS kernel and the value indicates the version number of that kernel whereby the major version is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.
#define osFeature_MainThread 1 |
A CMSIS-RTOS implementation may support to start thread execution with the function 'main'.
CMSIS-RTOS RTX Setting: osFeature_MainThread is 1
#define osFeature_SysTick 1 |
A CMSIS-RTOS implementation may provide access to the RTOS kernel system timer.
CMSIS-RTOS RTX Setting: osFeature_SysTick is 1
#define osKernelSystemId "KERNEL V1.00" |
Defines a string that identifies the underlying RTOS Kernel and provides version information. The length of that string is limited to 21 bytes. A valid identification string is for example, "FreeRTOS V1.00".
#define osKernelSysTickFrequency 100000000 |
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 | ) | (((uint64_t)microsec * (osKernelSysTickFrequency)) / 1000000) |
Allows you 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:
The RTOS kernel does not start thread switching until the function osKernelStart is called.
Code Example
int32_t osKernelRunning | ( | void | ) |
Identifies if the RTOS kernel is started. For systems with the option to start the main function as a thread this allows you to identify that the RTOS kernel is already running.
Code Example
osStatus osKernelStart | ( | void | ) |
Start the RTOS Kernel and begin thread switching.
Code 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.
Code Example