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