Pico GPS Teseo I2C
Loading...
Searching...
No Matches
Compiler abstraction layer and code utilities
Collaboration diagram for Compiler abstraction layer and code utilities:

Topics

 Preprocessor - Macro Repeat
 
 Preprocessor - Stringize
 
 Preprocessor - Token Paste
 

Classes

union  Union16
 16-bit union. More...
 
union  Union32
 32-bit union. More...
 
union  Union64
 64-bit union. 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...
 
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...
 
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...
 
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...
 

Macros

#define FUNC_PTR   void *
 
#define UNUSED(v)
 Marking v as a unused parameter or value.
 
#define unused(v)
 Marking v as a unused parameter or value.
 
#define barrier()
 Memory barrier.
 
#define COMPILER_PRAGMA(arg)
 Emit the compiler pragma arg.
 
#define COMPILER_PACK_SET(alignment)
 Set maximum alignment for subsequent struct and union definitions to alignment.
 
#define COMPILER_PACK_RESET()
 Set default alignment for subsequent struct and union definitions.
 
#define __always_inline   __inline__ __attribute__((__always_inline__))
 Set aligned boundary.
 
#define Assert(expr)
 This macro is used to test fatal errors.
 
#define Long_call(addr)
 Calls the routine at address addr.
 
#define div_ceil(a, b)
 Calculate $ \left\lceil \frac{a}{b} \right\rceil $ using integer arithmetic.
 
#define FLASH_DECLARE(x)
 
#define FLASH_EXTERN(x)
 
#define PGM_READ_BYTE(x)
 
#define PGM_READ_WORD(x)
 
#define PGM_READ_DWORD(x)
 
#define MEMCPY_ENDIAN   memcpy
 
#define PGM_READ_BLOCK(dst, src, len)
 
#define CMD_ID_OCTET   (0)
 
#define CPU_ENDIAN_TO_LE16(x)
 
#define CPU_ENDIAN_TO_LE32(x)
 
#define CPU_ENDIAN_TO_LE64(x)
 
#define LE16_TO_CPU_ENDIAN(x)
 
#define LE32_TO_CPU_ENDIAN(x)
 
#define LE64_TO_CPU_ENDIAN(x)
 
#define CLE16_TO_CPU_ENDIAN(x)
 
#define CLE32_TO_CPU_ENDIAN(x)
 
#define CLE64_TO_CPU_ENDIAN(x)
 
#define CCPU_ENDIAN_TO_LE16(x)
 
#define CCPU_ENDIAN_TO_LE32(x)
 
#define CCPU_ENDIAN_TO_LE64(x)
 
#define ADDR_COPY_DST_SRC_16(dst, src)
 
#define ADDR_COPY_DST_SRC_64(dst, src)
 

Usual Types

typedef unsigned char Bool
 Boolean.
 
typedef unsigned char bool
 Boolean.
 
typedef int8_t S8
 8-bit signed integer.
 
typedef uint8_t U8
 8-bit unsigned integer.
 
typedef int16_t S16
 16-bit signed integer.
 
typedef uint16_t U16
 16-bit unsigned integer.
 
typedef uint16_t le16_t
 
typedef uint16_t be16_t
 
typedef int32_t S32
 32-bit signed integer.
 
typedef uint32_t U32
 32-bit unsigned integer.
 
typedef uint32_t le32_t
 
typedef uint32_t be32_t
 
typedef int64_t S64
 64-bit signed integer.
 
typedef uint64_t U64
 64-bit unsigned integer.
 
typedef float F32
 32-bit floating-point number.
 
typedef double F64
 64-bit floating-point number.
 
typedef uint32_t iram_size_t
 

Status Types

typedef bool Status_bool_t
 Boolean status.
 
typedef U8 Status_t
 

Target Abstraction

typedef U8 Byte
 8-bit unsigned integer.
 
#define _GLOBEXT_   extern
 extern storage-class specifier.
 
#define _CONST_TYPE_   const
 const type qualifier.
 
#define _MEM_TYPE_SLOW_
 Slow memory type.
 
#define _MEM_TYPE_MEDFAST_
 Fairly fast memory type.
 
#define _MEM_TYPE_FAST_
 Fast memory type.
 
#define memcmp_ram2ram   memcmp
 Target-specific memcmp of RAM to RAM.
 
#define memcmp_code2ram   memcmp
 Target-specific memcmp of RAM to NVRAM.
 
#define memcpy_ram2ram   memcpy
 Target-specific memcpy from RAM to RAM.
 
#define memcpy_code2ram   memcpy
 Target-specific memcpy from NVRAM to RAM.
 
#define LSB0(u32)
 Least significant byte of 1st rank of u32.
 
#define LSB1(u32)
 Least significant byte of 2nd rank of u32.
 
#define LSB2(u32)
 Least significant byte of 3rd rank of u32.
 
#define LSB3(u32)
 Least significant byte of 4th rank of u32.
 
#define MSB3(u32)
 Most significant byte of 4th rank of u32.
 
#define MSB2(u32)
 Most significant byte of 3rd rank of u32.
 
#define MSB1(u32)
 Most significant byte of 2nd rank of u32.
 
#define MSB0(u32)
 Most significant byte of 1st rank of u32.
 

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)
 The expression exp is likely to be true.
 
#define unlikely(exp)
 The expression exp is unlikely to be true.
 
#define is_constant(exp)
 Determine if an expression evaluates to a constant value.
 

Bit-Field Handling

#define Rd_bits(value, mask)
 Reads the bits of a value specified by a given bit-mask.
 
#define Wr_bits(lvalue, mask, bits)
 Writes the bits of a C lvalue specified by a given bit-mask.
 
#define Tst_bits(value, mask)
 Tests the bits of a value specified by a given bit-mask.
 
#define Clr_bits(lvalue, mask)
 Clears the bits of a C lvalue specified by a given bit-mask.
 
#define Set_bits(lvalue, mask)
 Sets the bits of a C lvalue specified by a given bit-mask.
 
