|
#define | _EVAL(MACRO) MACRO |
|
#define | EVAL(MACRO) _EVAL(MACRO) |
|
#define | _STR(EXPR) #EXPR |
|
#define | STR(EXPR) _STR(EXPR) |
| Stringyfies an expression. More...
|
|
#define | RESCALE(INPUT, IN_MIN, IN_MAX, OUT_MIN, OUT_MAX) |
| Re-scales the input value into the range of the output value. More...
|
|
#define | COERCE(INPUT, MIN, MAX) ( ( INPUT ) > ( MAX ) ? ( MAX ) : ( ( INPUT ) < ( MIN ) ? ( MIN ) : ( INPUT ) ) ) |
|
#define | _CCMP(A, B, BITS) (((A) - (B)) & (1 << (BITS - 1))) |
| Private Cyclic Comparison macro, please don't use.
|
|
#define | CGT(A, B, BITS) (_CCMP(B, A, BITS) != 0) |
| Cyclic comparison function Greater Than. More...
|
|
#define | CGE(A, B, BITS) (_CCMP(A, B, BITS) == 0) |
| Cyclic comparison function Greater Of Equal To. More...
|
|
#define | CLT(A, B, BITS) (_CCMP(A, B, BITS) != 0) |
| Cyclic comparison function Less Than. More...
|
|
#define | CLE(A, B, BITS) (_CCMP(B, A, BITS) == 0) |
| Cyclic comparison function Less Or Equal To. More...
|
|
#define | BIT(N) ( 1 << ( N ) ) |
| Makes a value with the specified bit set.
|
|
#define | MASK(LEN) ( ( 1 << ( LEN ) ) - 1 ) |
| Creates a mask with the specified offset and length.
|
|
#define | EXT_BITFIELD(VAL, OFF, LEN) ( ( ( VAL ) >> ( OFF ) ) & MASK( LEN ) ) |
| Extracts a bitfield.
|
|
#define | _BR_SHORT(SHORT) ( ( ( 0xFF00L & SHORT ) >> 8 ) | ( ( 0x00FFL & SHORT ) << 8 ) ) |
| Little Endian to native short.
|
|
#define | _BR_LONG(LONG) ( _BR_SHORT ( ( 0xFFFF0000L & LONG ) >> 16 ) | ( ( 0x0000FFFFL & _BR_SHORT(SHORT) ) << 16 ) ) |
|
#define | N2LES(SHORT) _BR_SHORT(SHORT) |
|
#define | LE2NS(SHORT) _BR_SHORT(SHORT) |
|
#define | N2LEL(LONG) _BR_LONG(LONG) |
|
#define | LE2NL(LONG) _BR_LONG(LONG) |
|
#define | N2BES(SHORT) ( SHORT ) |
|
#define | BE2NS(SHORT) ( SHORT ) |
|
#define | N2BEL(LONG) ( LONG ) |
|
#define | BE2NL(LONG) ( LONG ) |
|
#define | arraylength(N) ( sizeof(N) / sizeof(*(N)) ) |
| Returns the length of the array.
|
|
Provides common macros.
Definition in file macro.h.