comparison autocal/vcxomeas.c @ 24:0b6881281d86

fc-rfcal-vcxo ready for first test
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 22 May 2017 22:00:36 +0000
parents
children 5226dbaa5333
comparison
equal deleted inserted replaced
23:9a9fd9ebe799 24:0b6881281d86
1 /*
2 * This module contains the frequency measurement code for fc-rfcal-vcxo.
3 */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <rvinterf/l1tm.h>
9 #include <rvinterf/exitcodes.h>
10
11 extern char tsid_response[];
12
13 float
14 vcxo_freq_meas(dac, hint)
15 int dac;
16 char *hint;
17 {
18 char cmd[80];
19 double meas;
20
21 printf("Performing frequency measurement at DAC=%d (%s)\n", dac, hint);
22 do_rfpw(AFC_DAC_VALUE, dac);
23 usleep(80000);
24 sprintf(cmd, "freq-meas %s\n", hint);
25 tsid_command(cmd);
26 atof(tsid_response + 1);
27 printf("Measured frequency offset %.2f Hz\n", meas);
28 return(meas);
29 }