HiRep
0.1
Loading...
Searching...
No Matches
geometry_maskstate.h
Go to the documentation of this file.
1
7
#ifndef GEOMETRY_MASKSTATE_H
8
#define GEOMETRY_MASKSTATE_H
9
#ifdef __cplusplus
10
extern
"C"
{
11
#endif
12
13
// this MUST fit in a char
14
enum
MaskState {
15
T_UP_MASK = (1u << 0),
16
T_DN_MASK = (1u << 1),
17
X_UP_MASK = (1u << 2),
18
X_DN_MASK = (1u << 3),
19
Y_UP_MASK = (1u << 4),
20
Y_DN_MASK = (1u << 5),
21
Z_UP_MASK = (1u << 6),
22
Z_DN_MASK = (1u << 7),
23
FULL_MASK = (1u << 8) - 1
24
};
25
26
static
inline
char
invertMask(
char
mask) {
27
return
mask ^ FULL_MASK;
28
}
29
30
#define _PRINT_BYTE "%c%c%c%c%c%c%c%c"
31
#define _BINARY(byte) \
32
(byte & 0x80 ? '1' : '0'), (byte & 0x40 ? '1' : '0'), (byte & 0x20 ? '1' : '0'), (byte & 0x10 ? '1' : '0'), \
33
(byte & 0x08 ? '1' : '0'), (byte & 0x04 ? '1' : '0'), (byte & 0x02 ? '1' : '0'), (byte & 0x01 ? '1' : '0')
34
35
#ifdef __cplusplus
36
}
37
#endif
38
#endif
Include
Geometry
geometry_maskstate.h
Generated by
1.12.0