Loading...
Searching...
No Matches
riotbuild.h: Preprocessor Constants to Query the Build System Configuration

The RIOT build system generates a header file riotbuild.h that is included in every C compilation unit by passing the -include flag to the C compiler. More...

Detailed Description

The RIOT build system generates a header file riotbuild.h that is included in every C compilation unit by passing the -include flag to the C compiler.

Hence, it provides a set of macros that are unconditionally available and can be used by C code to query the build system configuration.

Macros

#define RIOT_VERSION   "<YEAR_OF_RELEASE>.<MONTH_OF_RELEASE>-<POSTFIX>"
 The used RIOT version as human readable string literal, e.g., for printing to stdio or writing to a log.
 
#define RIOT_VERSION_CODE   RIOT_VERSION_NUM(<YEAR>,<MONTH>,<PATCH>,<EXTRA>)
 The used RIOT version as machine readable number, e.g., for testing whether new APIs are available.
 
#define RIOT_APPLICATION   "<RIOT_APP_NAME>"
 Name of the RIOT application as string literal.
 
#define RIOT_BOARD   "<BOARD_NAME>"
 Name of the board the app is compiled for as string literal.
 
#define RIOT_CPU   "<CPU_FOLDER_NAME>"
 Name of the MCU the app is compiled for as string literal.
 
#define CPU_RAM_SIZE   /* RAM Size in Bytes */
 Size of the RAM in Bytes.
 
#define MACRO_DEPRECATED   /* implementation */
 Mark a preprocessor macro as deprecated by including this macro in the definition.
 
#define RIOT_MCU   MACRO_DEPRECATED RIOT_CPU
 Name of the MCU the app is compiled for as string literal.
 

Macro Definition Documentation

◆ CPU_RAM_SIZE

#define CPU_RAM_SIZE   /* RAM Size in Bytes */

Size of the RAM in Bytes.

Warning
Not every CPU family provides this, it will be undefined if not provided

Definition at line 63 of file riotbuild-prefix.h.in.

◆ MACRO_DEPRECATED

#define MACRO_DEPRECATED   /* implementation */

Mark a preprocessor macro as deprecated by including this macro in the definition.

Usage:

C
#define FOO MACRO_DEPRECATED BAR

Definition at line 77 of file riotbuild-prefix.h.in.

◆ RIOT_APPLICATION

#define RIOT_APPLICATION   "<RIOT_APP_NAME>"

Name of the RIOT application as string literal.

The string is defined in the applications Makefile using the APPLICATION variable.

Definition at line 41 of file riotbuild-prefix.h.in.

◆ RIOT_BOARD

#define RIOT_BOARD   "<BOARD_NAME>"

Name of the board the app is compiled for as string literal.

Definition at line 46 of file riotbuild-prefix.h.in.

◆ RIOT_CPU

#define RIOT_CPU   "<CPU_FOLDER_NAME>"

Name of the MCU the app is compiled for as string literal.

This is the name of the MCU family in terms of RIOT's peripheral drivers, or in other words, the folder name in the cpu folder in RIOT's repo root used.

Definition at line 55 of file riotbuild-prefix.h.in.

◆ RIOT_MCU

#define RIOT_MCU   MACRO_DEPRECATED RIOT_CPU

Name of the MCU the app is compiled for as string literal.

Deprecated:
Use RIOT_CPU instead. This will be removed soonest in release 2025.04

This has been renamed to RIOT_CPU for consistency. Even though MCU would technically be the better name, CPU is used every else in the source code and folder structure.

Definition at line 94 of file riotbuild-prefix.h.in.

◆ RIOT_VERSION

#define RIOT_VERSION   "<YEAR_OF_RELEASE>.<MONTH_OF_RELEASE>-<POSTFIX>"

The used RIOT version as human readable string literal, e.g., for printing to stdio or writing to a log.

Definition at line 25 of file riotbuild-prefix.h.in.

◆ RIOT_VERSION_CODE

#define RIOT_VERSION_CODE   RIOT_VERSION_NUM(<YEAR>,<MONTH>,<PATCH>,<EXTRA>)

The used RIOT version as machine readable number, e.g., for testing whether new APIs are available.

See also
RIOT_VERSION_NUM

Definition at line 33 of file riotbuild-prefix.h.in.