Common library convenience headers, macros and functions.
More...
Common utility headers containing macros, functions, enums and types which are common to all aspects of the library.
◆ CONCAT
#define CONCAT |
( |
|
x, |
|
|
|
y |
|
) |
| x ## y |
Concatenates the given input into a single token, via the C Preprocessor.
- Parameters
-
[in] | x | First item to concatenate. |
[in] | y | Second item to concatenate. |
- Returns
- Concatenated version of the input.
◆ CONCAT_EXPANDED
#define CONCAT_EXPANDED |
( |
|
x, |
|
|
|
y |
|
) |
| CONCAT(x, y) |
CConcatenates the given input into a single token after macro expansion, via the C Preprocessor.
- Parameters
-
[in] | x | First item to concatenate. |
[in] | y | Second item to concatenate. |
- Returns
- Concatenated version of the expanded input.
◆ MAX
#define MAX |
( |
|
x, |
|
|
|
y |
|
) |
| (((x) > (y)) ? (x) : (y)) |
Convenience macro to determine the larger of two values.
- Attention
- This macro should only be used with operands that do not have side effects from being evaluated multiple times.
- Parameters
-
[in] | x | First value to compare |
[in] | y | First value to compare |
- Returns
- The larger of the two input parameters
◆ MIN
#define MIN |
( |
|
x, |
|
|
|
y |
|
) |
| (((x) < (y)) ? (x) : (y)) |
Convenience macro to determine the smaller of two values.
- Attention
- This macro should only be used with operands that do not have side effects from being evaluated multiple times.
- Parameters
-
[in] | x | First value to compare. |
[in] | y | First value to compare. |
- Returns
- The smaller of the two input parameters
◆ STRINGIFY
#define STRINGIFY |
( |
|
x | ) |
#x |
Converts the given input into a string, via the C Preprocessor. This macro puts literal quotation marks around the input, converting the source into a string literal.
- Parameters
-
[in] | x | Input to convert into a string literal. |
- Returns
- String version of the input.
◆ STRINGIFY_EXPANDED
Converts the given input into a string after macro expansion, via the C Preprocessor. This macro puts literal quotation marks around the expanded input, converting the source into a string literal.
- Parameters
-
[in] | x | Input to expand and convert into a string literal. |
- Returns
- String version of the expanded input.
◆ uint_reg_t
Type define for an unsigned integer the same width as the selected architecture's machine register. This is distinct from the non-specific standard int data type, whose width is machine dependant but which may not reflect the actual machine register width on some targets (e.g. AVR8).
◆ BitReverse()
static uint8_t BitReverse |
( |
uint8_t |
Byte | ) |
|
|
inlinestatic |
Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1, etc.
- Parameters
-
[in] | Byte | Byte of data whose bits are to be reversed. |
- Returns
- Input data with the individual bits reversed (mirrored).
◆ Delay_MS()
static void Delay_MS |
( |
uint16_t |
Milliseconds | ) |
|
|
inlinestatic |
Function to perform a blocking delay for a specified number of milliseconds. The actual delay will be at a minimum the specified number of milliseconds, however due to loop overhead and internal calculations may be slightly higher.
- Parameters
-
[in] | Milliseconds | Number of milliseconds to delay |