1744 |
kakl |
1 |
void TDC_init() |
|
|
2 |
{ |
|
|
3 |
spi_xfer(TDC_stream,0x70); |
|
|
4 |
} |
|
|
5 |
|
|
|
6 |
void TDC_reset() |
|
|
7 |
{ |
|
|
8 |
spi_xfer(TDC_stream,0x50); |
|
|
9 |
} |
|
|
10 |
|
|
|
11 |
void TDC_start_cycle() |
|
|
12 |
{ |
|
|
13 |
spi_xfer(TDC_stream,0x01); |
|
|
14 |
} |
|
|
15 |
|
|
|
16 |
void TDC_start_temp() |
|
|
17 |
{ |
|
|
18 |
spi_xfer(TDC_stream,0x02); |
|
|
19 |
} |
|
|
20 |
|
|
|
21 |
void TDC_start_cal_resonator() |
|
|
22 |
{ |
|
|
23 |
spi_xfer(TDC_stream,0x03); |
|
|
24 |
} |
|
|
25 |
|
|
|
26 |
void TDC_start_cal() |
|
|
27 |
{ |
|
|
28 |
spi_xfer(TDC_stream,0x04); |
|
|
29 |
} |
|
|
30 |
|
|
|
31 |
unsigned int32 TDC_get_measurement(int num) |
|
|
32 |
{ |
|
|
33 |
spi_xfer(TDC_stream,0xB0 + num - 1); |
|
|
34 |
return spi_xfer(TDC_stream,0,32); |
|
|
35 |
} |
|
|
36 |
|
|
|
37 |
unsigned int16 TDC_get_status() |
|
|
38 |
{ |
|
|
39 |
spi_xfer(TDC_stream,0xB4); |
|
|
40 |
return spi_xfer(TDC_stream,0,16); |
|
|
41 |
} |
|
|
42 |
|
|
|
43 |
unsigned int8 TDC_get_reg1() |
|
|
44 |
{ |
|
|
45 |
spi_xfer(TDC_stream,0xB5); |
|
|
46 |
return spi_xfer(TDC_stream,0,8); |
|
|
47 |
} |
|
|
48 |
|
|
|
49 |
void TDC_setup_reg1() |
|
|
50 |
{ |
|
|
51 |
spi_xfer(TDC_stream,0xB0); |
|
|
52 |
} |
|
|
53 |
|
|
|
54 |
void TDC_setup_reg2() |
|
|
55 |
{ |
|
|
56 |
spi_xfer(TDC_stream,0xB1); |
|
|
57 |
} |
|
|
58 |
|
|
|
59 |
void TDC_setup_reg3() |
|
|
60 |
{ |
|
|
61 |
spi_xfer(TDC_stream,0xB2); |
|
|
62 |
} |
|
|
63 |
|
|
|
64 |
void TDC_setup_reg4() |
|
|
65 |
{ |
|
|
66 |
spi_xfer(TDC_stream,0xB3); |
|
|
67 |
} |
|
|
68 |
|
|
|
69 |
void TDC_setup_reg5() |
|
|
70 |
{ |
|
|
71 |
spi_xfer(TDC_stream,0xB4); |
|
|
72 |
} |