#define Tgl_bits(lvalue, mask)
 Toggles the bits of a C lvalue specified by a given bit-mask.
 
#define Rd_bitfield(value, mask)
 Reads the bit-field of a value specified by a given bit-mask.
 
#define Wr_bitfield(lvalue, mask, bitfield)
 Writes the bit-field of a C lvalue specified by a given bit-mask.
 

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.
 
#define ctz(u)
 Counts the trailing zero bits of the given value considered as a 32-bit integer.
 

Bit Reversing

#define bit_reverse8(u8)
 Reverses the bits of u8.
 
#define bit_reverse16(u16)
 Reverses the bits of u16.
 
#define bit_reverse32(u32)
 Reverses the bits of u32.
 
#define bit_reverse64(u64)
 Reverses the bits of u64.
 

Alignment

#define Test_align(val, n)
 Tests alignment of the number val with the n boundary.
 
#define Get_align(val, n)
 Gets alignment of the number val with respect to the n boundary.
 
#define Set_align(lval, n, alg)
 Sets alignment of the lvalue number lval to alg with respect to the n boundary.
 
#define Align_up( val, n)
 Aligns the number val with the upper n boundary.
 
#define Align_down(val, n)
 Aligns the number val with the lower n boundary.
 

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:

  • Abs, Min and Max to apply to constant expressions (values known at compile time);
  • abs, min and max to apply to non-constant expressions (values unknown at compile time), abs is found in stdlib.h.
#define Abs(a)
 Takes the absolute value of a.
 
#define Min(a, b)
 Takes the minimal value of a and b.
 
#define Max(a, b)
 Takes the maximal value of a and b.
 
#define min(a, b)
 Takes the minimal value of a and b.
 
#define max(a, b)
 Takes the maximal value of a and b.
 

MCU Endianism Handling

ARM is MCU little endianism.

#define MSB(u16)
 Most significant byte of u16.
 
#define LSB(u16)
 Least significant byte of u16.
 
#define MSH(u32)
 Most significant half-word of u32.
 
#define LSH(u32)
 Least significant half-word of u32.
 
#define MSB0W(u32)
 Most significant byte of 1st rank of u32.
 
#define MSB1W(u32)
 Most significant byte of 2nd rank of u32.
 
#define MSB2W(u32)
 Most significant byte of 3rd rank of u32.
 
#define MSB3W(u32)
 Most significant byte of 4th rank of u32.
 
#define LSB3W(u32)
 Least significant byte of 4th rank of u32.
 
#define LSB2W(u32)
 Least significant byte of 3rd rank of u32.
 
#define LSB1W(u32)
 Least significant byte of 2nd rank of u32.
 
#define LSB0W(u32)
 Least significant byte of 1st rank of u32.
 
#define MSW(u64)
 Most significant word of u64.
 
#define LSW(u64)
 Least significant word of u64.
 
#define MSH0(u64)
 Most significant half-word of 1st rank of u64.
 
#define MSH1(u64)
 Most significant half-word of 2nd rank of u64.
 
#define MSH2(u64)
 Most significant half-word of 3rd rank of u64.
 
#define MSH3(u64)
 Most significant half-word of 4th rank of u64.
 
#define LSH3(u64)
 Least significant half-word of 4th rank of u64.
 
#define LSH2(u64)
 Least significant half-word of 3rd rank of u64.
 
#define LSH1(u64)
 Least significant half-word of 2nd rank of u64.
 
#define LSH0(u64)
 Least significant half-word of 1st rank of u64.
 
#define MSB0D(u64)
 Most significant byte of 1st rank of u64.
 
#define MSB1D(u64)
 Most significant byte of 2nd rank of u64.
 
#define MSB2D(u64)
 Most significant byte of 3rd rank of u64.
 
#define MSB3D(u64)
 Most significant byte of 4th rank of u64.
 
#define MSB4D(u64)
 Most significant byte of 5th rank of u64.
 
#define MSB5D(u64)
 Most significant byte of 6th rank of u64.
 
#define MSB6D(u64)
 Most significant byte of 7th rank of u64.
 
#define MSB7D(u64)
 Most significant byte of 8th rank of u64.
 
#define LSB7D(u64)
 Least significant byte of 8th rank of u64.
 
#define LSB6D(u64)
 Least significant byte of 7th rank of u64.
 
#define LSB5D(u64)
 Least significant byte of 6th rank of u64.
 
#define LSB4D(u64)
 Least significant byte of 5th rank of u64.
 
#define LSB3D(u64)
 Least significant byte of 4th rank of u64.
 
#define LSB2D(u64)
 Least significant byte of 3rd rank of u64.
 
#define LSB1D(u64)
 Least significant byte of 2nd rank of u64.
 
#define LSB0D(u64)
 Least significant byte of 1st rank of u64.
 
#define BE16(x)
 
#define LE16(x)
 
#define le16_to_cpu(x)
 
#define cpu_to_le16(x)
 
#define LE16_TO_CPU(x)
 
#define CPU_TO_LE16(x)
 
#define be16_to_cpu(x)
 
#define cpu_to_be16(x)
 
#define BE16_TO_CPU(x)
 
#define CPU_TO_BE16(x)
 
#define le32_to_cpu(x)
 
#define cpu_to_le32(x)
 
#define LE32_TO_CPU(x)
 
#define CPU_TO_LE32(x)
 
#define be32_to_cpu(x)
 
#define cpu_to_be32(x)
 
#define BE32_TO_CPU(x)
 
#define CPU_TO_BE32(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:

  • Swap16, Swap32 and Swap64 to apply to constant expressions (values known at compile time);
  • swap16, swap32 and swap64 to apply to non-constant expressions (values unknown at compile time).
#define Swap16(u16)
 Toggles the endianism of u16 (by swapping its bytes).
 
#define Swap32(u32)
 Toggles the endianism of u32 (by swapping its bytes).
 
#define Swap64(u64)
 Toggles the endianism of u64 (by swapping its bytes).
 
#define swap16(u16)
 Toggles the endianism of u16 (by swapping its bytes).
 
