comparison autocal/txcalchan.c @ 77:3f63e71b6422

fc-rfcal-txband: implemented initial calchan clearing
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 15 Jul 2017 20:25:31 +0000
parents
children 4ce87a30383f
comparison
equal deleted inserted replaced
76:5c3574f8c8c1 77:3f63e71b6422
1 /*
2 * This module contains the code for handling Tx calchan tables.
3 */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <stdint.h>
8 #include <endian.h>
9 #include <rvinterf/l1tm.h>
10 #include <rvinterf/exitcodes.h>
11 #include "txband.h"
12 #include "txcalchan.h"
13
14 extern struct txcal_band *txcal_band;
15
16 unsigned tx_calchan_values[TX_CALCHAN_TABLES][TX_CALCHAN_ENTRIES];
17
18 init_tx_calchan()
19 {
20 unsigned i, j;
21
22 for (i = 0; i < TX_CALCHAN_TABLES; i++)
23 for (j = 0; j < TX_CALCHAN_ENTRIES; j++)
24 tx_calchan_values[i][j] = 128;
25 return(0);
26 }
27
28 upload_tx_calchan()
29 {
30 unsigned i, j;
31 struct tx_calchan_entry l1_table[TX_CALCHAN_TABLES][TX_CALCHAN_ENTRIES];
32
33 for (i = 0; i < TX_CALCHAN_TABLES; i++) {
34 for (j = 0; j < TX_CALCHAN_ENTRIES; j++) {
35 l1_table[i][j].arfcn_limit =
36 htole16(txcal_band->calchan_ranges[j].upper_bound);
37 l1_table[i][j].chan_cal =
38 htole16(tx_calchan_values[i][j]);
39 }
40 }
41 do_rftw(TX_CAL_CHAN, l1_table, sizeof l1_table);
42 return(0);
43 }