Line 1... |
Line 1... |
1 |
#include "GP2.c" |
1 |
#include "GP2.c" |
2 |
|
2 |
|
- |
|
3 |
//register 0 |
- |
|
4 |
#define TDC_NEG_START_INV 1 |
3 |
#define TDC_HITIN1_0 0x0 << 8 |
5 |
#define TDC_NEG_START 0 |
- |
|
6 |
#define TDC_NEG_STOP1_INV 1 |
4 |
#define TDC_HITIN1_1 0x1 << 8 |
7 |
#define TDC_NEG_STOP1 0 |
- |
|
8 |
#define TDC_NEG_STOP2_INV 1 |
5 |
#define TDC_HITIN1_2 0x2 << 8 |
9 |
#define TDC_NEG_STOP2 0 |
- |
|
10 |
#define TDC_MRANGE1 0 |
- |
|
11 |
#define TDC_MRANGE2 1 |
6 |
#define TDC_HITIN1_3 0x3 << 8 |
12 |
#define TDC_AUTOCAL_EN 0 |
7 |
#define TDC_HITIN1_4 0x4 << 8 |
13 |
#define TDC_AUTOCAL_DIS 1 |
8 |
|
- |
|
9 |
#define TDC_HITIN2_0 0x0 << 11 |
14 |
#define TDC_CALIBRATE_EN 1 |
- |
|
15 |
#define TDC_CALIBRATE_DIS 0 |
- |
|
16 |
#define TDC_TSELCLK_32KHZ 0 |
10 |
#define TDC_HITIN2_1 0x1 << 11 |
17 |
#define TDC_TSELCLK_128HS 1 |
- |
|
18 |
#define TDC_TFAKENUM_2 0 |
11 |
#define TDC_HITIN2_2 0x2 << 11 |
19 |
#define TDC_TFAKENUM_7 1 |
- |
|
20 |
#define TDC_TCYCLE_SHORT 0 |
12 |
#define TDC_HITIN2_3 0x3 << 11 |
21 |
#define TDC_TCYSLE_LONG 1 |
- |
|
22 |
#define TDC_TPORTNUM_2 0 |
13 |
#define TDC_HITIN2_4 0x4 << 11 |
23 |
#define TDC_TPORTNUM_4 1 |
- |
|
24 |
#define TDC_CLKHS_OFF 0 |
- |
|
25 |
#define TDC_CLKHS_ON 1 |
- |
|
26 |
#define TDC_CLKHS_640US 2 |
- |
|
27 |
#define TDC_CLKHS_1280US 4 |
- |
|
28 |
#define TDC_CLKHSDIV_1 0 |
- |
|
29 |
#define TDC_CLKHSDIV_2 1 |
- |
|
30 |
#define TDC_CLKHSDIV_4 2 |
- |
|
31 |
#define TDC_CLKHSDIV_8 3 |
- |
|
32 |
#define TDC_CALPERIODS_2 0 |
- |
|
33 |
#define TDC_CALPERIODS_4 1 |
- |
|
34 |
#define TDC_CALPERIODS_8 2 |
- |
|
35 |
#define TDC_CALPERIODS_16 3 |
14 |
|
36 |
|
- |
|
37 |
#define TDC_DIV_FIRE_2 0 |
- |
|
38 |
#define TDC_DIV_FIRE_3 2 |
- |
|
39 |
#define TDC_DIV_FIRE_4 3 |
- |
|
40 |
#define TDC_DIV_FIRE_5 4 |
- |
|
41 |
#define TDC_DIV_FIRE_6 5 |
- |
|
42 |
#define TDC_DIV_FIRE_7 6 |
- |
|
43 |
#define TDC_DIV_FIRE_8 7 |
- |
|
44 |
#define TDC_DIV_FIRE_9 8 |
- |
|
45 |
#define TDC_DIV_FIRE_10 9 |
- |
|
46 |
#define TDC_DIV_FIRE_11 10 |
- |
|
47 |
#define TDC_DIV_FIRE_12 11 |
- |
|
48 |
#define TDC_DIV_FIRE_13 12 |
- |
|
49 |
#define TDC_DIV_FIRE_14 13 |
- |
|
50 |
#define TDC_DIV_FIRE_15 14 |
- |
|
51 |
#define TDC_DIV_FIRE_16 15 |
- |
|
52 |
|
- |
|
53 |
#define TDC_FIRENUM_0 0 |
- |
|
54 |
#define TDC_FIRENUM_1 1 |
- |
|
55 |
#define TDC_FIRENUM_2 2 |
- |
|
56 |
#define TDC_FIRENUM_3 3 |
- |
|
57 |
#define TDC_FIRENUM_4 4 |
- |
|
58 |
#define TDC_FIRENUM_5 5 |
- |
|
59 |
#define TDC_FIRENUM_6 6 |
- |
|
60 |
#define TDC_FIRENUM_7 7 |
- |
|
61 |
#define TDC_FIRENUM_8 8 |
- |
|
62 |
#define TDC_FIRENUM_9 9 |
- |
|
63 |
#define TDC_FIRENUM_10 10 |
- |
|
64 |
#define TDC_FIRENUM_11 11 |
- |
|
65 |
#define TDC_FIRENUM_12 12 |
- |
|
66 |
#define TDC_FIRENUM_13 13 |
- |
|
67 |
#define TDC_FIRENUM_14 14 |
- |
|
68 |
#define TDC_FIRENUM_15 15 |
- |
|
69 |
|
- |
|
70 |
//register 1 |
- |
|
71 |
#define TDC_HITIN1_0 0 |
- |
|
72 |
#define TDC_HITIN1_1 1 |
- |
|
73 |
#define TDC_HITIN1_2 2 |
- |
|
74 |
#define TDC_HITIN1_3 3 |
- |
|
75 |
#define TDC_HITIN1_4 4 |
- |
|
76 |
|
- |
|
77 |
#define TDC_HITIN2_0 0 |
- |
|
78 |
#define TDC_HITIN2_1 1 |
- |
|
79 |
#define TDC_HITIN2_2 2 |
- |
|
80 |
#define TDC_HITIN2_3 3 |
- |
|
81 |
#define TDC_HITIN2_4 4 |
- |
|
82 |
|
15 |
#define TDC_FAST_INIT_EN 0x1 << 15 |
83 |
#define TDC_FAST_INIT_EN 1 |
16 |
#define TDC_FAST_INIT_DIS 0x0 << 15 |
84 |
#define TDC_FAST_INIT_DIS 0 |
- |
|
85 |
|
- |
|
86 |
#define TDC_MRANGE1_HIT1_START 0 |
- |
|
87 |
#define TDC_MRANGE1_HIT1_1CH1 1 |
- |
|
88 |
#define TDC_MRANGE1_HIT1_2CH1 2 |
- |
|
89 |
#define TDC_MRANGE1_HIT1_3CH1 3 |
- |
|
90 |
#define TDC_MRANGE1_HIT1_4CH1 4 |
- |
|
91 |
#define TDC_MRANGE1_HIT1_NOAC 5 |
- |
|
92 |
#define TDC_MRANGE1_HIT1_CAL1CH1 6 |
- |
|
93 |
#define TDC_MRANGE1_HIT1_CAL2CH1 7 |
- |
|
94 |
#define TDC_MRANGE1_HIT1_1CH2 9 |
- |
|
95 |
#define TDC_MRANGE1_HIT1_2CH2 0xA |
- |
|
96 |
#define TDC_MRANGE1_HIT1_3CH2 0xB |
- |
|
97 |
#define TDC_MRANGE1_HIT1_4CH2 0xC |
- |
|
98 |
|
- |
|
99 |
#define TDC_MRANGE2_HIT1_START 1 |
- |
|
100 |
|
- |
|
101 |
#define TDC_MRANGE1_HIT2_START 0 |
- |
|
102 |
#define TDC_MRANGE1_HIT2_1CH1 1 |
- |
|
103 |
#define TDC_MRANGE1_HIT2_2CH1 2 |
- |
|
104 |
#define TDC_MRANGE1_HIT2_3CH1 3 |
- |
|
105 |
#define TDC_MRANGE1_HIT2_4CH1 4 |
- |
|
106 |
#define TDC_MRANGE1_HIT2_NOAC 5 |
- |
|
107 |
#define TDC_MRANGE1_HIT2_CAL1CH1 6 |
- |
|
108 |
#define TDC_MRANGE1_HIT2_CAL2CH1 7 |
- |
|
109 |
#define TDC_MRANGE1_HIT2_1CH2 9 |
- |
|
110 |
#define TDC_MRANGE1_HIT2_2CH2 0xA |
- |
|
111 |
#define TDC_MRANGE1_HIT2_3CH2 0xB |
- |
|
112 |
#define TDC_MRANGE1_HIT2_4CH2 0xC |
- |
|
113 |
|
- |
|
114 |
#define TDC_MRANGE2_HIT2_1CH1 2 |
- |
|
115 |
#define TDC_MRANGE2_HIT2_2CH1 3 |
- |
|
116 |
#define TDC_MRANGE2_HIT2_3CH1 4 |
- |
|
117 |
|
- |
|
118 |
//register 2 |
- |
|
119 |
#define TDC_CH1EDGE_RIS 0 |
- |
|
120 |
#define TDC_CH1EDGE_FAL 1 |
- |
|
121 |
|
- |
|
122 |
//register 3 |
- |
|
123 |
#define TDC_TIM0MR2_256 0 |
- |
|
124 |
#define TDC_TIM0MR2_1024 1 |
- |
|
125 |
#define TDC_TIM0MR2_4096 2 |
- |
|
126 |
#define TDC_TIM0MR2_16384 3 |
- |
|
127 |
|
- |
|
128 |
#define TDC_ERRVAL_EN 1 |
- |
|
129 |
#define TDC_ERRVAL_DIS 0 |
- |
|
130 |
|
- |
|
131 |
//register 5 |
- |
|
132 |
#define TDC_FIRE_PHASE 0 |
- |
|
133 |
#define TDC_FIRE_PHASE_INV 1 |
- |
|
134 |
#define TDC_REPEAT_FIRE_0 0 |
- |
|
135 |
#define TDC_REPEAT_FIRE_1 1 |
- |
|
136 |
#define TDC_REPEAT_FIRE_2 2 |
- |
|
137 |
#define TDC_REPEAT_FIRE_3 3 |
- |
|
138 |
#define TDC_REPEAT_FIRE_4 4 |
- |
|
139 |
#define TDC_REPEAT_FIRE_5 5 |
- |
|
140 |
#define TDC_REPEAT_FIRE_6 6 |
- |
|
141 |
#define TDC_REPEAT_FIRE_7 7 |
- |
|
142 |
|
- |
|
143 |
#define TDC_PHASENOISE_EN 0 |
- |
|
144 |
#define TDC_PHASENOISE_DIS 1 |
- |
|
145 |
|
- |
|
146 |
#define TDC_STARTNOISE_EN 1 |
- |
|
147 |
#define TDC_STARTNOISE_DIS 0 |
17 |
|
148 |
|
18 |
#define TDC_HIT1_ |
- |
|