#define swap32(u32)
 Toggles the endianism of u32 (by swapping its bytes).
 
#define swap64(u64)
 Toggles the endianism of u64 (by swapping its bytes).
 

Detailed Description

Compiler abstraction layer and code utilities for AT91SAM. This module provides various abstraction layers and utilities to make code compatible between different compilers.

Macro Definition Documentation

◆ __always_inline

#define __always_inline   __inline__ __attribute__((__always_inline__))

Set aligned boundary.

Set word-aligned boundary.

The function should always be inlined.

This annotation instructs the compiler to ignore its inlining heuristics and inline the function no matter how big it thinks it becomes.

Definition at line 24 of file cdefs.h.

◆ _CONST_TYPE_

#define _CONST_TYPE_   const

const type qualifier.

Definition at line 1015 of file compiler.h.

◆ _GLOBEXT_

#define _GLOBEXT_   extern

extern storage-class specifier.

Definition at line 1014 of file compiler.h.

◆ _MEM_TYPE_FAST_

#define _MEM_TYPE_FAST_

Fast memory type.

Definition at line 1018 of file compiler.h.

◆ _MEM_TYPE_MEDFAST_

#define _MEM_TYPE_MEDFAST_

Fairly fast memory type.

Definition at line 1017 of file compiler.h.

◆ _MEM_TYPE_SLOW_

#define _MEM_TYPE_SLOW_

Slow memory type.

Definition at line 1016 of file compiler.h.

◆ Abs

#define Abs ( a)
Value:
(((a) < 0 ) ? -(a) : (a))
int16x4_t a
Definition neon.h:62

Takes the absolute value of a.

Parameters
aInput value.
Returns
Absolute value of a.
Note
More optimized if only used with values known at compile time.

Definition at line 788 of file compiler.h.

◆ ADDR_COPY_DST_SRC_16

#define ADDR_COPY_DST_SRC_16 ( dst,
src )
Value:
((dst) = (src))
void * dst
Definition ctypes.h:173
src
Definition ctypes.h:120

Definition at line 1096 of file compiler.h.

◆ ADDR_COPY_DST_SRC_64

#define ADDR_COPY_DST_SRC_64 ( dst,
src )
Value:
((dst) = (src))

Definition at line 1097 of file compiler.h.

◆ Align_down

#define Align_down ( val,
n )
Value:
( (val) & ~((n) - 1))
int int n
Definition ctypes.h:90

Aligns the number val with the lower n boundary.

Parameters
valInput value.
nBoundary.
Returns
Value resulting from the number val aligned with the lower n boundary.

Definition at line 762 of file compiler.h.

◆ Align_up

#define Align_up ( val,
n )
Value:
(((val) + ((n) - 1)) & ~((n) - 1))

Aligns the number val with the upper n boundary.

Parameters
valInput value.
nBoundary.
Returns
Value resulting from the number val aligned with the upper n boundary.

Definition at line 753 of file compiler.h.

◆ Assert

