|
#define | _EXTERN_C_DECL_BEGIN |
| Open C++ header file declarations.
|
|
#define | _EXTERN_C_DECL_END |
| Close C++ header file declarations.
|
|
#define | UNUSED(X) ((void)(X)) |
| Tell the compiler that the variable X is left unsed. More...
|
|
#define | STATIC_ASSERT(C, M) extern char _static_assertion_##M[(C) ? 1 : -1] |
| Perform an assertion at compile time. More...
|
|
#define | NULL ((void *)0) |
| NULL pointer.
|
|
#define | true ((bool)1) |
| Boolean TRUE constant value.
|
|
#define | false ((bool)0) |
| Boolean FALSE constant value.
|
|
#define | ALLOW_ARITHM(X) ((uint8_t *)(X)) |
| Allow arithmetic on a void pointer. More...
|
|
#define | STATIC_CHECK_TYPE(V, T) UNUSED(1 ? (T*)0 : &(V)) |
| Check that the lvalue V is of type T at compile time. More...
|
|
#define | SET_BITS(V, T, X) |
| Set the corresponding bits of X in the value V of type T. More...
|
|
#define | CLEAR_BITS(V, T, X) |
| Clear the corresponding bits of X in the value V of type T. More...
|
|
#define | POSITION(X) (1U << (X)) |
| Define a constant bit at position X, starting from index 0. More...
|
|
#define | INDIRECT_T(X, T) ((volatile T *)(X)) |
| Define an indirect read/write variable at an absolute address. More...
|
|
#define | INDIRECT(X) INDIRECT_T(X, uint8_t) |
| Define an indirect read/write register at an absolute address. More...
|
|
#define | DIRECT_T(X, T) (*INDIRECT_T(X, T)) |
| Define a direct read/write variable at an absolute address. More...
|
|
#define | DIRECT(X) DIRECT_T(X, uint8_t) |
| Define a direct read/write register at an absolute address. More...
|
|
#define | LO8(X) ((uint8_t)(X)) |
| Take the low byte of a 16-bit value. More...
|
|
#define | HI8(X) LO8((X) >> 8U) |
| Take the high byte of a 16-bit value. More...
|
|
#define | MIN(A, B) (((A) < (B)) ? (A) : (B)) |
| Obtain the minimum between two integer values. More...
|
|
#define | MAX(A, B) (((A) < (B)) ? (B) : (A)) |
| Obtain the maximum between two integer values. More...
|
|
#define | ABS(A) (((A) < 0) ? (-(A)) : (A)) |
| Obtain the absolute value of an integer. More...
|
|
#define | OFFSET_OF(M, T) ((size_t)(&(((T*)0)->M))) |
| Get the offset of a member in a structure. More...
|
|
#define | CONTAINER_OF(P, M, T) ((T*) ((uint8_t*) (1 ? (P) : &(((T*)0)->M)) - OFFSET_OF(M, T))) |
| Get a pointer to the structure T containing the member M pointed by P. More...
|
|
#define | NAME_OF(X) #X |
| Convert the name of a symbol to a string. More...
|
|
#define | ELEMENTS_COUNT(X) ((size_t)(sizeof(X) / sizeof((X)[0]))) |
| Get the number of elements in a statically initialized array. More...
|
|
#define | DEPENDENCY_ON_MODULE(X) STATIC_ASSERT(LZ_CONFIG_MODULE_ ## X ## _USED, Module_ ## X ## _must_be_used) |
| Perform a static assertion to check if a given module is activated. More...
|
|
Basic type definitions and useful macros.
- Copyright
- 2017-2020, Remi Andruccioli remi..nosp@m.andr.nosp@m.uccio.nosp@m.li@g.nosp@m.mail..nosp@m.com
This file describes basic type definitions and useful macros used in the Lazuli project.
Definition in file common.h.