CPU Overview#

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.

Data Types#

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#

Data Type

Description

CPU_VOID

The void type.

CPU_CHAR

8-bit character.

CPU_BOOLEAN

8-bit Boolean value.

CPU_INT08U

8-bit unsigned integer.

CPU_INT08S

8-bit signed integer.

CPU_INT16U

16-bit unsigned integer.

CPU_INT16S

16-bit signed integer.

CPU_INT32U

32-bit unsigned integer.

CPU_INT32S

32-bit signed integer.

CPU_INT64U

64-bit unsigned integer.

CPU_INT64S

64-bit signed integer.

CPU_FP32

Single precision floating point.

CPU_FP64

Double precision floating point.

CPU_REG08

8-bit volatile value.

CPU_REG16

16-bit volatile value.

CPU_REG32

32-bit volatile value.

CPU_REG64

64-bit volatile value.

CPU_ADDR

Sufficiently wide type used to address the whole address space.

CPU_DATA

Type that matches the microcontroller's data bus width.

CPU_STK

Type that matches the width of the values present in the microcontroller's stack.

CPU_FNCT_VOID

Convenient pointer to void func() functions.

CPU_FNCT_PTR

Convenient pointer to void func(void *arg) functions, like callbacks.

Core Features#

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.

Timestamp#

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.

Miscellaneous#

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.