#define Assert ( expr)
Value:
((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.

Parameters
exprExpression to evaluate and supposed to be nonzero.

Definition at line 209 of file compiler.h.

◆ barrier

#define barrier ( )
Value:
#define __DMB()
Data Memory Barrier.

Memory barrier.

Definition at line 108 of file compiler.h.

◆ BE16

#define BE16 ( x)
Value:
#define Swap16(u16)
Toggles the endianism of u16 (by swapping its bytes).
Definition compiler.h:943
float x
Definition sqrt_test.cpp:13

Definition at line 898 of file compiler.h.

◆ BE16_TO_CPU

#define BE16_TO_CPU ( x)
Value:

Definition at line 908 of file compiler.h.

◆ be16_to_cpu

#define be16_to_cpu ( x)
Value:

Definition at line 906 of file compiler.h.

◆ BE32_TO_CPU

#define BE32_TO_CPU ( x)
Value:
#define swap32(u32)
Toggles the endianism of u32 (by swapping its bytes).
Definition compiler.h:989

Definition at line 918 of file compiler.h.

◆ be32_to_cpu

#define be32_to_cpu ( x)
Value:

Definition at line 916 of file compiler.h.

◆ bit_reverse16

#define bit_reverse16 ( u16)
Value:
((U16)(bit_reverse32((U16)(u16)) >> 16))
uint16_t U16
16-bit unsigned integer.
Definition compiler.h:262
#define bit_reverse32(u32)
Reverses the bits of u32.
Definition compiler.h:700

Reverses the bits of u16.

Parameters
u16U16 of which to reverse the bits.
Returns
Value resulting from u16 with reversed bits.

Definition at line 692 of file compiler.h.

◆ bit_reverse32

#define bit_reverse32 ( u32)
Value:
#define __RBIT
Reverse bit order of value.
uint32_t u32
Definition rijndael.c:10

Reverses the bits of u32.

Parameters
u32U32 of which to reverse the bits.
Returns
Value resulting from u32 with reversed bits.

Definition at line 700 of file compiler.h.

◆ bit_reverse64

#define bit_reverse64 ( u64)
Value:
((U64)(((U64)bit_reverse32((U64)(u64) >> 32)) |\
((U64)bit_reverse32((U64)(u64)) << 32)))
uint64_t U64
64-bit unsigned integer.
Definition compiler.h:270

Reverses the bits of u64.

Parameters
u64U64 of which to reverse the bits.
Returns
Value resulting from u64 with reversed bits.

Definition at line 708 of file compiler.h.

◆ bit_reverse8

#define bit_reverse8 ( u8)
Value:
((U8)(bit_reverse32((U8)(u8)) >> 24))
uint8_t U8
8-bit unsigned integer.
Definition compiler.h:260
uint8_t u8
Definition rijndael.c:11

Reverses the bits of u8.

Parameters
u8U8 of which to reverse the bits.
Returns
Value resulting from u8 with reversed bits.

Definition at line 684 of file compiler.h.

◆ CCPU_ENDIAN_TO_LE16

#define CCPU_ENDIAN_TO_LE16 ( x)
Value:
(x)

Definition at line 1092 of file compiler.h.

◆ CCPU_ENDIAN_TO_LE32

#define CCPU_ENDIAN_TO_LE32 ( x)
Value:
(x)

Definition at line 1093 of file compiler.h.

◆ CCPU_ENDIAN_TO_LE64

#define CCPU_ENDIAN_TO_LE64 ( x)
Value:
(x)

Definition at line 1094 of file compiler.h.

◆ CLE16_TO_CPU_ENDIAN

#define CLE16_TO_CPU_ENDIAN ( x)
Value:
(x)

Definition at line 1087 of file compiler.h.

◆ CLE32_TO_CPU_ENDIAN

#define CLE32_TO_CPU_ENDIAN ( x)
Value:
(x)

Definition at line 1088 of file compiler.h.

◆ CLE64_TO_CPU_ENDIAN

#define CLE64_TO_CPU_ENDIAN ( x)
Value:
(x)

Definition at line 1089 of file compiler.h.

◆ Clr_bits

#define Clr_bits ( lvalue,
mask )
Value:
((lvalue) &= ~(mask))

Clears the bits of a C lvalue specified by a given bit-mask.

Parameters
lvalueC lvalue of which to clear bits.
maskBit-mask indicating bits to clear.
Returns
Resulting value with cleared bits.

Definition at line 525 of file compiler.h.

◆ clz

#define clz ( u)

Counts the leading zero bits of the given value considered as a 32-bit integer.

Parameters
uValue of which to count the leading zero bits.
Returns
The count of leading zero bits in u.

Definition at line 592 of file compiler.h.

◆ CMD_ID_OCTET

#define CMD_ID_OCTET   (0)

Definition at line 1074 of file compiler.h.

◆ COMPILER_PACK_RESET

#define COMPILER_PACK_RESET ( )
Value:
#define COMPILER_PRAGMA(arg)
Emit the compiler pragma arg.
Definition compiler.h:116

Set default alignment for subsequent struct and union definitions.

Definition at line 130 of file compiler.h.

◆ COMPILER_PACK_SET

#define COMPILER_PACK_SET ( alignment)
Value:
COMPILER_PRAGMA(pack(alignment))

Set maximum alignment for subsequent struct and union definitions to alignment.

Definition at line 123 of file compiler.h.

◆ COMPILER_PRAGMA

#define COMPILER_PRAGMA ( arg)
Value:
_Pragma(#arg)

Emit the compiler pragma arg.

Parameters
argThe pragma directive as it would appear after #pragma (i.e. not stringified).

Definition at line 116 of file compiler.h.

◆ CPU_ENDIAN_TO_LE16

#define CPU_ENDIAN_TO_LE16 ( x)
Value:
(x)

Definition at line 1077 of file compiler.h.

◆ CPU_ENDIAN_TO_LE32

#define CPU_ENDIAN_TO_LE32 ( x)
Value:
(x)

Definition at line 1078 of file compiler.h.

◆ CPU_ENDIAN_TO_LE64

#define CPU_ENDIAN_TO_LE64 ( x)
Value:
(x)

Definition at line 1079 of file compiler.h.

◆ CPU_TO_BE16

#define CPU_TO_BE16 ( x)
Value:

Definition at line 909 of file compiler.h.

◆ cpu_to_be16

#define cpu_to_be16 ( x)
Value:

Definition at line 907 of file compiler.h.

◆ CPU_TO_BE32

#define CPU_TO_BE32 ( x)
Value:

Definition at line 919 of file compiler.h.

◆ cpu_to_be32

#define cpu_to_be32 ( x)
Value:

Definition at line 917 of file compiler.h.

◆ CPU_TO_LE16

#define CPU_TO_LE16 ( x)
Value:
(x)

Definition at line 904 of file compiler.h.

◆ cpu_to_le16

#define cpu_to_le16 ( x)
Value:
(x)

Definition at line 902 of file compiler.h.

◆ CPU_TO_LE32

#define CPU_TO_LE32 ( x)
Value:
(x)

Definition at line 914 of file compiler.h.

◆ cpu_to_le32

#define cpu_to_le32 ( x)
Value:
(x)

Definition at line 912 of file compiler.h.

◆ ctz

#define ctz ( u)

Counts the trailing zero bits of the given value considered as a 32-bit integer.

Parameters
uValue of which to count the trailing zero bits.
Returns
The count of trailing zero bits in u.

Definition at line 636 of file compiler.h.

◆ DISABLE

#define DISABLE   0

Definition at line 433 of file compiler.h.

◆ div_ceil

#define div_ceil ( a,
b )
Value:
(((a) + (b) - 1) / (b))
int16x2_t b
Definition simd32.h:38

Calculate $ \left\lceil \frac{a}{b} \right\rceil $ using integer arithmetic.

Parameters
aAn integer
bAnother integer
Returns
(a / b) rounded up to the nearest integer.

Definition at line 1047 of file compiler.h.

◆ ENABLE

#define ENABLE   1

Definition at line 434 of file compiler.h.

◆ FAIL

#define FAIL   1

Definition at line 442 of file compiler.h.

◆ false

#define false   0

Definition at line 437 of file compiler.h.

◆ FLASH_DECLARE

#define FLASH_DECLARE ( x)
Value:
const x

Definition at line 1065 of file compiler.h.

◆ FLASH_EXTERN

#define FLASH_EXTERN ( x)
Value:
extern const x

Definition at line 1066 of file compiler.h.

◆ FUNC_PTR

#define FUNC_PTR   void *

Definition at line 91 of file compiler.h.

◆ Get_align

#define Get_align ( val,
n )
Value:
( Rd_bits( val, (n) - 1 ) )
#define Rd_bits(value, mask)
Reads the bits of a value specified by a given bit-mask.
Definition compiler.h:496

Gets alignment of the number val with respect to the n boundary.

Parameters
valInput value.
nBoundary.
Returns
Alignment of the number val with respect to the n boundary.

Definition at line 734 of file compiler.h.

