annotate rvinterf/tmsh/rftablewr.c @ 138:3803f838e1f3

RF table writing code implemented, linked into fc-tmsh
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 26 Feb 2017 22:37:47 +0000
parents
children 6b01d4ef85c3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
138
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * Here we implement the writing of RF tables into ASCII text files
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * in our defined format. This module will also be linked by the
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * standalone fc-cal2text utility, hence our code here needs to be
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * independent of rvinterf and fc-tmsh specifics.
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 */
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <sys/types.h>
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <stdio.h>
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <stdint.h>
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include <endian.h>
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 static unsigned
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 get_u32(bin)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 return le32toh(*(uint32_t *)bin);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 static unsigned
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 get_u16(bin)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 return le16toh(*(uint16_t *)bin);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 static int
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 get_s16(bin)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 int i;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 i = le16toh(*(uint16_t *)bin);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 if (i >= 32768)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 i -= 65536;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 return(i);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 write_afcparams_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 fputs("rf_table afcparams\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 /* 32-bit parameters */
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 fprintf(outf, "%10u\t# psi_sta_inv\n", get_u32(bin));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 fprintf(outf, "%10u\t# psi_st\n", get_u32(bin + 4));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 fprintf(outf, "%10u\t# psi_st_32\n", get_u32(bin + 8));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 fprintf(outf, "%10u\t# psi_st_inv\n\n", get_u32(bin + 12));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 /* 16-bit parameters */
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 fprintf(outf, "%10d\t# dac_center\n", get_s16(bin + 16));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 fprintf(outf, "%10d\t# dac_min\n", get_s16(bin + 18));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 fprintf(outf, "%10d\t# dac_max\n", get_s16(bin + 20));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 fprintf(outf, "%10d\t# snr_thr\n", get_s16(bin + 22));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 write_agcwords_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 int i, j;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 u_char *p = bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 fputs("rf_table agc-table\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 for (i = 0; i < 4; i++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 for (j = 0; j < 5; j++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 fprintf(outf, " 0x%04X", get_u16(p));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 p += 2;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 putc('\n', outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 write_agcglobals_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 fputs("rf_table agc-global-params\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 fprintf(outf, "%5u\t# low_agc_noise_thr\n", get_u16(bin));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 fprintf(outf, "%5u\t# high_agc_sat_thr\n", get_u16(bin + 2));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 fprintf(outf, "%5u\t# low_agc\n", get_u16(bin + 4));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 fprintf(outf, "%5u\t# high_agc\n", get_u16(bin + 6));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 write_il2agc_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 int idx;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 fputs("rf_table il2agc\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 for (idx = 0; idx < 121; idx++)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 fprintf(outf, "%3u\t# IL=%d\n", get_u16(bin + idx), -idx);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 write_tx_levels_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 int i;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 u_char *p = bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 fputs("rf_table tx-levels\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 fputs("# Fields in each entry: apc, ramp_index, chan_cal_index\n\n",
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 for (i = 0; i < 32; i++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 fprintf(outf, "%5u %3u %3u\t# entry %d\n",
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 get_u16(p), p[2], p[3], i);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 p += 4;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 write_tx_calchan_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 int i, j;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 u_char *p = bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 fputs("rf_table tx-calchan\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 for (i = 0; i < 4; i++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 fprintf(outf, "# Channel calibration table %d:\n\n", i);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 for (j = 0; j < 8; j++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 fprintf(outf, "%5u %6d\n", get_u16(p), get_s16(p + 2));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 p += 4;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 write_tx_caltemp_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 int i;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 u_char *p = bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 fputs("rf_table tx-caltemp\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 for (i = 0; i < 5; i++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 fprintf(outf, "%6d %6d %6d %6d\n", get_s16(p), get_s16(p + 2),
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 get_s16(p + 4), get_s16(p + 6));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 p += 8;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 write_rx_calchan_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 int i;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 u_char *p = bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 fputs("rf_table rx-calchan\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 for (i = 0; i < 10; i++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 fprintf(outf, "%5u %6d\n", get_u16(p), get_s16(p + 2));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 p += 4;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 write_rx_caltemp_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 int i;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 u_char *p = bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 fputs("rf_table rx-caltemp\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 for (i = 0; i < 11; i++) {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 fprintf(outf, "%6d %6d\n", get_s16(p), get_s16(p + 2));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 p += 4;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 }
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 void
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 write_rx_agcparams_table(bin, outf)
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 u_char *bin;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 FILE *outf;
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 {
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 fputs("rf_table rx-agc-params\n\n", outf);
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 fprintf(outf, "%5u\t# g_magic\n", get_u16(bin));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 fprintf(outf, "%5u\t# lna_att\n", get_u16(bin + 2));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 fprintf(outf, "%5u\t# lna_switch_thr_low\n", get_u16(bin + 4));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 fprintf(outf, "%5u\t# lna_switch_thr_high\n", get_u16(bin + 6));
3803f838e1f3 RF table writing code implemented, linked into fc-tmsh
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 }