Macros
libchip_compiler.h File Reference
#include <compiler.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for libchip_compiler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COMPILER_PACK_RESET()   COMPILER_PRAGMA(pack())
 Set default alignment for subsequent structure and union definitions. More...
 
#define COMPILER_PACK_SET(alignment)   COMPILER_PRAGMA(pack(alignment))
 Set maximum alignment for subsequent structure and union definitions to alignment. More...
 
#define COMPILER_PRAGMA(arg)   _Pragma(#arg)
 Emit the compiler pragma arg. More...
 
#define UNUSED(v)   (void)(v)
 Marking v as a unused parameter or value. More...
 
Token Paste

Paste N preprocessing tokens together, these tokens being allowed to be #defined.

May be used only within macros with the tokens passed as arguments if the tokens are #defined.

For example, writing TPASTE2(U, WIDTH) within a macro #defined by UTYPE(WIDTH) and invoked as UTYPE(UL_WIDTH) with UL_WIDTH #defined as 32 is equivalent to writing U32.

#define TPASTE2(a, b)   a##b
 
#define TPASTE3(a, b, c)   a##b##c
 
Mathematics

Set user-defined section. Place a data object or a function in a user-defined section.

Set aligned boundary. Set word-aligned boundary.

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 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...
 
Interrupt Service Routine definition
#define Enable_global_interrupt()   cpu_irq_enable()
 
#define Disable_global_interrupt()   cpu_irq_disable()
 
#define Is_global_interrupt_enabled()   cpu_irq_is_enabled()
 
Usual Constants
#define DISABLE   0
 
#define ENABLE   1
 
#define DISABLED   0
 
#define ENABLED   1
 
#define OFF   0
 
#define ON   1
 
#define FALSE   0
 
#define TRUE   1
 
#define false   FALSE
 
#define true   TRUE
 
#define KO   0
 
#define OK   1
 
#define PASS   0
 
#define FAIL   1
 
#define LOW   0
 
#define HIGH   1
 
#define CLR   0
 
#define SET   1
 

Macro Definition Documentation

◆ COMPILER_PACK_RESET

#define COMPILER_PACK_RESET ( )    COMPILER_PRAGMA(pack())

Set default alignment for subsequent structure and union definitions.

Definition at line 162 of file libchip_compiler.h.

◆ COMPILER_PACK_SET

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

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

Definition at line 155 of file libchip_compiler.h.

◆ COMPILER_PRAGMA

#define COMPILER_PRAGMA (   arg)    _Pragma(#arg)

Emit the compiler pragma arg.

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

Definition at line 148 of file libchip_compiler.h.

◆ max

#define max (   a,
 
)    Max(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 unknown at compile time.

Definition at line 272 of file libchip_compiler.h.

◆ min

#define min (   a,
 
)    Min(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 unknown at compile time.

Definition at line 261 of file libchip_compiler.h.

◆ TPASTE2

#define TPASTE2 (   a,
 
)    a##b

Definition at line 121 of file libchip_compiler.h.

◆ TPASTE3

#define TPASTE3 (   a,
  b,
 
)    a##b##c

Definition at line 122 of file libchip_compiler.h.

◆ UNUSED

#define UNUSED (   v)    (void)(v)

Marking v as a unused parameter or value.

Definition at line 287 of file libchip_compiler.h.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:59