◆ HIGH

#define HIGH   1

Definition at line 444 of file compiler.h.

◆ is_constant

#define is_constant ( exp)
Value:
(0)

Determine if an expression evaluates to a constant value.

Parameters
expAny expression
Returns
true if exp is constant, false otherwise.

Definition at line 480 of file compiler.h.

◆ LE16

#define LE16 ( x)
Value:
(x)

Definition at line 899 of file compiler.h.

◆ LE16_TO_CPU

#define LE16_TO_CPU ( x)
Value:
(x)

Definition at line 903 of file compiler.h.

◆ le16_to_cpu

#define le16_to_cpu ( x)
Value:
(x)

Definition at line 901 of file compiler.h.

◆ LE16_TO_CPU_ENDIAN

#define LE16_TO_CPU_ENDIAN ( x)
Value:
(x)

Definition at line 1082 of file compiler.h.

◆ LE32_TO_CPU

#define LE32_TO_CPU ( x)
Value:
(x)

Definition at line 913 of file compiler.h.

◆ le32_to_cpu

#define le32_to_cpu ( x)
Value:
(x)

Definition at line 911 of file compiler.h.

◆ LE32_TO_CPU_ENDIAN

#define LE32_TO_CPU_ENDIAN ( x)
Value:
(x)

Definition at line 1083 of file compiler.h.

◆ LE64_TO_CPU_ENDIAN

#define LE64_TO_CPU_ENDIAN ( x)
Value:
(x)

Definition at line 1084 of file compiler.h.

◆ likely

#define likely ( exp)
Value:
(exp)

The expression exp is likely to be true.

Definition at line 458 of file compiler.h.

◆ Long_call

#define Long_call ( addr)
Value:
((*(void (*)(void))(addr))())
bd_addr_t 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.

Parameters
addrAddress of the routine to call.
Note
It may be used as a long jump opcode in some special cases.

Definition at line 850 of file compiler.h.

◆ LOW

#define LOW   0

Definition at line 443 of file compiler.h.

◆ LSB

#define LSB ( u16)
Value:
(((U8 *)&(u16))[0])

Least significant byte of u16.

Definition at line 858 of file compiler.h.

◆ LSB0

#define LSB0 ( u32)
Value:
#define LSB0W(u32)
Least significant byte of 1st rank of u32.
Definition compiler.h:869

Least significant byte of 1st rank of u32.

Definition at line 1027 of file compiler.h.

◆ LSB0D

#define LSB0D ( u64)
Value:
MSB7D(u64)
#define MSB7D(u64)
Most significant byte of 8th rank of u64.
Definition compiler.h:888

Least significant byte of 1st rank of u64.

Definition at line 896 of file compiler.h.

◆ LSB0W

#define LSB0W ( u32)
Value:
#define MSB3W(u32)
Most significant byte of 4th rank of u32.
Definition compiler.h:865

Least significant byte of 1st rank of u32.

Definition at line 869 of file compiler.h.

◆ LSB1

#define LSB1 ( u32)
Value:
#define LSB1W(u32)
Least significant byte of 2nd rank of u32.
Definition compiler.h:868

Least significant byte of 2nd rank of u32.

Definition at line 1028 of file compiler.h.

◆ LSB1D

#define LSB1D ( u64)
Value:
MSB6D(u64)
#define MSB6D(u64)
Most significant byte of 7th rank of u64.
Definition compiler.h:887

Least significant byte of 2nd rank of u64.

Definition at line 895 of file compiler.h.

◆ LSB1W

#define LSB1W ( u32)
Value:
#define MSB2W(u32)
Most significant byte of 3rd rank of u32.
Definition compiler.h:864

Least significant byte of 2nd rank of u32.

Definition at line 868 of file compiler.h.

◆ LSB2

#define LSB2 ( u32)
Value:
#define LSB2W(u32)
Least significant byte of 3rd rank of u32.
Definition compiler.h:867

Least significant byte of 3rd rank of u32.

Definition at line 1029 of file compiler.h.

◆ LSB2D

#define LSB2D ( u64)
Value:
MSB5D(u64)
#define MSB5D(u64)
Most significant byte of 6th rank of u64.
Definition compiler.h:886

Least significant byte of 3rd rank of u64.

Definition at line 894 of file compiler.h.

◆ LSB2W

#define LSB2W ( u32)
Value:
#define MSB1W(u32)
Most significant byte of 2nd rank of u32.
Definition compiler.h:863

Least significant byte of 3rd rank of u32.

Definition at line 867 of file compiler.h.

◆ LSB3

#define LSB3 ( u32)
Value:
#define LSB3W(u32)
Least significant byte of 4th rank of u32.
Definition compiler.h:866

Least significant byte of 4th rank of u32.

Definition at line 1030 of file compiler.h.

◆ LSB3D

#define LSB3D ( u64)
Value:
MSB4D(u64)
#define MSB4D(u64)
Most significant byte of 5th rank of u64.
Definition compiler.h:885

Least significant byte of 4th rank of u64.

Definition at line 893 of file compiler.h.

◆ LSB3W

#define LSB3W ( u32)
Value:
#define MSB0W(u32)
Most significant byte of 1st rank of u32.
Definition compiler.h:862

Least significant byte of 4th rank of u32.

Definition at line 866 of file compiler.h.

◆ LSB4D

#define LSB4D ( u64)
Value:
MSB3D(u64)
#define MSB3D(u64)
Most significant byte of 4th rank of u64.
Definition compiler.h:884

Least significant byte of 5th rank of u64.

Definition at line 892 of file compiler.h.

◆ LSB5D

#define LSB5D ( u64)
Value:
MSB2D(u64)
#define MSB2D(u64)
Most significant byte of 3rd rank of u64.
Definition compiler.h:883

Least significant byte of 6th rank of u64.

Definition at line 891 of file compiler.h.

◆ LSB6D

#define LSB6D ( u64)
Value:
MSB1D(u64)
#define MSB1D(u64)
Most significant byte of 2nd rank of u64.
Definition compiler.h:882

