The Micrium OS CPU module offers toolchain-agnostic abstractions of common microcontroller features. These include: data types, optimized functions, and critical sections. The subsections below document the various abstractions, and the Configuration Manual explains how to configure this module to better fit your needs.
To help you write reusable code, the CPU module offers all the data type definitions your application may need. The table below lists the supported data types:
Table - Micrium OS CPU Supported Data Types#
The void type.
8-bit Boolean value.
8-bit unsigned integer.
8-bit signed integer.
16-bit unsigned integer.
16-bit signed integer.
32-bit unsigned integer.
32-bit signed integer.
64-bit unsigned integer.
64-bit signed integer.
Single precision floating point.
Double precision floating point.
8-bit volatile value.
16-bit volatile value.
32-bit volatile value.
64-bit volatile value.
Sufficiently wide type used to address the whole address space.
Type that matches the microcontroller's data bus width.
Type that matches the width of the values present in the microcontroller's stack.
Convenient pointer to void func() functions.
Convenient pointer to void func(void *arg) functions, like callbacks.
Beyond data types, the CPU module offers various services useful for the development of your application.
Name and Optimized Operations#
This module offers your application basic features such as identification and optimized functions. The CPU Name section of the programming guide contains more information on how to use the identification system of the CPU module.
The optimized functions created by this module allow your application to use frequently-used microcontroller instructions. These instructions include: count leading zeros and count trailing zeros. All of these functions usually process a single word, and are used often by the kernel. The Optimized Operations section of the Programming Guide contains more information on the optimized functions offered by the CPU module.
In order to aid the profiling of your application, and determine where most of the CPU time is spent, the Micrium OS CPU module offers timestamping functions to abstract away the details of initializing and handling a timestamp counter. Furthermore, the timestamp features offered by the CPU module are used by the kernel to measure the time it took to apply certain operations on its objects. The Timestamp section of the Programming Guide illustrates how to use the timestamp features of the CPU module.
Some microcontrollers offer the possibility to create software breakpoints and exceptions. The CPU module provides your application with a generic way to create such breakpoints and exceptions. See the related section in the Programming Guide for more details.