-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcap_defines.h
62 lines (49 loc) · 2.08 KB
/
pcap_defines.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
57
58
59
60
#ifndef pcap_defines_h
#define pcap_defines_h
#define PCAP_MEASUREMENT_MODE_STANDARD
// #define PCAP_MEASUREMENT_MODE_STANDARD_FLOATING
// #define PCAP_MEASUREMENT_MODE_STANDARD_DIFFERENTIAL
// #define PCAP_MEASUREMENT_MODE_HUMIDITY
// #define PCAP_MEASUREMENT_MODE_PRESSURE
//#define PCAP_REFERENCE_CAP_EXTERNAL
#define PCAP_REFERENCE_CAP_INTERNAL
#define WR_NVRAM 0x28 // 'b:10 1000
#define RD_NVRAM 0x08 // 'b:00 1000
#define WR_CONFIG 0x028F // 'b:10 1000 1111
#define RD_CONFIG 0x008F // 'b:00 1000 1111
#define RD_RESULT 0x01 // 'b:01
#define POR_RESET 0x88 // 'b:1000 1000
#define INITIALIZE_OP 0x8A // 'b:1000 1010
#define CDC_START 0x8C // 'b:1000 1100
#define RDC_START 0x8E // 'b:1000 1110
#define DSP_TRIG 0x8D // 'b:1000 1101
#define NV_STORE 0x96 // 'b:1001 0110
#define NV_RECALL 0x99 // 'b:1001 1001
#define NV_ERASE 0x9C // 'b:1001 1100
#define TEST_READ_LOW 0x11 // 'b:1001 1100
#define TEST_READ_HIGH 0x7E // 'b:1001 1100
#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')
#define GET_NUMBER_OF_DIGITS(i) \
(i > 0 ? (int) log10 ((double) i) + 1 : 1)
#endif
#define PCAP_RESULT_REG_SIZE 4 // Each result register contains 4 bytes.
#define PCAP_RESULTS_SIZE 32
#define PCAP_STATUS_SIZE 3
#define PCAP_NVRAM_RUNBIT_INDEX 1007
#define PCAP_NVRAM_FW_SIZE 704
#define PCAP_NVRAM_FW_CAL0_SIZE 128
#define PCAP_NVRAM_FW_CAL1_SIZE 128
#define PCAP_NVRAM_CFG_SIZE 64
#define PCAP_NVRAM_SIZE (PCAP_NVRAM_FW_SIZE + PCAP_NVRAM_FW_CAL0_SIZE + PCAP_NVRAM_FW_CAL1_SIZE + PCAP_NVRAM_CFG_SIZE)
#define PCAP_NVRAM_MAX_INDEX_FW PCAP_NVRAM_FW_SIZE
#define PCAP_NVRAM_MAX_INDEX_FW_CAL0 (PCAP_NVRAM_FW_SIZE + PCAP_NVRAM_FW_CAL0_SIZE)
#define PCAP_NVRAM_MAX_INDEX_FW_CAL1 (PCAP_NVRAM_FW_SIZE + PCAP_NVRAM_FW_CAL0_SIZE + PCAP_NVRAM_FW_CAL1_SIZE)