Least significant byte of 7th rank of u64.

Definition at line 890 of file compiler.h.

◆ LSB7D

#define LSB7D ( u64)
Value:
MSB0D(u64)
#define MSB0D(u64)
Most significant byte of 1st rank of u64.
Definition compiler.h:881

Least significant byte of 8th rank of u64.

Definition at line 889 of file compiler.h.

◆ LSH

#define LSH ( u32)
Value:
(((U16 *)&(u32))[0])

Least significant half-word of u32.

Definition at line 861 of file compiler.h.

◆ LSH0

#define LSH0 ( u64)
Value:
MSH3(u64)
#define MSH3(u64)
Most significant half-word of 4th rank of u64.
Definition compiler.h:876

Least significant half-word of 1st rank of u64.

Definition at line 880 of file compiler.h.

◆ LSH1

#define LSH1 ( u64)
Value:
MSH2(u64)
#define MSH2(u64)
Most significant half-word of 3rd rank of u64.
Definition compiler.h:875

Least significant half-word of 2nd rank of u64.

Definition at line 879 of file compiler.h.

◆ LSH2

#define LSH2 ( u64)
Value:
MSH1(u64)
#define MSH1(u64)
Most significant half-word of 2nd rank of u64.
Definition compiler.h:874

Least significant half-word of 3rd rank of u64.

Definition at line 878 of file compiler.h.

◆ LSH3

#define LSH3 ( u64)
Value:
MSH0(u64)
#define MSH0(u64)
Most significant half-word of 1st rank of u64.
Definition compiler.h:873

Least significant half-word of 4th rank of u64.

Definition at line 877 of file compiler.h.

◆ LSW

#define LSW ( u64)
Value:
(((U32 *)&(u64))[0])
uint32_t U32
32-bit unsigned integer.
Definition compiler.h:266

Least significant word of u64.

Definition at line 872 of file compiler.h.

◆ Max

#define Max ( a,
b )
Value:
(((a) > (b)) ? (a) : (b))

Takes the maximal value of a and b.

Parameters
aInput value.
bInput value.
Returns
Maximal value of a and b.
Note
More optimized if only used with values known at compile time.

Definition at line 810 of file compiler.h.

◆ max

#define max ( a,
b )
Value:
Max(a, b)
#define Max(a, b)
Takes the maximal value of a and b.
Definition compiler.h:810

Takes the maximal value of a and b.

Parameters
aInput value.
bInput value.
Returns
Maximal value of a and b.
Note
More optimized if only used with values unknown at compile time.

Definition at line 834 of file compiler.h.

◆ memcmp_code2ram

#define memcmp_code2ram   memcmp

Target-specific memcmp of RAM to NVRAM.

Definition at line 1023 of file compiler.h.

◆ memcmp_ram2ram

#define memcmp_ram2ram   memcmp

Target-specific memcmp of RAM to RAM.

Definition at line 1022 of file compiler.h.

◆ memcpy_code2ram

#define memcpy_code2ram   memcpy

Target-specific memcpy from NVRAM to RAM.

Definition at line 1025 of file compiler.h.

◆ MEMCPY_ENDIAN

#define MEMCPY_ENDIAN   memcpy

Definition at line 1070 of file compiler.h.

◆ memcpy_ram2ram

#define memcpy_ram2ram   memcpy

Target-specific memcpy from RAM to RAM.

Definition at line 1024 of file compiler.h.

◆ Min

#define Min ( a,
b )
Value:
(((a) < (b)) ? (a) : (b))

Takes the minimal value of a and b.

Parameters
aInput value.
bInput value.
Returns
Minimal value of a and b.
Note
More optimized if only used with values known at compile time.

Definition at line 799 of file compiler.h.

◆ min

#define min ( a,
b )
Value:
Min(a, b)
#define Min(a, b)
Takes the minimal value of a and b.
Definition compiler.h:799

Takes the minimal value of a and b.

Parameters
aInput value.
bInput value.
Returns
Minimal value of a and b.
Note
More optimized if only used with values unknown at compile time.

Definition at line 823 of file compiler.h.

◆ MSB

#define MSB ( u16)
Value:
(((U8 *)&(u16))[1])

Most significant byte of u16.

Definition at line 857 of file compiler.h.

◆ MSB0

#define MSB0 ( u32)
Value:

Most significant byte of 1st rank of u32.

Definition at line 1034 of file compiler.h.

◆ MSB0D

#define MSB0D ( u64)
Value:
(((U8 *)&(u64))[7])

Most significant byte of 1st rank of u64.

Definition at line 881 of file compiler.h.

◆ MSB0W

#define MSB0W ( u32)
Value:
(((U8 *)&(u32))[3])

Most significant byte of 1st rank of u32.

Definition at line 862 of file compiler.h.

◆ MSB1

#define MSB1 ( u32)
Value:

Most significant byte of 2nd rank of u32.

Definition at line 1033 of file compiler.h.

◆ MSB1D

#define MSB1D ( u64)
Value:
(((U8 *)&(u64))[6])

Most significant byte of 2nd rank of u64.

Definition at line 882 of file compiler.h.

◆ MSB1W

#define MSB1W ( u32)
Value:
(((U8 *)&(u32))[2])

Most significant byte of 2nd rank of u32.

Definition at line 863 of file compiler.h.

◆ MSB2

#define MSB2 ( u32)
Value:

Most significant byte of 3rd rank of u32.

Definition at line 1032 of file compiler.h.

◆ MSB2D

#define MSB2D ( u64)
Value:
(((U8 *)&(u64))[5])

Most significant byte of 3rd rank of u64.

Definition at line 883 of file compiler.h.

◆ MSB2W

#define MSB2W ( u32)
Value:
(((U8 *)&(u32))[1])

Most significant byte of 3rd rank of u32.

Definition at line 864 of file compiler.h.

◆ MSB3

#define MSB3 ( u32)
Value:

Most significant byte of 4th rank of u32.

Definition at line 1031 of file compiler.h.

