-
Notifications
You must be signed in to change notification settings - Fork 5
/
as3933_defs.h
56 lines (49 loc) · 1.14 KB
/
as3933_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef AS3933_DEFS_H
#define AS3933_DEFS_H
#ifdef __cplusplus
extern "C"
{
#endif
/*********************
* DEFINES
*********************/
#define R0 0x00
#define R1 0x01
#define R2 0x02
#define R3 0x03
#define R4 0x04
#define R5 0x05
#define R6 0x06
#define R7 0x07
#define R8 0x08
#define R9 0x09
#define R10 0x0A
#define R11 0x0B
#define R12 0x0C
#define R13 0x0D
#define R14 0x0E
#define R15 0x0F
#define R16 0x10
#define R17 0x11
#define R18 0x12
#define R19 0x13
#define AS3933_WRITE_SINGLE 0x00 /*!< WRITE */
#define AS3933_READ_SINGLE 0x01 /*!< READ */
#define AS3933_DIRECT_COMMAND 0x03 /*!< DIRECT COMMAND */
/**********************
* MACROS
**********************/
#define BYTE_TO_BINARY_PATTERN "%c%c%c%c %c%c%c%c"
#define BYTE_TO_BINARY(byte) \
(byte & 0x80 ? '1' : '0'), \
(byte & 0x40 ? '1' : '0'), \
(byte & 0x20 ? '1' : '0'), \
(byte & 0x10 ? '1' : '0'), \
(byte & 0x08 ? '1' : '0'), \
(byte & 0x04 ? '1' : '0'), \
(byte & 0x02 ? '1' : '0'), \
(byte & 0x01 ? '1' : '0')
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* AS3933_DEFS_H */