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