Modules | |
Preprocessor - Macro Repeat | |
Preprocessor - Stringize | |
Preprocessor - Token Paste | |
Classes | |
struct | StructCPtr |
Structure of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. More... | |
struct | StructCVPtr |
Structure of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. More... | |
struct | StructPtr |
Structure of pointers to 64-, 32-, 16- and 8-bit unsigned integers. More... | |
struct | StructVPtr |
Structure of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. More... | |
union | Union16 |
16-bit union. More... | |
union | Union32 |
32-bit union. More... | |
union | Union64 |
64-bit union. More... | |
union | UnionCPtr |
Union of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. More... | |
union | UnionCVPtr |
Union of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. More... | |
union | UnionPtr |
Union of pointers to 64-, 32-, 16- and 8-bit unsigned integers. More... | |
union | UnionVPtr |
Union of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. More... | |
Macros | |
#define | ADDR_COPY_DST_SRC_16(dst, src) ((dst) = (src)) |
#define | ADDR_COPY_DST_SRC_64(dst, src) ((dst) = (src)) |
#define | Assert(expr) ((void) 0) |
This macro is used to test fatal errors. More... | |
#define | barrier() __DMB() |
Memory barrier. More... | |
#define | CCPU_ENDIAN_TO_LE16(x) (x) |
#define | CCPU_ENDIAN_TO_LE32(x) (x) |
#define | CCPU_ENDIAN_TO_LE64(x) (x) |
#define | CLE16_TO_CPU_ENDIAN(x) (x) |
#define | CLE32_TO_CPU_ENDIAN(x) (x) |
#define | CLE64_TO_CPU_ENDIAN(x) (x) |
#define | CMD_ID_OCTET (0) |
#define | COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) |
Set default alignment for subsequent struct and union definitions. More... | |
#define | COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) |
Set maximum alignment for subsequent struct and union definitions to alignment. More... | |
#define | COMPILER_PRAGMA(arg) _Pragma(#arg) |
Emit the compiler pragma arg. More... | |
#define | CPU_ENDIAN_TO_LE16(x) (x) |
#define | CPU_ENDIAN_TO_LE32(x) (x) |
#define | CPU_ENDIAN_TO_LE64(x) (x) |
#define | div_ceil(a, b) (((a) + (b) - 1) / (b)) |
Calculate using integer arithmetic. More... | |
#define | FLASH_DECLARE(x) const x |
#define | FLASH_EXTERN(x) extern const x |
#define | FUNC_PTR void * |
#define | LE16_TO_CPU_ENDIAN(x) (x) |
#define | LE32_TO_CPU_ENDIAN(x) (x) |
#define | LE64_TO_CPU_ENDIAN(x) (x) |
#define | Long_call(addr) ((*(void (*)(void))(addr))()) |
Calls the routine at address addr. More... | |
#define | MEMCPY_ENDIAN memcpy |
#define | PGM_READ_BLOCK(dst, src, len) memcpy((dst), (src), (len)) |
#define | PGM_READ_BYTE(x) *(x) |
#define | PGM_READ_DWORD(x) *(x) |
#define | PGM_READ_WORD(x) *(x) |
#define | UNUSED(v) (void)(v) |
Marking v as a unused parameter or value. More... | |
#define | unused(v) do { (void)(v); } while(0) |
Marking v as a unused parameter or value. More... | |
Functions | |
static void | convert_16_bit_to_byte_address (uint16_t value, uint8_t *data) |
static void | convert_16_bit_to_byte_array (uint16_t value, uint8_t *data) |
Converts a 16-Bit value into a 2 Byte array. More... | |
static void | convert_64_bit_to_byte_array (uint64_t value, uint8_t *data) |
Converts a 64-Bit value into a 8 Byte array. More... | |
static uint16_t | convert_byte_array_to_16_bit (uint8_t *data) |
static uint32_t | convert_byte_array_to_32_bit (uint8_t *data) |
static uint64_t | convert_byte_array_to_64_bit (uint8_t *data) |
Converts a 8 Byte array into a 64-Bit value. More... | |
static void | convert_spec_16_bit_to_byte_array (uint16_t value, uint8_t *data) |
Usual Types | |
typedef unsigned char | Bool |
Boolean. More... | |
typedef unsigned char | bool |
Boolean. More... | |
typedef int8_t | S8 |
8-bit signed integer. More... | |
typedef uint8_t | U8 |
8-bit unsigned integer. More... | |
typedef int16_t | S16 |
16-bit signed integer. More... | |
typedef uint16_t | U16 |
16-bit unsigned integer. More... | |
typedef uint16_t | le16_t |
typedef uint16_t | be16_t |
typedef int32_t | S32 |
32-bit signed integer. More... | |
typedef uint32_t | U32 |
32-bit unsigned integer. More... | |
typedef uint32_t | le32_t |
typedef uint32_t | be32_t |
typedef int64_t | S64 |
64-bit signed integer. More... | |
typedef uint64_t | U64 |
64-bit unsigned integer. More... | |
typedef float | F32 |
32-bit floating-point number. More... | |
typedef double | F64 |
64-bit floating-point number. More... | |
typedef uint32_t | iram_size_t |
Status Types | |
typedef bool | Status_bool_t |
Boolean status. More... | |
typedef U8 | Status_t |
Usual Constants | |
#define | DISABLE 0 |
#define | ENABLE 1 |
#define | false 0 |
#define | true 1 |
#define | PASS 0 |
#define | FAIL 1 |
#define | LOW 0 |
#define | HIGH 1 |
Optimization Control | |
#define | likely(exp) (exp) |
The expression exp is likely to be true. More... | |
#define | unlikely(exp) (exp) |
The expression exp is unlikely to be true. More... | |
#define | is_constant(exp) (0) |
Determine if an expression evaluates to a constant value. More... | |
Bit-Field Handling | |
#define | Rd_bits(value, mask) ((value) & (mask)) |
Reads the bits of a value specified by a given bit-mask. More... | |
#define | Wr_bits(lvalue, mask, bits) |
Writes the bits of a C lvalue specified by a given bit-mask. More... | |
#define | Tst_bits(value, mask) (Rd_bits(value, mask) != 0) |
Tests the bits of a value specified by a given bit-mask. More... | |
#define | Clr_bits(lvalue, mask) ((lvalue) &= ~(mask)) |
Clears the bits of a C lvalue specified by a given bit-mask. More... | |
#define | Set_bits(lvalue, mask) ((lvalue) |= (mask)) |
Sets the bits of a C lvalue specified by a given bit-mask. More... | |
#define | Tgl_bits(lvalue, mask) ((lvalue) ^= (mask)) |
Toggles the bits of a C lvalue specified by a given bit-mask. More... | |
#define | Rd_bitfield(value, mask) (Rd_bits( value, mask) >> ctz(mask)) |
Reads the bit-field of a value specified by a given bit-mask. More... | |
#define | Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (U32)(bitfield) << ctz(mask))) |
Writes the bit-field of a C lvalue specified by a given bit-mask. More... | |
Zero-Bit Counting | |
Under GCC, __builtin_clz and __builtin_ctz behave like macros when applied to constant expressions (values known at compile time), so they are more optimized than the use of the corresponding assembly instructions and they can be used as constant expressions e.g. to initialize objects having static storage duration, and like the corresponding assembly instructions when applied to non-constant expressions (values unknown at compile time), so they are more optimized than an assembly periphrasis. Hence, clz and ctz ensure a possible and optimized behavior for both constant and non-constant expressions. | |
#define | clz(u) |
Counts the leading zero bits of the given value considered as a 32-bit integer. More... | |
#define | ctz(u) |
Counts the trailing zero bits of the given value considered as a 32-bit integer. More... | |
Bit Reversing | |
#define | bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24)) |
Reverses the bits of u8. More... | |
#define | bit_reverse16(u16) ((U16)(bit_reverse32((U16)(u16)) >> 16)) |
Reverses the bits of u16. More... | |
#define | bit_reverse32(u32) __RBIT(u32) |
Reverses the bits of u32. More... | |
#define | bit_reverse64(u64) |
Reverses the bits of u64. More... | |
Alignment | |
#define | Test_align(val, n) (!Tst_bits( val, (n) - 1 ) ) |
Tests alignment of the number val with the n boundary. More... | |
#define | Get_align(val, n) ( Rd_bits( val, (n) - 1 ) ) |
Gets alignment of the number val with respect to the n boundary. More... | |
#define | Set_align(lval, n, alg) ( Wr_bits(lval, (n) - 1, alg) ) |
Sets alignment of the lvalue number lval to alg with respect to the n boundary. More... | |
#define | Align_up( val, n) (((val) + ((n) - 1)) & ~((n) - 1)) |
Aligns the number val with the upper n boundary. More... | |
#define | Align_down(val, n) ( (val) & ~((n) - 1)) |
Aligns the number val with the lower n boundary. More... | |
Mathematics | |
The same considerations as for clz and ctz apply here but GCC does not provide built-in functions to access the assembly instructions abs, min and max and it does not produce them by itself in most cases, so two sets of macros are defined here:
| |
#define | Abs(a) (((a) < 0 ) ? -(a) : (a)) |
Takes the absolute value of a. More... | |
#define | Min(a, b) (((a) < (b)) ? (a) : (b)) |
Takes the minimal value of a and b. More... | |
#define | Max(a, b) (((a) > (b)) ? (a) : (b)) |
Takes the maximal value of a and b. More... | |
#define | min(a, b) Min(a, b) |
Takes the minimal value of a and b. More... | |
#define | max(a, b) Max(a, b) |
Takes the maximal value of a and b. More... | |
MCU Endianism Handling | |
#define | MSB(u16) (((U8 *)&(u16))[1]) |
Most significant byte of u16. More... | |
#define | LSB(u16) (((U8 *)&(u16))[0]) |
Least significant byte of u16. More... | |
#define | MSH(u32) (((U16 *)&(u32))[1]) |
Most significant half-word of u32. More... | |
#define | LSH(u32) (((U16 *)&(u32))[0]) |
Least significant half-word of u32. More... | |
#define | MSB0W(u32) (((U8 *)&(u32))[3]) |
Most significant byte of 1st rank of u32. More... | |
#define | MSB1W(u32) (((U8 *)&(u32))[2]) |
Most significant byte of 2nd rank of u32. More... | |
#define | MSB2W(u32) (((U8 *)&(u32))[1]) |
Most significant byte of 3rd rank of u32. More... | |
#define | MSB3W(u32) (((U8 *)&(u32))[0]) |
Most significant byte of 4th rank of u32. More... | |
#define | LSB3W(u32) MSB0W(u32) |
Least significant byte of 4th rank of u32. More... | |
#define | LSB2W(u32) MSB1W(u32) |
Least significant byte of 3rd rank of u32. More... | |
#define | LSB1W(u32) MSB2W(u32) |
Least significant byte of 2nd rank of u32. More... | |
#define | LSB0W(u32) MSB3W(u32) |
Least significant byte of 1st rank of u32. More... | |
#define | MSW(u64) (((U32 *)&(u64))[1]) |
Most significant word of u64. More... | |
#define | LSW(u64) (((U32 *)&(u64))[0]) |
Least significant word of u64. More... | |
#define | MSH0(u64) (((U16 *)&(u64))[3]) |
Most significant half-word of 1st rank of u64. More... | |
#define | MSH1(u64) (((U16 *)&(u64))[2]) |
Most significant half-word of 2nd rank of u64. More... | |
#define | MSH2(u64) (((U16 *)&(u64))[1]) |
Most significant half-word of 3rd rank of u64. More... | |
#define | MSH3(u64) (((U16 *)&(u64))[0]) |
Most significant half-word of 4th rank of u64. More... | |
#define | LSH3(u64) MSH0(u64) |
Least significant half-word of 4th rank of u64. More... | |
#define | LSH2(u64) MSH1(u64) |
Least significant half-word of 3rd rank of u64. More... | |
#define | LSH1(u64) MSH2(u64) |
Least significant half-word of 2nd rank of u64. More... | |
#define | LSH0(u64) MSH3(u64) |
Least significant half-word of 1st rank of u64. More... | |
#define | MSB0D(u64) (((U8 *)&(u64))[7]) |
Most significant byte of 1st rank of u64. More... | |
#define | MSB1D(u64) (((U8 *)&(u64))[6]) |
Most significant byte of 2nd rank of u64. More... | |
#define | MSB2D(u64) (((U8 *)&(u64))[5]) |
Most significant byte of 3rd rank of u64. More... | |
#define | MSB3D(u64) (((U8 *)&(u64))[4]) |
Most significant byte of 4th rank of u64. More... | |
#define | MSB4D(u64) (((U8 *)&(u64))[3]) |
Most significant byte of 5th rank of u64. More... | |
#define | MSB5D(u64) (((U8 *)&(u64))[2]) |
Most significant byte of 6th rank of u64. More... | |
#define | MSB6D(u64) (((U8 *)&(u64))[1]) |
Most significant byte of 7th rank of u64. More... | |
#define | MSB7D(u64) (((U8 *)&(u64))[0]) |
Most significant byte of 8th rank of u64. More... | |
#define | LSB7D(u64) MSB0D(u64) |
Least significant byte of 8th rank of u64. More... | |
#define | LSB6D(u64) MSB1D(u64) |
Least significant byte of 7th rank of u64. More... | |
#define | LSB5D(u64) MSB2D(u64) |
Least significant byte of 6th rank of u64. More... | |
#define | LSB4D(u64) MSB3D(u64) |
Least significant byte of 5th rank of u64. More... | |
#define | LSB3D(u64) MSB4D(u64) |
Least significant byte of 4th rank of u64. More... | |
#define | LSB2D(u64) MSB5D(u64) |
Least significant byte of 3rd rank of u64. More... | |
#define | LSB1D(u64) MSB6D(u64) |
Least significant byte of 2nd rank of u64. More... | |
#define | LSB0D(u64) MSB7D(u64) |
Least significant byte of 1st rank of u64. More... | |
#define | BE16(x) swap16(x) |
#define | LE16(x) (x) |
#define | le16_to_cpu(x) (x) |
#define | cpu_to_le16(x) (x) |
#define | LE16_TO_CPU(x) (x) |
#define | CPU_TO_LE16(x) (x) |
#define | be16_to_cpu(x) swap16(x) |
#define | cpu_to_be16(x) swap16(x) |
#define | BE16_TO_CPU(x) swap16(x) |
#define | CPU_TO_BE16(x) swap16(x) |
#define | le32_to_cpu(x) (x) |
#define | cpu_to_le32(x) (x) |
#define | LE32_TO_CPU(x) (x) |
#define | CPU_TO_LE32(x) (x) |
#define | be32_to_cpu(x) swap32(x) |
#define | cpu_to_be32(x) swap32(x) |
#define | BE32_TO_CPU(x) swap32(x) |
#define | CPU_TO_BE32(x) swap32(x) |
Endianism Conversion | |
The same considerations as for clz and ctz apply here but GCC's __builtin_bswap_32 and __builtin_bswap_64 do not behave like macros when applied to constant expressions, so two sets of macros are defined here:
| |
#define | Swap16(u16) |
Toggles the endianism of u16 (by swapping its bytes). More... | |
#define | Swap32(u32) |
Toggles the endianism of u32 (by swapping its bytes). More... | |
#define | Swap64(u64) |
Toggles the endianism of u64 (by swapping its bytes). More... | |
#define | swap16(u16) Swap16(u16) |
Toggles the endianism of u16 (by swapping its bytes). More... | |
#define | swap32(u32) Swap32(u32) |
Toggles the endianism of u32 (by swapping its bytes). More... | |
#define | swap64(u64) |
Toggles the endianism of u64 (by swapping its bytes). More... | |
Target Abstraction | |
typedef U8 | Byte |
8-bit unsigned integer. More... | |
#define | _GLOBEXT_ extern |
extern storage-class specifier. More... | |
#define | _CONST_TYPE_ const |
const type qualifier. More... | |
#define | _MEM_TYPE_SLOW_ |
Slow memory type. More... | |
#define | _MEM_TYPE_MEDFAST_ |
Fairly fast memory type. More... | |
#define | _MEM_TYPE_FAST_ |
Fast memory type. More... | |
#define | memcmp_ram2ram memcmp |
Target-specific memcmp of RAM to RAM. More... | |
#define | memcmp_code2ram memcmp |
Target-specific memcmp of RAM to NVRAM. More... | |
#define | memcpy_ram2ram memcpy |
Target-specific memcpy from RAM to RAM. More... | |
#define | memcpy_code2ram memcpy |
Target-specific memcpy from NVRAM to RAM. More... | |
#define | LSB0(u32) LSB0W(u32) |
Least significant byte of 1st rank of u32. More... | |
#define | LSB1(u32) LSB1W(u32) |
Least significant byte of 2nd rank of u32. More... | |
#define | LSB2(u32) LSB2W(u32) |
Least significant byte of 3rd rank of u32. More... | |
#define | LSB3(u32) LSB3W(u32) |
Least significant byte of 4th rank of u32. More... | |
#define | MSB3(u32) MSB3W(u32) |
Most significant byte of 4th rank of u32. More... | |
#define | MSB2(u32) MSB2W(u32) |
Most significant byte of 3rd rank of u32. More... | |
#define | MSB1(u32) MSB1W(u32) |
Most significant byte of 2nd rank of u32. More... | |
#define | MSB0(u32) MSB0W(u32) |
Most significant byte of 1st rank of u32. More... | |
Compiler abstraction layer and code utilities for AT91SAM. This module provides various abstraction layers and utilities to make code compatible between different compilers.
#define _CONST_TYPE_ const |
const type qualifier.
Definition at line 1006 of file compiler.h.
#define _GLOBEXT_ extern |
extern storage-class specifier.
Definition at line 1005 of file compiler.h.
#define _MEM_TYPE_FAST_ |
Fast memory type.
Definition at line 1009 of file compiler.h.
#define _MEM_TYPE_MEDFAST_ |
Fairly fast memory type.
Definition at line 1008 of file compiler.h.
#define _MEM_TYPE_SLOW_ |
Slow memory type.
Definition at line 1007 of file compiler.h.
#define Abs | ( | a | ) | (((a) < 0 ) ? -(a) : (a)) |
Takes the absolute value of a.
a | Input value. |
Definition at line 775 of file compiler.h.
#define ADDR_COPY_DST_SRC_16 | ( | dst, | |
src | |||
) | ((dst) = (src)) |
Definition at line 1087 of file compiler.h.
#define ADDR_COPY_DST_SRC_64 | ( | dst, | |
src | |||
) | ((dst) = (src)) |
Definition at line 1088 of file compiler.h.
#define Align_down | ( | val, | |
n | |||
) | ( (val) & ~((n) - 1)) |
Aligns the number val with the lower n boundary.
val | Input value. |
n | Boundary. |
Definition at line 749 of file compiler.h.
#define Align_up | ( | val, | |
n | |||
) | (((val) + ((n) - 1)) & ~((n) - 1)) |
Aligns the number val with the upper n boundary.
val | Input value. |
n | Boundary. |
Definition at line 740 of file compiler.h.
#define Assert | ( | expr | ) | ((void) 0) |
This macro is used to test fatal errors.
The macro tests if the expression is false. If it is, a fatal error is detected and the application hangs up. If TEST_SUITE_DEFINE_ASSERT_MACRO is defined, a unit test version of the macro is used, to allow execution of further tests after a false expression.
expr | Expression to evaluate and supposed to be nonzero. |
Definition at line 196 of file compiler.h.
#define barrier | ( | ) | __DMB() |
Memory barrier.
Definition at line 98 of file compiler.h.
#define BE16 | ( | x | ) | swap16(x) |
Definition at line 889 of file compiler.h.
#define be16_to_cpu | ( | x | ) | swap16(x) |
Definition at line 897 of file compiler.h.
#define BE16_TO_CPU | ( | x | ) | swap16(x) |
Definition at line 899 of file compiler.h.
#define be32_to_cpu | ( | x | ) | swap32(x) |
Definition at line 907 of file compiler.h.
#define BE32_TO_CPU | ( | x | ) | swap32(x) |
Definition at line 909 of file compiler.h.
#define bit_reverse16 | ( | u16 | ) | ((U16)(bit_reverse32((U16)(u16)) >> 16)) |
Reverses the bits of u16.
u16 | U16 of which to reverse the bits. |
Definition at line 679 of file compiler.h.
#define bit_reverse32 | ( | u32 | ) | __RBIT(u32) |
Reverses the bits of u32.
u32 | U32 of which to reverse the bits. |
Definition at line 687 of file compiler.h.
#define bit_reverse64 | ( | u64 | ) |
Reverses the bits of u64.
u64 | U64 of which to reverse the bits. |
Definition at line 695 of file compiler.h.
#define bit_reverse8 | ( | u8 | ) | ((U8)(bit_reverse32((U8)(u8)) >> 24)) |
Reverses the bits of u8.
u8 | U8 of which to reverse the bits. |
Definition at line 671 of file compiler.h.
#define CCPU_ENDIAN_TO_LE16 | ( | x | ) | (x) |
Definition at line 1083 of file compiler.h.
#define CCPU_ENDIAN_TO_LE32 | ( | x | ) | (x) |
Definition at line 1084 of file compiler.h.
#define CCPU_ENDIAN_TO_LE64 | ( | x | ) | (x) |
Definition at line 1085 of file compiler.h.
#define CLE16_TO_CPU_ENDIAN | ( | x | ) | (x) |
Definition at line 1078 of file compiler.h.
#define CLE32_TO_CPU_ENDIAN | ( | x | ) | (x) |
Definition at line 1079 of file compiler.h.
#define CLE64_TO_CPU_ENDIAN | ( | x | ) | (x) |
Definition at line 1080 of file compiler.h.
#define Clr_bits | ( | lvalue, | |
mask | |||
) | ((lvalue) &= ~(mask)) |
Clears the bits of a C lvalue specified by a given bit-mask.
lvalue | C lvalue of which to clear bits. |
mask | Bit-mask indicating bits to clear. |
Definition at line 512 of file compiler.h.
#define clz | ( | u | ) |
Counts the leading zero bits of the given value considered as a 32-bit integer.
u | Value of which to count the leading zero bits. |
Definition at line 579 of file compiler.h.
#define CMD_ID_OCTET (0) |
Definition at line 1065 of file compiler.h.
#define COMPILER_PACK_RESET | ( | ) | COMPILER_PRAGMA(pack()) |
Set default alignment for subsequent struct and union definitions.
Definition at line 120 of file compiler.h.
#define COMPILER_PACK_SET | ( | alignment | ) | COMPILER_PRAGMA(pack(alignment)) |
Set maximum alignment for subsequent struct and union definitions to alignment.
Definition at line 113 of file compiler.h.
#define COMPILER_PRAGMA | ( | arg | ) | _Pragma(#arg) |
Emit the compiler pragma arg.
arg | The pragma directive as it would appear after #pragma (i.e. not stringified). |
Definition at line 106 of file compiler.h.
#define CPU_ENDIAN_TO_LE16 | ( | x | ) | (x) |
Definition at line 1068 of file compiler.h.
#define CPU_ENDIAN_TO_LE32 | ( | x | ) | (x) |
Definition at line 1069 of file compiler.h.
#define CPU_ENDIAN_TO_LE64 | ( | x | ) | (x) |
Definition at line 1070 of file compiler.h.
#define cpu_to_be16 | ( | x | ) | swap16(x) |
Definition at line 898 of file compiler.h.
#define CPU_TO_BE16 | ( | x | ) | swap16(x) |
Definition at line 900 of file compiler.h.
#define cpu_to_be32 | ( | x | ) | swap32(x) |
Definition at line 908 of file compiler.h.
#define CPU_TO_BE32 | ( | x | ) | swap32(x) |
Definition at line 910 of file compiler.h.
#define cpu_to_le16 | ( | x | ) | (x) |
Definition at line 893 of file compiler.h.
#define CPU_TO_LE16 | ( | x | ) | (x) |
Definition at line 895 of file compiler.h.
#define cpu_to_le32 | ( | x | ) | (x) |
Definition at line 903 of file compiler.h.
#define CPU_TO_LE32 | ( | x | ) | (x) |
Definition at line 905 of file compiler.h.
#define ctz | ( | u | ) |
Counts the trailing zero bits of the given value considered as a 32-bit integer.
u | Value of which to count the trailing zero bits. |
Definition at line 623 of file compiler.h.
#define DISABLE 0 |
Definition at line 420 of file compiler.h.
#define div_ceil | ( | a, | |
b | |||
) | (((a) + (b) - 1) / (b)) |
Calculate using integer arithmetic.
a | An integer |
b | Another integer |
Definition at line 1038 of file compiler.h.
#define ENABLE 1 |
Definition at line 421 of file compiler.h.
#define FAIL 1 |
Definition at line 429 of file compiler.h.
#define false 0 |
Definition at line 424 of file compiler.h.
#define FLASH_DECLARE | ( | x | ) | const x |
Definition at line 1056 of file compiler.h.
#define FLASH_EXTERN | ( | x | ) | extern const x |
Definition at line 1057 of file compiler.h.
#define FUNC_PTR void * |
Definition at line 81 of file compiler.h.
#define Get_align | ( | val, | |
n | |||
) | ( Rd_bits( val, (n) - 1 ) ) |
Gets alignment of the number val with respect to the n boundary.
val | Input value. |
n | Boundary. |
Definition at line 721 of file compiler.h.
#define HIGH 1 |
Definition at line 431 of file compiler.h.
#define is_constant | ( | exp | ) | (0) |
Determine if an expression evaluates to a constant value.
exp | Any expression |
Definition at line 467 of file compiler.h.
#define LE16 | ( | x | ) | (x) |
Definition at line 890 of file compiler.h.
#define le16_to_cpu | ( | x | ) | (x) |
Definition at line 892 of file compiler.h.
#define LE16_TO_CPU | ( | x | ) | (x) |
Definition at line 894 of file compiler.h.
#define LE16_TO_CPU_ENDIAN | ( | x | ) | (x) |
Definition at line 1073 of file compiler.h.
#define le32_to_cpu | ( | x | ) | (x) |
Definition at line 902 of file compiler.h.
#define LE32_TO_CPU | ( | x | ) | (x) |
Definition at line 904 of file compiler.h.
#define LE32_TO_CPU_ENDIAN | ( | x | ) | (x) |
Definition at line 1074 of file compiler.h.
#define LE64_TO_CPU_ENDIAN | ( | x | ) | (x) |
Definition at line 1075 of file compiler.h.
#define likely | ( | exp | ) | (exp) |
The expression exp is likely to be true.
Definition at line 445 of file compiler.h.
#define Long_call | ( | addr | ) | ((*(void (*)(void))(addr))()) |
Calls the routine at address addr.
It generates a long call opcode.
For example, `Long_call(0x80000000)' generates a software reset on a UC3 if it is invoked from the CPU supervisor mode.
addr | Address of the routine to call. |
Definition at line 841 of file compiler.h.
#define LOW 0 |
Definition at line 430 of file compiler.h.
#define LSB | ( | u16 | ) | (((U8 *)&(u16))[0]) |
Least significant byte of u16.
Definition at line 849 of file compiler.h.
#define LSB0 | ( | u32 | ) | LSB0W(u32) |
Least significant byte of 1st rank of u32.
Definition at line 1018 of file compiler.h.
#define LSB0D | ( | u64 | ) | MSB7D(u64) |
Least significant byte of 1st rank of u64.
Definition at line 887 of file compiler.h.
#define LSB0W | ( | u32 | ) | MSB3W(u32) |
Least significant byte of 1st rank of u32.
Definition at line 860 of file compiler.h.
#define LSB1 | ( | u32 | ) | LSB1W(u32) |
Least significant byte of 2nd rank of u32.
Definition at line 1019 of file compiler.h.
#define LSB1D | ( | u64 | ) | MSB6D(u64) |
Least significant byte of 2nd rank of u64.
Definition at line 886 of file compiler.h.
#define LSB1W | ( | u32 | ) | MSB2W(u32) |
Least significant byte of 2nd rank of u32.
Definition at line 859 of file compiler.h.
#define LSB2 | ( | u32 | ) | LSB2W(u32) |
Least significant byte of 3rd rank of u32.
Definition at line 1020 of file compiler.h.
#define LSB2D | ( | u64 | ) | MSB5D(u64) |
Least significant byte of 3rd rank of u64.
Definition at line 885 of file compiler.h.
#define LSB2W | ( | u32 | ) | MSB1W(u32) |
Least significant byte of 3rd rank of u32.
Definition at line 858 of file compiler.h.
#define LSB3 | ( | u32 | ) | LSB3W(u32) |
Least significant byte of 4th rank of u32.
Definition at line 1021 of file compiler.h.
#define LSB3D | ( | u64 | ) | MSB4D(u64) |
Least significant byte of 4th rank of u64.
Definition at line 884 of file compiler.h.
#define LSB3W | ( | u32 | ) | MSB0W(u32) |
Least significant byte of 4th rank of u32.
Definition at line 857 of file compiler.h.
#define LSB4D | ( | u64 | ) | MSB3D(u64) |
Least significant byte of 5th rank of u64.
Definition at line 883 of file compiler.h.
#define LSB5D | ( | u64 | ) | MSB2D(u64) |
Least significant byte of 6th rank of u64.
Definition at line 882 of file compiler.h.
#define LSB6D | ( | u64 | ) | MSB1D(u64) |
Least significant byte of 7th rank of u64.
Definition at line 881 of file compiler.h.
#define LSB7D | ( | u64 | ) | MSB0D(u64) |
Least significant byte of 8th rank of u64.
Definition at line 880 of file compiler.h.
#define LSH | ( | u32 | ) | (((U16 *)&(u32))[0]) |
Least significant half-word of u32.
Definition at line 852 of file compiler.h.
#define LSH0 | ( | u64 | ) | MSH3(u64) |
Least significant half-word of 1st rank of u64.
Definition at line 871 of file compiler.h.
#define LSH1 | ( | u64 | ) | MSH2(u64) |
Least significant half-word of 2nd rank of u64.
Definition at line 870 of file compiler.h.
#define LSH2 | ( | u64 | ) | MSH1(u64) |
Least significant half-word of 3rd rank of u64.
Definition at line 869 of file compiler.h.
#define LSH3 | ( | u64 | ) | MSH0(u64) |
Least significant half-word of 4th rank of u64.
Definition at line 868 of file compiler.h.
#define LSW | ( | u64 | ) | (((U32 *)&(u64))[0]) |
Least significant word of u64.
Definition at line 863 of file compiler.h.
#define Max | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Takes the maximal value of a and b.
a | Input value. |
b | Input value. |
Definition at line 797 of file compiler.h.
#define max | ( | a, | |
b | |||
) | Max(a, b) |
Takes the maximal value of a and b.
a | Input value. |
b | Input value. |
Definition at line 823 of file compiler.h.
#define memcmp_code2ram memcmp |
Target-specific memcmp of RAM to NVRAM.
Definition at line 1014 of file compiler.h.
#define memcmp_ram2ram memcmp |
Target-specific memcmp of RAM to RAM.
Definition at line 1013 of file compiler.h.
#define memcpy_code2ram memcpy |
Target-specific memcpy from NVRAM to RAM.
Definition at line 1016 of file compiler.h.
#define MEMCPY_ENDIAN memcpy |
Definition at line 1061 of file compiler.h.
#define memcpy_ram2ram memcpy |
Target-specific memcpy from RAM to RAM.
Definition at line 1015 of file compiler.h.
#define Min | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Takes the minimal value of a and b.
a | Input value. |
b | Input value. |
Definition at line 786 of file compiler.h.
#define min | ( | a, | |
b | |||
) | Min(a, b) |
Takes the minimal value of a and b.
a | Input value. |
b | Input value. |
Definition at line 812 of file compiler.h.
#define MSB | ( | u16 | ) | (((U8 *)&(u16))[1]) |
Most significant byte of u16.
Definition at line 848 of file compiler.h.
#define MSB0 | ( | u32 | ) | MSB0W(u32) |
Most significant byte of 1st rank of u32.
Definition at line 1025 of file compiler.h.
#define MSB0D | ( | u64 | ) | (((U8 *)&(u64))[7]) |
Most significant byte of 1st rank of u64.
Definition at line 872 of file compiler.h.
#define MSB0W | ( | u32 | ) | (((U8 *)&(u32))[3]) |
Most significant byte of 1st rank of u32.
Definition at line 853 of file compiler.h.
#define MSB1 | ( | u32 | ) | MSB1W(u32) |
Most significant byte of 2nd rank of u32.
Definition at line 1024 of file compiler.h.
#define MSB1D | ( | u64 | ) | (((U8 *)&(u64))[6]) |
Most significant byte of 2nd rank of u64.
Definition at line 873 of file compiler.h.
#define MSB1W | ( | u32 | ) | (((U8 *)&(u32))[2]) |
Most significant byte of 2nd rank of u32.
Definition at line 854 of file compiler.h.
#define MSB2 | ( | u32 | ) | MSB2W(u32) |
Most significant byte of 3rd rank of u32.
Definition at line 1023 of file compiler.h.
#define MSB2D | ( | u64 | ) | (((U8 *)&(u64))[5]) |
Most significant byte of 3rd rank of u64.
Definition at line 874 of file compiler.h.
#define MSB2W | ( | u32 | ) | (((U8 *)&(u32))[1]) |
Most significant byte of 3rd rank of u32.
Definition at line 855 of file compiler.h.
#define MSB3 | ( | u32 | ) | MSB3W(u32) |
Most significant byte of 4th rank of u32.
Definition at line 1022 of file compiler.h.
#define MSB3D | ( | u64 | ) | (((U8 *)&(u64))[4]) |
Most significant byte of 4th rank of u64.
Definition at line 875 of file compiler.h.
#define MSB3W | ( | u32 | ) | (((U8 *)&(u32))[0]) |
Most significant byte of 4th rank of u32.
Definition at line 856 of file compiler.h.
#define MSB4D | ( | u64 | ) | (((U8 *)&(u64))[3]) |
Most significant byte of 5th rank of u64.
Definition at line 876 of file compiler.h.
#define MSB5D | ( | u64 | ) | (((U8 *)&(u64))[2]) |
Most significant byte of 6th rank of u64.
Definition at line 877 of file compiler.h.
#define MSB6D | ( | u64 | ) | (((U8 *)&(u64))[1]) |
Most significant byte of 7th rank of u64.
Definition at line 878 of file compiler.h.
#define MSB7D | ( | u64 | ) | (((U8 *)&(u64))[0]) |
Most significant byte of 8th rank of u64.
Definition at line 879 of file compiler.h.
#define MSH | ( | u32 | ) | (((U16 *)&(u32))[1]) |
Most significant half-word of u32.
Definition at line 851 of file compiler.h.
#define MSH0 | ( | u64 | ) | (((U16 *)&(u64))[3]) |
Most significant half-word of 1st rank of u64.
Definition at line 864 of file compiler.h.
#define MSH1 | ( | u64 | ) | (((U16 *)&(u64))[2]) |
Most significant half-word of 2nd rank of u64.
Definition at line 865 of file compiler.h.
#define MSH2 | ( | u64 | ) | (((U16 *)&(u64))[1]) |
Most significant half-word of 3rd rank of u64.
Definition at line 866 of file compiler.h.
#define MSH3 | ( | u64 | ) | (((U16 *)&(u64))[0]) |
Most significant half-word of 4th rank of u64.
Definition at line 867 of file compiler.h.
#define MSW | ( | u64 | ) | (((U32 *)&(u64))[1]) |
Most significant word of u64.
Definition at line 862 of file compiler.h.
#define PASS 0 |
Definition at line 428 of file compiler.h.
#define PGM_READ_BLOCK | ( | dst, | |
src, | |||
len | |||
) | memcpy((dst), (src), (len)) |
Definition at line 1062 of file compiler.h.
#define PGM_READ_BYTE | ( | x | ) | *(x) |
Definition at line 1058 of file compiler.h.
#define PGM_READ_DWORD | ( | x | ) | *(x) |
Definition at line 1060 of file compiler.h.
#define PGM_READ_WORD | ( | x | ) | *(x) |
Definition at line 1059 of file compiler.h.
Reads the bit-field of a value specified by a given bit-mask.
value | Value to read a bit-field from. |
mask | Bit-mask indicating the bit-field to read. |
Definition at line 539 of file compiler.h.
#define Rd_bits | ( | value, | |
mask | |||
) | ((value) & (mask)) |
Reads the bits of a value specified by a given bit-mask.
value | Value to read bits from. |
mask | Bit-mask indicating bits to read. |
Definition at line 483 of file compiler.h.
#define Set_align | ( | lval, | |
n, | |||
alg | |||
) | ( Wr_bits(lval, (n) - 1, alg) ) |
Sets alignment of the lvalue number lval to alg with respect to the n boundary.
lval | Input/output lvalue. |
n | Boundary. |
alg | Alignment. |
Definition at line 731 of file compiler.h.
#define Set_bits | ( | lvalue, | |
mask | |||
) | ((lvalue) |= (mask)) |
Sets the bits of a C lvalue specified by a given bit-mask.
lvalue | C lvalue of which to set bits. |
mask | Bit-mask indicating bits to set. |
Definition at line 521 of file compiler.h.
#define Swap16 | ( | u16 | ) |
Toggles the endianism of u16 (by swapping its bytes).
u16 | U16 of which to toggle the endianism. |
Definition at line 934 of file compiler.h.
#define swap16 | ( | u16 | ) | Swap16(u16) |
Toggles the endianism of u16 (by swapping its bytes).
u16 | U16 of which to toggle the endianism. |
Definition at line 967 of file compiler.h.
#define Swap32 | ( | u32 | ) |
Toggles the endianism of u32 (by swapping its bytes).
u32 | U32 of which to toggle the endianism. |
Definition at line 945 of file compiler.h.
#define swap32 | ( | u32 | ) | Swap32(u32) |
Toggles the endianism of u32 (by swapping its bytes).
u32 | U32 of which to toggle the endianism. |
Definition at line 980 of file compiler.h.
#define Swap64 | ( | u64 | ) |
Toggles the endianism of u64 (by swapping its bytes).
u64 | U64 of which to toggle the endianism. |
Definition at line 956 of file compiler.h.
#define swap64 | ( | u64 | ) |
Toggles the endianism of u64 (by swapping its bytes).
u64 | U64 of which to toggle the endianism. |
Definition at line 994 of file compiler.h.
#define Test_align | ( | val, | |
n | |||
) | (!Tst_bits( val, (n) - 1 ) ) |
Tests alignment of the number val with the n boundary.
val | Input value. |
n | Boundary. |
1
if the number val is aligned with the n boundary, else 0
. Definition at line 712 of file compiler.h.
#define Tgl_bits | ( | lvalue, | |
mask | |||
) | ((lvalue) ^= (mask)) |
Toggles the bits of a C lvalue specified by a given bit-mask.
lvalue | C lvalue of which to toggle bits. |
mask | Bit-mask indicating bits to toggle. |
Definition at line 530 of file compiler.h.
#define true 1 |
Definition at line 425 of file compiler.h.
#define Tst_bits | ( | value, | |
mask | |||
) | (Rd_bits(value, mask) != 0) |
Tests the bits of a value specified by a given bit-mask.
value | Value of which to test bits. |
mask | Bit-mask indicating bits to test. |
1
if at least one of the tested bits is set, else 0
. Definition at line 503 of file compiler.h.
#define unlikely | ( | exp | ) | (exp) |
The expression exp is unlikely to be true.
Definition at line 453 of file compiler.h.
#define UNUSED | ( | v | ) | (void)(v) |
Marking v as a unused parameter or value.
Definition at line 86 of file compiler.h.
#define unused | ( | v | ) | do { (void)(v); } while(0) |
Marking v as a unused parameter or value.
Definition at line 92 of file compiler.h.
#define Wr_bitfield | ( | lvalue, | |
mask, | |||
bitfield | |||
) | (Wr_bits(lvalue, mask, (U32)(bitfield) << ctz(mask))) |
Writes the bit-field of a C lvalue specified by a given bit-mask.
lvalue | C lvalue to write a bit-field to. |
mask | Bit-mask indicating the bit-field to write. |
bitfield | Bit-field to write. |
Definition at line 549 of file compiler.h.
#define Wr_bits | ( | lvalue, | |
mask, | |||
bits | |||
) |
Writes the bits of a C lvalue specified by a given bit-mask.
lvalue | C lvalue to write bits to. |
mask | Bit-mask indicating bits to write. |
bits | Bits to write. |
Definition at line 493 of file compiler.h.
typedef uint16_t be16_t |
Definition at line 251 of file compiler.h.
typedef uint32_t be32_t |
Definition at line 255 of file compiler.h.
typedef unsigned char Bool |
Boolean.
Definition at line 240 of file compiler.h.
typedef unsigned char bool |
Boolean.
Definition at line 243 of file compiler.h.
8-bit unsigned integer.
Definition at line 1011 of file compiler.h.
typedef float F32 |
32-bit floating-point number.
Definition at line 258 of file compiler.h.
typedef double F64 |
64-bit floating-point number.
Definition at line 259 of file compiler.h.
typedef uint32_t iram_size_t |
Definition at line 260 of file compiler.h.
typedef uint16_t le16_t |
Definition at line 250 of file compiler.h.
typedef uint32_t le32_t |
Definition at line 254 of file compiler.h.
typedef int16_t S16 |
16-bit signed integer.
Definition at line 248 of file compiler.h.
typedef int32_t S32 |
32-bit signed integer.
Definition at line 252 of file compiler.h.
typedef int64_t S64 |
64-bit signed integer.
Definition at line 256 of file compiler.h.
typedef int8_t S8 |
8-bit signed integer.
Definition at line 246 of file compiler.h.
typedef bool Status_bool_t |
Boolean status.
Definition at line 267 of file compiler.h.
8-bit-coded status.
Definition at line 268 of file compiler.h.
typedef uint16_t U16 |
16-bit unsigned integer.
Definition at line 249 of file compiler.h.
typedef uint32_t U32 |
32-bit unsigned integer.
Definition at line 253 of file compiler.h.
typedef uint64_t U64 |
64-bit unsigned integer.
Definition at line 257 of file compiler.h.
typedef uint8_t U8 |
8-bit unsigned integer.
Definition at line 247 of file compiler.h.
|
inlinestatic |
Definition at line 1129 of file compiler.h.
|
inlinestatic |
Converts a 16-Bit value into a 2 Byte array.
[in] | value | 16-Bit value |
[out] | data | Pointer to the 2 Byte array to be updated with 16-Bit value |
Definition at line 1115 of file compiler.h.
|
inlinestatic |
Converts a 64-Bit value into a 8 Byte array.
[in] | value | 64-Bit value |
[out] | data | Pointer to the 8 Byte array to be updated with 64-Bit value |
Definition at line 1097 of file compiler.h.
|
inlinestatic |
Definition at line 1143 of file compiler.h.
|
inlinestatic |
Definition at line 1149 of file compiler.h.
|
inlinestatic |
Converts a 8 Byte array into a 64-Bit value.
data | Specifies the pointer to the 8 Byte array |
Definition at line 1172 of file compiler.h.
|
inlinestatic |
Definition at line 1122 of file compiler.h.