Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

8.8.5.3.2. Data Types

Several setting data types are available, controlled by the type argument to add_sw_setting. They correspond to the data types you can express as #define statements or values concatenated to makefile variables. The specific setting type depends on your software’s structure or BSP build needs.
Table 39.  Data Type Settings
Data Type Setting Value Notes
Boolean definition boolean_define_only A definition that is generated when true, and absent when false. Use a boolean definition in your C source files with the #ifdef <setting> ... #endif construct.
Boolean assignment boolean A definition assigned to 1 when true, 0 when false. Use a boolean assignment in your C source files with the #if <setting> ... #else ... construct.
Character character A definition with one character surrounded by single quotation marks (')
Decimal number decimal_number A definition with an unquoted, unformatted decimal number, such as 123. Useful for defining values in software that, for example, might have a configurable buffer size, such as int buffer[SIZE];
Double precision number double A definition with a double-precision floating point number such as 123.4
Floating point number float A definition with a single-precision floating point number such as 234.5
Hexadecimal number hex_number A definition with a number prefixed with 0x, such as 0x1000. Useful for specifying memory addresses or bit masks
Quoted string quoted_string A definition with a string in quotes, such as "Buffer"
Unquoted string unquoted_string A definition with a string not in quotes, such as BUFFER