◆ MSB3D

#define MSB3D ( u64)
Value:
(((U8 *)&(u64))[4])

Most significant byte of 4th rank of u64.

Definition at line 884 of file compiler.h.

◆ MSB3W

#define MSB3W ( u32)
Value:
(((U8 *)&(u32))[0])

Most significant byte of 4th rank of u32.

Definition at line 865 of file compiler.h.

◆ MSB4D

#define MSB4D ( u64)
Value:
(((U8 *)&(u64))[3])

Most significant byte of 5th rank of u64.

Definition at line 885 of file compiler.h.

◆ MSB5D

#define MSB5D ( u64)
Value:
(((U8 *)&(u64))[2])

Most significant byte of 6th rank of u64.

Definition at line 886 of file compiler.h.

◆ MSB6D

#define MSB6D ( u64)
Value:
(((U8 *)&(u64))[1])

Most significant byte of 7th rank of u64.

Definition at line 887 of file compiler.h.

◆ MSB7D

#define MSB7D ( u64)
Value:
(((U8 *)&(u64))[0])

Most significant byte of 8th rank of u64.

Definition at line 888 of file compiler.h.

◆ MSH

#define MSH ( u32)
Value:
(((U16 *)&(u32))[1])

Most significant half-word of u32.

Definition at line 860 of file compiler.h.

◆ MSH0

#define MSH0 ( u64)
Value:
(((U16 *)&(u64))[3])

Most significant half-word of 1st rank of u64.

Definition at line 873 of file compiler.h.

◆ MSH1

#define MSH1 ( u64)
Value:
(((U16 *)&(u64))[2])

Most significant half-word of 2nd rank of u64.

Definition at line 874 of file compiler.h.

◆ MSH2

#define MSH2 ( u64)
Value:
(((U16 *)&(u64))[1])

Most significant half-word of 3rd rank of u64.

Definition at line 875 of file compiler.h.

◆ MSH3

#define MSH3 ( u64)
Value:
(((U16 *)&(u64))[0])

Most significant half-word of 4th rank of u64.

Definition at line 876 of file compiler.h.

◆ MSW

#define MSW ( u64)
Value:
(((U32 *)&(u64))[1])

Most significant word of u64.

Definition at line 871 of file compiler.h.

◆ PASS

#define PASS   0

Definition at line 441 of file compiler.h.

◆ PGM_READ_BLOCK

#define PGM_READ_BLOCK ( dst,
src,
len )
Value:
memcpy((dst), (src), (len))
#define memcpy
Definition string.h:24

Definition at line 1071 of file compiler.h.

◆ PGM_READ_BYTE

#define PGM_READ_BYTE ( x)
Value:
*(x)

Definition at line 1067 of file compiler.h.

◆ PGM_READ_DWORD

#define PGM_READ_DWORD ( x)
Value:
*(x)

Definition at line 1069 of file compiler.h.

◆ PGM_READ_WORD

#define PGM_READ_WORD ( x)
Value:
*(x)

Definition at line 1068 of file compiler.h.

◆ Rd_bitfield

#define Rd_bitfield ( value,
mask )
Value:
(Rd_bits( value, mask) >> ctz(mask))
#define ctz(u)
Counts the trailing zero bits of the given value considered as a 32-bit integer.
Definition compiler.h:636

Reads the bit-field of a value specified by a given bit-mask.

Parameters
valueValue to read a bit-field from.
maskBit-mask indicating the bit-field to read.
Returns
Read bit-field.

Definition at line 552 of file compiler.h.

◆ Rd_bits

#define Rd_bits ( value,
mask )
Value:
((value) & (mask))

Reads the bits of a value specified by a given bit-mask.

Parameters
valueValue to read bits from.
maskBit-mask indicating bits to read.
Returns
Read bits.

Definition at line 496 of file compiler.h.

◆ Set_align

#define Set_align ( lval,
n,
alg )
Value:
( Wr_bits(lval, (n) - 1, alg) )
#define Wr_bits(lvalue, mask, bits)
Writes the bits of a C lvalue specified by a given bit-mask.
Definition compiler.h:506

Sets alignment of the lvalue number lval to alg with respect to the n boundary.

Parameters
lvalInput/output lvalue.
nBoundary.
algAlignment.
Returns
New value of lval resulting from its alignment set to alg with respect to the n boundary.

Definition at line 744 of file compiler.h.

◆ Set_bits

#define Set_bits ( lvalue,
mask )
Value:
((lvalue) |= (mask))

Sets the bits of a C lvalue specified by a given bit-mask.

Parameters
lvalueC lvalue of which to set bits.
maskBit-mask indicating bits to set.
Returns
Resulting value with set bits.

Definition at line 534 of file compiler.h.

◆ Swap16

#define Swap16 ( u16)
Value:
((U16)(((U16)(u16) >> 8) |\
((U16)(u16) << 8)))

Toggles the endianism of u16 (by swapping its bytes).

Parameters
u16U16 of which to toggle the endianism.
Returns
Value resulting from u16 with toggled endianism.
Note
More optimized if only used with values known at compile time.

Definition at line 943 of file compiler.h.

◆ swap16

#define swap16 ( u16)
Value:
Swap16(u16)

Toggles the endianism of u16 (by swapping its bytes).

Parameters
u16U16 of which to toggle the endianism.
Returns
Value resulting from u16 with toggled endianism.
Note
More optimized if only used with values unknown at compile time.

Definition at line 976 of file compiler.h.

◆ Swap32

#define Swap32 ( u32)
Value:
((U32)(((U32)Swap16((U32)(u32) >> 16)) |\
((U32)Swap16((U32)(u32)) << 16)))

Toggles the endianism of u32 (by swapping its bytes).

Parameters
u32U32 of which to toggle the endianism.
Returns
Value resulting from u32 with toggled endianism.
Note
More optimized if only used with values known at compile time.

Definition at line 954 of file compiler.h.

◆ swap32

#define swap32 ( u32)
Value:
#define Swap32(u32)
Toggles the endianism of u32 (by swapping its bytes).
Definition compiler.h:954

