FreeCalypso > hg > fc-rfcal-tools
annotate autocal/txbandmain.c @ 131:8e26cb57c7f8
doc/Test-system-interface: additions for Tx ramp testing
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 20 Dec 2021 03:29:23 +0000 |
parents | 4c3f4231a021 |
children |
rev | line source |
---|---|
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module contains the main() function for fc-rfcal-txband. |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <stdio.h> |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdlib.h> |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <string.h> |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <strings.h> |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <unistd.h> |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <rvinterf/l1tm.h> |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include <rvinterf/exitcodes.h> |
117
4c3f4231a021
autocal: vout_t definition factored out of txband.h into txvout.h
Mychaela Falconia <falcon@freecalypso.org>
parents:
116
diff
changeset
|
12 #include "txvout.h" |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include "txband.h" |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 #include "stdband.h" |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 struct tx_calchan_range tx_calchan_850[] = { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 {128, 134, 131}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 {135, 150, 143}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 {151, 166, 159}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 {167, 182, 175}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 {183, 197, 190}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 {198, 213, 206}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 {214, 229, 222}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 {230, 251, 241} |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 }; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 struct tx_calchan_range tx_calchan_900[] = { |
80
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
28 { 0, 27, 14}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
29 { 28, 47, 40}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
30 { 48, 66, 57}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
31 { 67, 85, 76}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
32 { 86, 104, 95}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
33 {105, 124, 114}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
34 {975, 994, 985}, |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
35 {995, 1023, 1009} |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 }; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 struct tx_calchan_range tx_calchan_1800[] = { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 {512, 553, 533}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 {554, 594, 574}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 {595, 636, 615}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 {637, 677, 657}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 {678, 720, 700}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 {721, 760, 740}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 {761, 802, 781}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 {803, 885, 844} |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 }; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 struct tx_calchan_range tx_calchan_1900[] = { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 {512, 549, 531}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 {550, 586, 568}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 {587, 623, 605}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 {624, 697, 660}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 {698, 726, 712}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 {727, 754, 740}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 {755, 782, 768}, |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 {783, 810, 796} |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 }; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 |
114
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
60 unsigned tx_calchan_low_selections[] = {0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3}; |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
61 |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
62 unsigned tx_calchan_low_plnum[] = {5, 8, 12, 16}; |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
63 |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
64 unsigned tx_calchan_high_selections[] = {0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3}; |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
65 |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
66 unsigned tx_calchan_high_plnum[] = {0, 4, 8, 12}; |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
67 |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 struct txcal_band txcal_band_list[] = { |
114
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
69 {"850", RFPW_STD_BAND_850, 190, 5, 19, tx_calchan_850, 4, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
70 tx_calchan_low_selections, tx_calchan_low_plnum}, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
71 {"900", RFPW_STD_BAND_900, 40, 5, 19, tx_calchan_900, 1, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
72 tx_calchan_low_selections, tx_calchan_low_plnum}, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
73 {"1800", RFPW_STD_BAND_1800, 700, 0, 15, tx_calchan_1800, 4, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
74 tx_calchan_high_selections, tx_calchan_high_plnum}, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
75 {"1900", RFPW_STD_BAND_1900, 660, 0, 15, tx_calchan_1900, 3, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
76 tx_calchan_high_selections, tx_calchan_high_plnum}, |
ae8da516681c
fc-rfcal-txband: data struct preparation for channel calibration
Mychaela Falconia <falcon@freecalypso.org>
parents:
106
diff
changeset
|
77 {0, 0, 0, 0, 0, 0, 0, 0, 0} |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 }; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 struct txcal_band *txcal_band; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 char *txlevels_profile; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 struct tx_basis_point tx_basis[MAX_BASIS_POINTS]; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 unsigned num_basis_points; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 struct tx_level tx_levels[MAX_TX_LEVELS]; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 finish_cmdline(argc, argv) |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 char **argv; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 extern int optind; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 struct txcal_band *band; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 if (argc - optind != 2) { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 fprintf(stderr, "usage: %s band txlevels-profile\n", argv[0]); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 exit(ERROR_USAGE); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 } |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 for (band = txcal_band_list; band->name; band++) |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 if (!strcmp(band->name, argv[optind])) |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 break; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 if (!band->name) { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 fprintf(stderr, "error: \"%s\" is not a known band\n", |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 argv[optind]); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 exit(ERROR_USAGE); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 } |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 txcal_band = band; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 txlevels_profile = argv[optind+1]; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 return(0); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 } |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 main(argc, argv) |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 char **argv; |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 { |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 socket_pathname_options(argc, argv); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 finish_cmdline(argc, argv); |
76
5c3574f8c8c1
fc-rfcal-txband: reading of basis & targets setting files implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
75
diff
changeset
|
116 read_tx_cal_profile(); |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 connect_rvinterf_socket(); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 connect_tsid_socket(); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 setlinebuf(stdout); /* to allow logging with tee */ |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 printf("Preparing RF test system for %s MHz Tx calibration\n", |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 txcal_band->name); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 do_txpwr_cal_setup(txcal_band->name, txcal_band->main_arfcn); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 printf("Putting the DUT into Test Mode\n"); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 do_tms(1); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 do_rfpw(STD_BAND_FLAG, txcal_band->rfpw_std_band); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 do_rfpw(TCH_ARFCN, txcal_band->main_arfcn); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 do_rfpw(AFC_ENA_FLAG, 0); |
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 |
77
3f63e71b6422
fc-rfcal-txband: implemented initial calchan clearing
Mychaela Falconia <falcon@freecalypso.org>
parents:
76
diff
changeset
|
130 /* any previous calchan needs to be cleared out first */ |
80
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
131 printf("Initializing calchan table\n"); |
77
3f63e71b6422
fc-rfcal-txband: implemented initial calchan clearing
Mychaela Falconia <falcon@freecalypso.org>
parents:
76
diff
changeset
|
132 init_tx_calchan(); |
3f63e71b6422
fc-rfcal-txband: implemented initial calchan clearing
Mychaela Falconia <falcon@freecalypso.org>
parents:
76
diff
changeset
|
133 upload_tx_calchan(); |
80
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
134 /* run the basis measurements */ |
b0da2db4e36b
fc-rfcal-txband: basis run implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
77
diff
changeset
|
135 txcal_basis_run(); |
81
83b24a1dfd4a
fc-rfcal-txband: implemented the slope computations after basis run
Mychaela Falconia <falcon@freecalypso.org>
parents:
80
diff
changeset
|
136 /* analytical follow-up */ |
83b24a1dfd4a
fc-rfcal-txband: implemented the slope computations after basis run
Mychaela Falconia <falcon@freecalypso.org>
parents:
80
diff
changeset
|
137 txcal_basis_compute(); |
83
45ef4a06edfc
fc-rfcal-txband: initial implementation complete, ready to test
Mychaela Falconia <falcon@freecalypso.org>
parents:
81
diff
changeset
|
138 /* actual Tx levels calibration */ |
45ef4a06edfc
fc-rfcal-txband: initial implementation complete, ready to test
Mychaela Falconia <falcon@freecalypso.org>
parents:
81
diff
changeset
|
139 calibrate_tx_levels(); |
116
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
140 /* channel calibration */ |
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
141 calibrate_tx_calchan(); |
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
142 printf("Uploading calchan table\n"); |
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
143 upload_tx_calchan(); |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 |
116
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
145 #if 0 |
106
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
146 /* |
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
147 * We need to insert a delay between stopping Tx |
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
148 * and doing the FFS write in order to avoid |
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
149 * an intermittent fw crash on the DUT. |
116
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
150 * |
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
151 * This delay may no longer be needed after |
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
152 * the addition of calchan table upload above, |
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
153 * so commenting it out to test. |
106
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
154 */ |
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
155 usleep(100000); |
116
4ce87a30383f
fc-rfcal-txband: channel calibration implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
114
diff
changeset
|
156 #endif |
106
661d122ed8e7
fc-rfcal-txband: added delay which should prevent intermittent fw crash
Mychaela Falconia <falcon@freecalypso.org>
parents:
85
diff
changeset
|
157 |
85
2bed7b024f64
fc-rfcal-txband: FFS write implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
83
diff
changeset
|
158 printf("Saving calibrated values in FFS\n"); |
2bed7b024f64
fc-rfcal-txband: FFS write implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
83
diff
changeset
|
159 misc_enable(CFG_WRITE_TX_CAL); |
83
45ef4a06edfc
fc-rfcal-txband: initial implementation complete, ready to test
Mychaela Falconia <falcon@freecalypso.org>
parents:
81
diff
changeset
|
160 exit(0); |
75
93653fe9b4ef
fc-rfcal-txband started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 } |