Line 52... |
Line 52... |
52 |
|
52 |
|
53 |
|
53 |
|
54 |
void TDC_init() |
54 |
void TDC_init() |
55 |
{ |
55 |
{ |
56 |
output_low(TDC_ENABLE); |
56 |
output_low(TDC_ENABLE); |
57 |
spi_xfer(TDC_stream,0x70); |
57 |
spi_xfer(TDC_stream,0x70,8); |
58 |
output_high(TDC_ENABLE); |
58 |
output_high(TDC_ENABLE); |
59 |
} |
59 |
} |
60 |
|
60 |
|
61 |
void TDC_reset() |
61 |
void TDC_reset() |
62 |
{ |
62 |
{ |
63 |
output_low(TDC_ENABLE); |
63 |
output_low(TDC_ENABLE); |
64 |
spi_xfer(TDC_stream,0x50); |
64 |
spi_xfer(TDC_stream,0x50,8); |
65 |
output_high(TDC_ENABLE); |
65 |
output_high(TDC_ENABLE); |
66 |
} |
66 |
} |
67 |
|
67 |
|
68 |
void TDC_start_cycle() |
68 |
void TDC_start_cycle() |
69 |
{ |
69 |
{ |
70 |
output_low(TDC_ENABLE); |
70 |
output_low(TDC_ENABLE); |
71 |
spi_xfer(TDC_stream,0x01); |
71 |
spi_xfer(TDC_stream,0x01,8); |
72 |
output_high(TDC_ENABLE); |
72 |
output_high(TDC_ENABLE); |
73 |
} |
73 |
} |
74 |
|
74 |
|
75 |
void TDC_start_temp() |
75 |
void TDC_start_temp() |
76 |
{ |
76 |
{ |
77 |
output_low(TDC_ENABLE); |
77 |
output_low(TDC_ENABLE); |
78 |
spi_xfer(TDC_stream,0x02); |
78 |
spi_xfer(TDC_stream,0x02,8); |
79 |
output_high(TDC_ENABLE); |
79 |
output_high(TDC_ENABLE); |
80 |
} |
80 |
} |
81 |
|
81 |
|
82 |
void TDC_start_cal_resonator() |
82 |
void TDC_start_cal_resonator() |
83 |
{ |
83 |
{ |
84 |
output_low(TDC_ENABLE); |
84 |
output_low(TDC_ENABLE); |
85 |
spi_xfer(TDC_stream,0x03); |
85 |
spi_xfer(TDC_stream,0x03,8); |
86 |
output_high(TDC_ENABLE); |
86 |
output_high(TDC_ENABLE); |
87 |
} |
87 |
} |
88 |
|
88 |
|
89 |
void TDC_start_cal() |
89 |
void TDC_start_cal() |
90 |
{ |
90 |
{ |
91 |
output_low(TDC_ENABLE); |
91 |
output_low(TDC_ENABLE); |
92 |
spi_xfer(TDC_stream,0x04); |
92 |
spi_xfer(TDC_stream,0x04,8); |
93 |
output_high(TDC_ENABLE); |
93 |
output_high(TDC_ENABLE); |
94 |
} |
94 |
} |
95 |
|
95 |
|
96 |
unsigned int32 TDC_get_measurement(int num) |
96 |
unsigned int32 TDC_get_measurement(int num) |
97 |
{ |
97 |
{ |