Toggles the endianism of u32 (by swapping its bytes).

Parameters
u32U32 of which to toggle the endianism.
Returns
Value resulting from u32 with toggled endianism.
Note
More optimized if only used with values unknown at compile time.

Definition at line 989 of file compiler.h.

◆ Swap64

#define Swap64 ( u64)
Value:
((U64)(((U64)Swap32((U64)(u64) >> 32)) |\
((U64)Swap32((U64)(u64)) << 32)))

Toggles the endianism of u64 (by swapping its bytes).

Parameters
u64U64 of which to toggle the endianism.
Returns
Value resulting from u64 with toggled endianism.
Note
More optimized if only used with values known at compile time.

Definition at line 965 of file compiler.h.

◆ swap64

#define swap64 ( u64)
Value:
((U64)(((U64)swap32((U64)(u64) >> 32)) |\
((U64)swap32((U64)(u64)) << 32)))

Toggles the endianism of u64 (by swapping its bytes).

Parameters
u64U64 of which to toggle the endianism.
Returns
Value resulting from u64 with toggled endianism.
Note
More optimized if only used with values unknown at compile time.

Definition at line 1003 of file compiler.h.

◆ Test_align

#define Test_align ( val,
n )
Value:
(!Tst_bits( val, (n) - 1 ) )
#define Tst_bits(value, mask)
Tests the bits of a value specified by a given bit-mask.
Definition compiler.h:516

Tests alignment of the number val with the n boundary.

Parameters
valInput value.
nBoundary.
Returns
1 if the number val is aligned with the n boundary, else 0.

Definition at line 725 of file compiler.h.

◆ Tgl_bits

#define Tgl_bits ( lvalue,
mask )
Value:
((lvalue) ^= (mask))

Toggles the bits of a C lvalue specified by a given bit-mask.

Parameters
lvalueC lvalue of which to toggle bits.
maskBit-mask indicating bits to toggle.
Returns
Resulting value with toggled bits.

Definition at line 543 of file compiler.h.

◆ true

#define true   1

Definition at line 438 of file compiler.h.

◆ Tst_bits

#define Tst_bits ( value,
mask )
Value:
(Rd_bits(value, mask) != 0)

Tests the bits of a value specified by a given bit-mask.

Parameters
valueValue of which to test bits.
maskBit-mask indicating bits to test.
Returns
1 if at least one of the tested bits is set, else 0.

Definition at line 516 of file compiler.h.

◆ unlikely

#define unlikely ( exp)
Value:
(exp)

The expression exp is unlikely to be true.

Definition at line 466 of file compiler.h.

◆ UNUSED

#define UNUSED ( v)
Value:
(void)(v)
int void * v
Definition ctypes.h:115

Marking v as a unused parameter or value.

Definition at line 96 of file compiler.h.

◆ unused

#define unused ( v)
Value:
do { (void)(v); } while(0)

Marking v as a unused parameter or value.

Definition at line 102 of file compiler.h.

◆ Wr_bitfield

#define Wr_bitfield ( lvalue,
mask,
bitfield )
Value:
(Wr_bits(lvalue, mask, (U32)(bitfield) << ctz(mask)))

Writes the bit-field of a C lvalue specified by a given bit-mask.

Parameters
lvalueC lvalue to write a bit-field to.
maskBit-mask indicating the bit-field to write.
bitfieldBit-field to write.
Returns
Resulting value with written bit-field.

Definition at line 562 of file compiler.h.

◆ Wr_bits

#define Wr_bits ( lvalue,
mask,
bits )
Value:
((lvalue) = ((lvalue) & ~(mask)) |\
((bits ) & (mask)))

Writes the bits of a C lvalue specified by a given bit-mask.

Parameters
lvalueC lvalue to write bits to.
maskBit-mask indicating bits to write.
bitsBits to write.
Returns
Resulting value with written bits.

Definition at line 506 of file compiler.h.

Typedef Documentation

◆ be16_t

typedef uint16_t be16_t

Definition at line 264 of file compiler.h.

◆ be32_t

typedef uint32_t be32_t

Definition at line 268 of file compiler.h.

◆ Bool

typedef unsigned char Bool

Boolean.

Definition at line 253 of file compiler.h.

◆ bool

typedef unsigned char bool

Boolean.

Definition at line 256 of file compiler.h.

◆ Byte

typedef U8 Byte

8-bit unsigned integer.

Definition at line 1020 of file compiler.h.

◆ F32

typedef float F32

32-bit floating-point number.

Definition at line 271 of file compiler.h.

◆ F64

typedef double F64

64-bit floating-point number.

Definition at line 272 of file compiler.h.

◆ iram_size_t

Definition at line 273 of file compiler.h.

◆ le16_t

typedef uint16_t le16_t

Definition at line 263 of file compiler.h.

◆ le32_t

typedef uint32_t le32_t

Definition at line 267 of file compiler.h.

◆ S16

typedef int16_t S16

16-bit signed integer.

Definition at line 261 of file compiler.h.

◆ S32

typedef int32_t S32

32-bit signed integer.

Definition at line 265 of file compiler.h.

◆ S64

typedef int64_t S64

64-bit signed integer.

Definition at line 269 of file compiler.h.

◆ S8

typedef int8_t S8

8-bit signed integer.

Definition at line 259 of file compiler.h.

◆ Status_bool_t

Boolean status.

Definition at line 280 of file compiler.h.

◆ Status_t

typedef U8 Status_t

8-bit-coded status.

Definition at line 281 of file compiler.h.

◆ U16

typedef uint16_t U16

16-bit unsigned integer.

Definition at line 262 of file compiler.h.

◆ U32

typedef uint32_t U32

32-bit unsigned integer.

Definition at line 266 of file compiler.h.

◆ U64

typedef uint64_t U64

64-bit unsigned integer.

Definition at line 270 of file compiler.h.

◆ U8

typedef uint8_t U8

8-bit unsigned integer.

Definition at line 260 of file compiler.h.