annotate chipsetsw/layer1/tm_cust0/l1tm_cust.c @ 349:ed3e588600c1 default tip

README update for the successful completion of the L1 reconstruction project
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 30 Oct 2017 18:03:24 +0000
parents 2a1b6e3f7a84
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1 /************* Revision Controle System Header *************
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
2 * GSM Layer 1 software
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
3 * L1TM_CUST.C
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
4 *
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
5 * Filename %M%
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
6 * Version %I%
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
7 * Date %G%
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
8 *
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
9 ************* Revision Controle System Header *************/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
10
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
11 #include "l1_confg.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
12 #if TESTMODE
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
13
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
14 #include "tm_defs.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
15 #include "l1_const.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
16 #include "l1_types.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
17
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
18 #include "l1tm_defty.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
19 #include "l1tm_cust.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
20
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
21 #if (AUDIO_TASK == 1)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
22 #include "l1audio_const.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
23 #include "l1audio_cust.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
24 #include "l1audio_defty.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
25 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
26
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
27 #if (L1_GTT == 1)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
28 #include "l1gtt_const.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
29 #include "l1gtt_defty.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
30 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
31 #include "l1_defty.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
32 #include "l1_msgty.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
33 #include "l1_tabs.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
34
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
35 #include "l1tm_msgty.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
36 #include "l1tm_varex.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
37
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
38 #include "abb.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
39
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
40 #if (RF==35)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
41 #include "tpudrv35.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
42 #include "l1_rf35.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
43 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
44
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
45 #if (RF==12)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
46 #include "tpudrv12.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
47 #include "l1_rf12.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
48 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
49
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
50 #if (RF==10)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
51 #include "tpudrv10.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
52 #include "l1_rf10.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
53 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
54
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
55 #if (RF==8)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
56 #include "tpudrv8.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
57 #include "l1_rf8.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
58 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
59
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
60 #if (RF==2)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
61 #include "l1_rf2.h"
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
62 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
63
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
64 #include <string.h>
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
65
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
66 // Import band configuration from Flash module (need to replace by an access function)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
67 //extern UWORD8 std;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
68 extern T_L1_CONFIG l1_config;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
69 extern T_RF rf;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
70 extern T_RF_BAND rf_band[GSM_BANDS];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
71 extern UWORD16 AGC_TABLE[AGC_TABLE_SIZE];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
72 extern T_ADC adc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
73 extern T_ADCCAL adc_cal;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
74 extern UWORD16 TM_ul_data[16]; //Uplink data to be stored into ABB Uplink buffer
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
75 extern T_STD_CONFIG std_config[];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
76 static UWORD8 tm_band = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
77
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
78 // External function prototypes
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
79 void get_cal_from_nvmem (UWORD8 *ptr, UWORD16 len, UWORD8 id);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
80 UWORD8 save_cal_in_nvmem (UWORD8 *ptr, UWORD16 len, UWORD8 id);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
81 void Cust_init_std(void);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
82 void l1_tpu_init_light(void);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
83
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
84 enum {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
85 TM_RF_ID = 0,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
86 TM_ADC_ID = 1
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
87 };
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
88
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
89 typedef signed char effs_t;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
90 // external FFS function prototypes
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
91 effs_t ffs_mkdir(const char *pathname);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
92 void config_ffs_write(char type);
246
03c8cdc20ffa l1tm_cust.c: initial preen, MV100 proprietary junk removed
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
93
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
94 /***********************************************************************/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
95 /* TESTMODE 4.X */
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
96 /***********************************************************************/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
97
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
98
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
99 /*----------------------------------------------------------*/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
100 /* Cust_tm_init() */
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
101 /*----------------------------------------------------------*/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
102 /* Parameters : */
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
103 /* Return : */
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
104 /* Functionality : Init default configuration for TM params */
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
105 /*----------------------------------------------------------*/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
106
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
107 void Cust_tm_init(void)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
108 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
109 UWORD32 i;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
110
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
111 l1_config.adc_enable = ADC_ENABLE; // ADC readings enabled
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
112 l1_config.agc_enable = AGC_ENABLE; // AGC algo enabled
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
113 l1_config.afc_enable = AFC_ENABLE; // AFC algo enabled
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
114 l1_config.tmode.rf_params.bcch_arfcn = TM_BCCH_ARFCN;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
115 l1_config.tmode.rf_params.tch_arfcn = TM_TCH_ARFCN;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
116 l1_config.tmode.rf_params.mon_arfcn = TM_MON_ARFCN;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
117 l1_config.tmode.rf_params.channel_type = TM_CHAN_TYPE; // TCH_F
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
118 l1_config.tmode.rf_params.subchannel = TM_SUB_CHAN;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
119 l1_config.tmode.rf_params.reload_ramps_flag = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
120 l1_config.tmode.rf_params.tmode_continuous = TM_NO_CONTINUOUS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
121 l1_config.tmode.rx_params.slot_num = TM_SLOT_NUM; // Time Slot
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
122 l1_config.tmode.rx_params.agc = TM_AGC_VALUE; //This may be outside the range of the RF chip used
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
123 l1_config.tmode.rx_params.pm_enable = TM_PM_ENABLE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
124 l1_config.tmode.rx_params.lna_off = TM_LNA_OFF;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
125 l1_config.tmode.rx_params.number_of_measurements = TM_NUM_MEAS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
126 l1_config.tmode.rx_params.place_of_measurement = TM_WIN_MEAS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
127 l1_config.tmode.tx_params.txpwr = TM_TXPWR; // Min power level for GSM900
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
128 l1_config.tmode.tx_params.txpwr_skip = TM_TXPWR_SKIP;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
129 l1_config.tmode.tx_params.timing_advance = TM_TA;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
130 l1_config.tmode.tx_params.burst_type = TM_BURST_TYPE; // default is normal up-link burst
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
131 l1_config.tmode.tx_params.burst_data = TM_BURST_DATA; // default is all zeros
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
132 l1_config.tmode.tx_params.tsc = TM_TSC; // Training Sequence ("BCC" on BSS)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
133 #if (CODE_VERSION != SIMULATION)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
134 l1_config.tmode.stats_config.num_loops = TM_NUM_LOOPS; // 0 actually means infinite
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
135 #else
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
136 l1_config.tmode.stats_config.num_loops = 4; // 0 actually means infinite
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
137 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
138 l1_config.tmode.stats_config.auto_result_loops = TM_AUTO_RESULT_LOOPS; // 0 actually means infinite
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
139 l1_config.tmode.stats_config.auto_reset_loops = TM_AUTO_RESET_LOOPS; // 0 actually means infinite
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
140 l1_config.tmode.stats_config.stat_type = TM_STAT_TYPE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
141 l1_config.tmode.stats_config.stat_bitmask = TM_STAT_BITMASK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
142
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
143 #if (CODE_VERSION != SIMULATION)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
144 // Initialize APCDEL1 register of Omega
247
65004e173824 l1tm_cust.c: passes compilation after constant name fix
Mychaela Falconia <falcon@freecalypso.org>
parents: 246
diff changeset
145 ABB_Write_Register_on_page(PAGE0, APCDEL1, (C_APCDEL1 - 0x0004) >> 6);
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
146 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
147
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
148 l1tm.tm_msg_received = FALSE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
149
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
150 for (i=0;i<16;i++)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
151 TM_ul_data[i]=0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
152
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
153 #if L1_GPRS
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
154 l1_config.tmode.rf_params.pdtch_arfcn = TM_PDTCH_ARFCN;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
155 l1_config.tmode.rf_params.multislot_class = TM_MULTISLOT_CLASS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
156 l1_config.tmode.stats_config.stat_gprs_slots = TM_STAT_GPRS_SLOTS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
157 l1_config.tmode.rx_params.timeslot_alloc = TM_RX_ALLOCATION;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
158 l1_config.tmode.rx_params.coding_scheme = TM_RX_CODING_SCHEME;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
159 l1_config.tmode.tx_params.timeslot_alloc = TM_TX_ALLOCATION;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
160 l1_config.tmode.tx_params.coding_scheme = TM_TX_CODING_SCHEME;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
161 for (i=0; i<8; i++)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
162 l1_config.tmode.tx_params.txpwr_gprs[i] = TM_TXPWR_GPRS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
163
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
164 for (i=0; i<27; i++)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
165 l1_config.tmode.tx_params.rlc_buffer[i] = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
166 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
167 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
168
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
169
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
170 /**********************************************************************/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
171 /* Test mode functions used for RF calibration */
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
172 /**********************************************************************/
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
173
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
174 void Cust_tm_rf_param_write(T_TM_RETURN *tm_return, WORD16 index, UWORD16 value)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
175 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
176 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
177 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
178 case STD_BAND_FLAG:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
179 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
180 UWORD8 std_temp, band_temp;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
181
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
182 std_temp = value & 0xff; // tm_band = b7..0 of value
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
183 band_temp = value >> 8; // band = b15..8 of value
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
184 // get define
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
185 //if (sizeof(std_config)/sizeof(T_STD_CONFIG) <= std_temp)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
186 if (9 <= std_temp) // std max
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
187 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
188 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
189 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
190 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
191 else if ( GSM_BANDS <= band_temp)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
192 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
193 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
194 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
195 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
196 else if ( BAND_NONE == std_config[std_temp].band[band_temp])
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
197 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
198 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
199 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
200 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
201 else
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
202 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
203 l1_config.std.id = std_temp;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
204 tm_band = band_temp;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
205 // update RAM struct with either default or ffs
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
206 Cust_init_std();
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
207 l1_tpu_init_light();
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
208 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
209 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
210 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
211 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
212
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
213 case INITIAL_AFC_DAC:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
214 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
215 rf.afc.eeprom_afc = (WORD16) value << 3; // shift to put into F13.3 format
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
216 l1_config.params.eeprom_afc = rf.afc.eeprom_afc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
217
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
218 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
219 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
220 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
221 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
222 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
223 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
224 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
225 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
226 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
227 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
228
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
229 void Cust_tm_rf_param_read(T_TM_RETURN *tm_return, WORD16 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
230 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
231 volatile UWORD16 value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
232
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
233 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
234 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
235 case STD_BAND_FLAG:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
236 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
237 value = ((tm_band << 8) | (l1_config.std.id) ); // return global std, tm_band (intel format)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
238 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
239 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
240 case INITIAL_AFC_DAC:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
241 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
242 value = rf.afc.eeprom_afc >> 3; // returned as F13.3
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
243 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
244 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
245 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
246 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
247 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
248 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
249 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
250 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
251 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
252
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
253 memcpy(tm_return->result, (UWORD8 *)&value, 2);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
254 tm_return->size = 2;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
255 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
256 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
257
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
258 void Cust_tm_rf_table_write(T_TM_RETURN *tm_return, WORD8 index, UWORD8 size, UWORD8 table[])
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
259 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
260 UWORD8 band=0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
261
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
262 tm_return->index = index; // store index before it gets modified
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
263 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
264
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
265 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
266 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
267 case RX_AGC_TABLE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
268 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
269 if (size != sizeof(AGC_TABLE))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
270 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
271 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
272 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
273 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
274
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
275 memcpy(&AGC_TABLE[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
276 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
277 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
278 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
279 case AFC_PARAMS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
280 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
281
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
282 #if (VCXO_ALGO == 1)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
283 if (size != 24) // 4 UWORD32 + 4 WORD16 values
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
284 #else
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
285 if (size != 16) // 4 UWORD32 values
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
286 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
287 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
288 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
289 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
290 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
291
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
292 memcpy(&rf.afc.psi_sta_inv, table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
293 l1_config.params.psi_sta_inv = rf.afc.psi_sta_inv;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
294 l1_config.params.psi_st = rf.afc.psi_st;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
295 l1_config.params.psi_st_32 = rf.afc.psi_st_32;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
296 l1_config.params.psi_st_inv = rf.afc.psi_st_inv;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
297
246
03c8cdc20ffa l1tm_cust.c: initial preen, MV100 proprietary junk removed
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
298 #if (CODE_VERSION == NOT_SIMULATION)
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
299 #if (VCXO_ALGO == 1)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
300 l1_config.params.afc_dac_center = rf.afc.dac_center;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
301 l1_config.params.afc_dac_min = rf.afc.dac_min;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
302 l1_config.params.afc_dac_max = rf.afc.dac_max;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
303 l1_config.params.afc_snr_thr = rf.afc.snr_thr;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
304 #endif
246
03c8cdc20ffa l1tm_cust.c: initial preen, MV100 proprietary junk removed
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
305 #endif
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
306
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
307 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
308 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
309 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
310 case RX_AGC_GLOBAL_PARAMS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
311 {
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
312 if (size != 8) // 4 UWORD16 values
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
313 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
314 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
315 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
316 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
317
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
318 memcpy(&rf.rx.agc.low_agc_noise_thr, table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
319 l1_config.params.low_agc_noise_thr = rf.rx.agc.low_agc_noise_thr;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
320 l1_config.params.high_agc_sat_thr = rf.rx.agc.high_agc_sat_thr;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
321 l1_config.params.low_agc = rf.rx.agc.low_agc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
322 l1_config.params.high_agc = rf.rx.agc.high_agc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
323
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
324 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
325 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
326 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
327 case RX_IL_2_AGC_MAX:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
328 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
329 if (size != sizeof(rf.rx.agc.il2agc_max))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
330 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
331 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
332 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
333 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
334
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
335 memcpy(&rf.rx.agc.il2agc_max[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
336 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
337 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
338 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
339 case RX_IL_2_AGC_PWR:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
340 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
341 if (size != sizeof(rf.rx.agc.il2agc_pwr))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
342 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
343 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
344 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
345 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
346
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
347 memcpy(&rf.rx.agc.il2agc_pwr[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
348 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
349 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
350 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
351 case RX_IL_2_AGC_AV:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
352 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
353 if (size != sizeof(rf.rx.agc.il2agc_av))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
354 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
355 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
356 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
357 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
358
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
359 memcpy(&rf.rx.agc.il2agc_av[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
360 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
361 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
362 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
363 case TX_LEVELS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
364 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
365 if (size != sizeof(rf_band[tm_band].tx.levels))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
366 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
367 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
368 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
369 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
370
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
371 memcpy(&rf_band[tm_band].tx.levels[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
372 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
373 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
374 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
375 case TX_CAL_CHAN: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
376 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
377 if (size != sizeof(rf_band[tm_band].tx.chan_cal_table))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
378 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
379 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
380 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
381 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
382
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
383 memcpy(&rf_band[tm_band].tx.chan_cal_table[0][0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
384 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
385 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
386 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
387 case TX_CAL_TEMP: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
388 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
389 if (size != sizeof(rf_band[tm_band].tx.temp))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
390 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
391 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
392 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
393 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
394
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
395 memcpy(&rf_band[tm_band].tx.temp[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
396 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
397 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
398 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
399 case RX_CAL_CHAN: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
400 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
401 if (size != sizeof(rf_band[tm_band].rx.agc_bands))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
402 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
403 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
404 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
405 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
406
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
407 memcpy(&rf_band[tm_band].rx.agc_bands[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
408 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
409 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
410 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
411 case RX_CAL_TEMP: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
412 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
413 if (size != sizeof(rf_band[tm_band].rx.temp))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
414 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
415 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
416 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
417 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
418
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
419 memcpy(&rf_band[tm_band].rx.temp[0], table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
420 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
421 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
422 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
423 case RX_AGC_PARAMS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
424 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
425 if (size != sizeof(rf_band[tm_band].rx.rx_cal_params))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
426 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
427 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
428 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
429 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
430
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
431 memcpy(&rf_band[tm_band].rx.rx_cal_params, table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
432 if (tm_band == 0)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
433 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
434 l1_config.std.g_magic_band1 = rf_band[tm_band].rx.rx_cal_params.g_magic;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
435 l1_config.std.lna_att_band1 = rf_band[tm_band].rx.rx_cal_params.lna_att;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
436 l1_config.std.lna_switch_thr_low_band1 = rf_band[tm_band].rx.rx_cal_params.lna_switch_thr_low;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
437 l1_config.std.lna_switch_thr_high_band1 = rf_band[tm_band].rx.rx_cal_params.lna_switch_thr_high;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
438 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
439 else if (tm_band == 1)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
440 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
441 l1_config.std.g_magic_band2 = rf_band[tm_band].rx.rx_cal_params.g_magic;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
442 l1_config.std.lna_att_band2 = rf_band[tm_band].rx.rx_cal_params.lna_att;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
443 l1_config.std.lna_switch_thr_low_band2 = rf_band[tm_band].rx.rx_cal_params.lna_switch_thr_low;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
444 l1_config.std.lna_switch_thr_high_band2 = rf_band[tm_band].rx.rx_cal_params.lna_switch_thr_high;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
445 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
446 else
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
447 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
448 tm_return->status = E_INVAL;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
449 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
450 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
451
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
452 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
453 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
454 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
455 case TX_CAL_EXTREME:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
456 case RX_CAL_LEVEL:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
457 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
458 tm_return->status = E_NOSUBSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
459 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
460 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
461 #if L1_GPRS
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
462 case RLC_TX_BUFFER_CS1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
463 case RLC_TX_BUFFER_CS2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
464 case RLC_TX_BUFFER_CS3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
465 case RLC_TX_BUFFER_CS4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
466 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
467 UWORD8 i, buffer_size;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
468
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
469 tm_return->index = index; // store index before it gets modified
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
470 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
471
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
472 buffer_size = size/2 + size%2; // bytes will be concatenated into UWORD16
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
473
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
474 if (buffer_size > 27) //max. number of data bytes
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
475 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
476 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
477 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
478 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
479
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
480 // make sure that last byte is zero in case of odd number of bytes
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
481 table[size] = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
482
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
483 // init the whole buffer before downloading new data
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
484 for (i=0; i<27; i++)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
485 l1_config.tmode.tx_params.rlc_buffer[i] = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
486
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
487 for (i=0; i<buffer_size; i++)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
488 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
489 l1_config.tmode.tx_params.rlc_buffer[i] = (table[2*i+1] << 8) | table[2*i];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
490 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
491 l1_config.tmode.tx_params.rlc_buffer_size = buffer_size;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
492
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
493 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
494 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
495 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
496 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
497 case TX_DATA_BUFFER:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
498 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
499 UWORD8 i;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
500
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
501 tm_return->index = index; // store index before it gets modified
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
502 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
503
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
504 if (size != 32) // 16 UWORD16 (containing 10 data bits each)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
505 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
506 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
507 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
508 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
509
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
510 memcpy(&TM_ul_data, table, size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
511
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
512 for (i=0; i<16; i++)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
513 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
514 TM_ul_data[i] = TM_ul_data[i] << 6;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
515 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
516
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
517 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
518 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
519 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
520 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
521 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
522 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
523 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
524 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
525 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
526 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
527
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
528 void Cust_tm_rf_table_read(T_TM_RETURN *tm_return, WORD8 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
529 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
530 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
531 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
532 case RX_AGC_TABLE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
533 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
534 tm_return->size = sizeof(AGC_TABLE);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
535 memcpy(tm_return->result, &AGC_TABLE[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
536 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
537 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
538 case AFC_PARAMS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
539 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
540 #if (VCXO_ALGO == 1)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
541 tm_return->size = 24; // 4 UWORD32's + 4 WORD16
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
542 #else
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
543 tm_return->size = 16; // 4 UWORD32's
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
544 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
545 memcpy(tm_return->result, &rf.afc.psi_sta_inv, tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
546 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
547 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
548 case RX_AGC_GLOBAL_PARAMS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
549 {
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
550 tm_return->size = 8; // 4 UWORD16's
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
551 memcpy(tm_return->result, &rf.rx.agc.low_agc_noise_thr, tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
552
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
553 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
554 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
555 case RX_IL_2_AGC_MAX:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
556 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
557 tm_return->size = sizeof(rf.rx.agc.il2agc_max);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
558 memcpy(tm_return->result, &rf.rx.agc.il2agc_max[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
559 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
560 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
561 case RX_IL_2_AGC_PWR:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
562 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
563 tm_return->size = sizeof(rf.rx.agc.il2agc_pwr);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
564 memcpy(tm_return->result, &rf.rx.agc.il2agc_pwr[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
565 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
566 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
567 case RX_IL_2_AGC_AV:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
568 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
569 tm_return->size = sizeof(rf.rx.agc.il2agc_av);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
570 memcpy(tm_return->result, &rf.rx.agc.il2agc_av[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
571 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
572 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
573 case TX_LEVELS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
574 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
575 tm_return->size = sizeof(rf_band[tm_band].tx.levels);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
576 memcpy(tm_return->result, &rf_band[tm_band].tx.levels[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
577 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
578 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
579 case TX_CAL_CHAN: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
580 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
581 tm_return->size = sizeof(rf_band[tm_band].tx.chan_cal_table);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
582 memcpy(tm_return->result, &rf_band[tm_band].tx.chan_cal_table[0][0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
583 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
584 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
585 case TX_CAL_TEMP: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
586 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
587 tm_return->size = sizeof(rf_band[tm_band].tx.temp);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
588 memcpy(tm_return->result, &rf_band[tm_band].tx.temp[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
589 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
590 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
591 case RX_CAL_CHAN: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
592 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
593 tm_return->size = sizeof(rf_band[tm_band].rx.agc_bands);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
594 memcpy(tm_return->result, &rf_band[tm_band].rx.agc_bands[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
595 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
596 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
597 case RX_CAL_TEMP: // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
598 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
599 tm_return->size = sizeof(rf_band[tm_band].rx.temp);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
600 memcpy(tm_return->result, &rf_band[tm_band].rx.temp[0], tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
601 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
602 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
603 case RX_AGC_PARAMS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
604 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
605 // WARNING: sizeof(rf.rx.rx_cal_params[band]) returns 12 because of alignment
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
606 tm_return->size = 10; // five UWORD16's
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
607 memcpy(tm_return->result, &rf_band[tm_band].rx.rx_cal_params, tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
608 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
609 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
610 case TX_CAL_EXTREME:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
611 case RX_CAL_LEVEL:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
612 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
613 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
614 tm_return->status = E_NOSUBSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
615 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
616 }
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
617
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
618 #if L1_GPRS
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
619 case RLC_TX_BUFFER_CS1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
620 case RLC_TX_BUFFER_CS2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
621 case RLC_TX_BUFFER_CS3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
622 case RLC_TX_BUFFER_CS4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
623 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
624 tm_return->size = l1_config.tmode.tx_params.rlc_buffer_size * 2; // UWORD16's
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
625 memcpy(tm_return->result, &l1_config.tmode.tx_params.rlc_buffer[0], tm_return->size);
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
626 break;
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
627 }
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
628 #endif
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
629
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
630 case TX_DATA_BUFFER:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
631 {
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
632 UWORD8 i;
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
633 for (i=0; i<16; i++)
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
634 {
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
635 tm_return->result[2*i]=(TM_ul_data[i] >> 6) & 0x00FF;
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
636 tm_return->result[2*i+1]=(TM_ul_data[i] >> 14) & 0x0003;
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
637 }
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
638
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
639 tm_return->size = 32; //16*UWORD16
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
640 break;
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
641 }
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
642
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
643 #if (RF==35)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
644 case RX_PLL_TUNING_TABLE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
645 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
646 tm_return->size = sizeof(pll_tuning); //6*UWORD16
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
647 memcpy(tm_return->result, &pll_tuning, tm_return->size);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
648 pll_tuning.enable = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
649 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
650 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
651 #endif
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
652
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
653 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
654 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
655 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
656 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
657 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
658 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
659 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
660
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
661 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
662 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
663 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
664
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
665 void Cust_tm_rx_param_write(T_TM_RETURN *tm_return, WORD16 index, UWORD16 value)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
666 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
667 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
668 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
669 case RX_FRONT_DELAY:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
670 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
671 //delay for dual band not implemented yet
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
672 rf.tx.prg_tx = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
673 l1_config.params.prg_tx_gsm = rf.tx.prg_tx;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
674 l1_config.params.prg_tx_dcs = rf.tx.prg_tx;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
675
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
676 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
677 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
678 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
679 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
680 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
681 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
682 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
683 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
684 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
685 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
686
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
687 void Cust_tm_rx_param_read(T_TM_RETURN *tm_return, WORD16 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
688 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
689 volatile UWORD16 value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
690
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
691 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
692 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
693 case RX_FRONT_DELAY:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
694 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
695 value = rf.tx.prg_tx;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
696 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
697 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
698 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
699 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
700 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
701 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
702 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
703 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
704 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
705
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
706 memcpy(tm_return->result, (UWORD8 *)&value, 2);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
707 tm_return->size = 2;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
708 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
709 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
710
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
711 void Cust_tm_tx_param_write(T_TM_RETURN *tm_return, WORD16 index, UWORD16 value, UWORD8 band)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
712 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
713 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
714 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
715 case TX_APC_DAC:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
716 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
717 // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
718 rf_band[tm_band].tx.levels[l1_config.tmode.tx_params.txpwr].apc = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
719
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
720 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
721 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
722 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
723 case TX_RAMP_TEMPLATE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
724 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
725 if (value >= sizeof(rf_band[tm_band].tx.ramp_tables)/sizeof(rf_band[tm_band].tx.ramp_tables[0])) // [0..15]
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
726 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
727 tm_return->status = E_INVAL;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
728 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
729 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
730
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
731 // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
732 rf_band[tm_band].tx.levels[l1_config.tmode.tx_params.txpwr].ramp_index = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
733
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
734 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
735 l1_config.tmode.rf_params.reload_ramps_flag = 1;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
736 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
737 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
738 case TX_CHAN_CAL_TABLE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
739 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
740 if (value >= sizeof(rf_band[tm_band].tx.chan_cal_table)/sizeof(rf_band[tm_band].tx.chan_cal_table[0]))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
741 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
742 tm_return->status = E_INVAL;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
743 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
744 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
745
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
746 // generic for all bands
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
747 rf_band[tm_band].tx.levels[l1_config.tmode.tx_params.txpwr].chan_cal_index = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
748
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
749 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
750
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
751 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
752 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
753 case TX_BURST_TYPE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
754 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
755 if (value > 1) // [0..1]
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
756 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
757 tm_return->status = E_INVAL;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
758 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
759 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
760 l1_config.tmode.tx_params.burst_type = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
761 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
762 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
763 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
764 case TX_BURST_DATA:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
765 {
248
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
766 // range is [0..10], currently we support [0..13] at the moment
2a1b6e3f7a84 l1tm_cust.c: reconstruction complete, exact match to TCS211 binary object
Mychaela Falconia <falcon@freecalypso.org>
parents: 247
diff changeset
767 if (value > 13)
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
768 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
769 tm_return->status = E_INVAL;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
770 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
771 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
772 l1_config.tmode.tx_params.burst_data = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
773 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
774 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
775 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
776 case TX_TRAINING_SEQ:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
777 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
778 if (value > 7) // [0..7]
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
779 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
780 tm_return->status = E_INVAL;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
781 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
782 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
783 l1_config.tmode.tx_params.tsc = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
784 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
785 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
786 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
787 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
788 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
789 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
790 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
791 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
792 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
793 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
794
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
795 void Cust_tm_tx_param_read(T_TM_RETURN *tm_return, WORD16 index, UWORD8 band)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
796 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
797 volatile UWORD16 value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
798
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
799 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
800 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
801 case TX_PWR_LEVEL:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
802 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
803 value = l1_config.tmode.tx_params.txpwr;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
804 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
805 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
806 case TX_APC_DAC:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
807 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
808 value = rf_band[tm_band].tx.levels[l1_config.tmode.tx_params.txpwr].apc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
809 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
810 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
811 case TX_RAMP_TEMPLATE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
812 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
813 value = rf_band[tm_band].tx.levels[l1_config.tmode.tx_params.txpwr].ramp_index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
814 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
815 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
816 case TX_CHAN_CAL_TABLE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
817 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
818 value = rf_band[tm_band].tx.levels[l1_config.tmode.tx_params.txpwr].chan_cal_index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
819 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
820 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
821 case TX_BURST_TYPE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
822 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
823 value = l1_config.tmode.tx_params.burst_type;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
824 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
825 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
826 case TX_BURST_DATA:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
827 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
828 value = l1_config.tmode.tx_params.burst_data;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
829 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
830 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
831 case TX_TIMING_ADVANCE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
832 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
833 value = l1_config.tmode.tx_params.timing_advance;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
834 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
835 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
836 case TX_TRAINING_SEQ:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
837 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
838 value = l1_config.tmode.tx_params.tsc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
839 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
840 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
841 case TX_PWR_SKIP:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
842 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
843 value = l1_config.tmode.tx_params.txpwr_skip;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
844 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
845 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
846 #if L1_GPRS
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
847 case TX_GPRS_POWER0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
848 case TX_GPRS_POWER1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
849 case TX_GPRS_POWER2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
850 case TX_GPRS_POWER3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
851 case TX_GPRS_POWER4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
852 case TX_GPRS_POWER5:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
853 case TX_GPRS_POWER6:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
854 case TX_GPRS_POWER7:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
855 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
856 value = l1_config.tmode.tx_params.txpwr_gprs[index - TX_GPRS_POWER0];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
857 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
858 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
859 case TX_GPRS_SLOTS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
860 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
861 value = l1_config.tmode.tx_params.timeslot_alloc;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
862 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
863 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
864 case TX_GPRS_CODING:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
865 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
866 value = l1_config.tmode.tx_params.coding_scheme;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
867 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
868 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
869 #endif
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
870 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
871 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
872 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
873 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
874 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
875 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
876 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
877
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
878 memcpy(tm_return->result, (UWORD8 *)&value, 2);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
879 tm_return->size = 2;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
880 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
881 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
882
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
883 void Cust_tm_tx_template_write(T_TM_RETURN *tm_return, WORD8 index, UWORD8 size, UWORD8 table[])
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
884 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
885 if (index >= sizeof(rf_band[tm_band].tx.ramp_tables)/sizeof(T_TX_RAMP))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
886 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
887 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
888 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
889 else if (size != sizeof(T_TX_RAMP))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
890 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
891 // We are writing both the up and down ramps; size must be exact.
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
892 tm_return->status = E_BADSIZE;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
893 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
894 else
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
895 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
896 memcpy(rf_band[tm_band].tx.ramp_tables[index].ramp_up, &table[0], size/2);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
897 memcpy(rf_band[tm_band].tx.ramp_tables[index].ramp_down, &table[size/2], size/2);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
898 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
899 l1_config.tmode.rf_params.reload_ramps_flag = 1;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
900 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
901
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
902 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
903 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
904 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
905
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
906 void Cust_tm_tx_template_read(T_TM_RETURN *tm_return, WORD8 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
907 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
908 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
909
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
910 if (index >= sizeof(rf_band[tm_band].tx.ramp_tables)/sizeof(T_TX_RAMP))
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
911 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
912 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
913 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
914 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
915 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
916
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
917 memcpy(&tm_return->result[0], rf_band[tm_band].tx.ramp_tables[index].ramp_up, sizeof(rf_band[tm_band].tx.ramp_tables[index].ramp_up));
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
918 memcpy(&tm_return->result[sizeof(rf_band[tm_band].tx.ramp_tables[index].ramp_up)], rf_band[tm_band].tx.ramp_tables[index].ramp_down, sizeof(rf_band[tm_band].tx.ramp_tables[index].ramp_down));
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
919 tm_return->size = sizeof(rf_band[tm_band].tx.ramp_tables[index]);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
920 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
921 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
922
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
923 void Cust_tm_misc_param_write(T_TM_RETURN *tm_return, WORD16 index, UWORD16 value)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
924 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
925 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
926 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
927 case GPIOSTATE0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
928 case GPIODIR0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
929 case GPIOSTATE1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
930 case GPIODIR1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
931 case GPIOSTATE0P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
932 case GPIODIR0P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
933 case GPIOSTATE1P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
934 case GPIODIR1P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
935 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
936 tm_return->status = E_NOSUBSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
937 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
938 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
939 case CONVERTED_ADC0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
940 case CONVERTED_ADC1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
941 case CONVERTED_ADC2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
942 case CONVERTED_ADC3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
943 case CONVERTED_ADC4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
944 case CONVERTED_ADC5:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
945 case CONVERTED_ADC6:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
946 case CONVERTED_ADC7:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
947 case CONVERTED_ADC8:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
948 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
949 adc.converted[index - CONVERTED_ADC0] = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
950 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
951 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
952 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
953
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
954 case RAW_ADC0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
955 case RAW_ADC1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
956 case RAW_ADC2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
957 case RAW_ADC3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
958 case RAW_ADC4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
959 case RAW_ADC5:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
960 case RAW_ADC6:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
961 case RAW_ADC7:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
962 case RAW_ADC8:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
963 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
964 adc.raw[index - RAW_ADC0] = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
965 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
966 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
967 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
968
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
969 case ADC0_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
970 case ADC1_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
971 case ADC2_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
972 case ADC3_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
973 case ADC4_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
974 case ADC5_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
975 case ADC6_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
976 case ADC7_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
977 case ADC8_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
978 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
979 adc_cal.a[index - ADC0_COEFF_A] = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
980 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
981 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
982 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
983
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
984 case ADC0_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
985 case ADC1_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
986 case ADC2_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
987 case ADC3_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
988 case ADC4_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
989 case ADC5_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
990 case ADC6_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
991 case ADC7_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
992 case ADC8_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
993 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
994 adc_cal.b[index - ADC0_COEFF_B] = value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
995 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
996 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
997 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
998 case SLEEP_MODE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
999 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1000 tm_return->status = E_NOSUBSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1001 break;
246
03c8cdc20ffa l1tm_cust.c: initial preen, MV100 proprietary junk removed
Mychaela Falconia <falcon@freecalypso.org>
parents: 245
diff changeset
1002 }
245
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1003 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1004 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1005 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1006 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1007 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1008 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1009 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1010
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1011 void Cust_tm_misc_param_read(T_TM_RETURN *tm_return, WORD16 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1012 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1013 volatile UWORD16 value;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1014
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1015 switch (index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1016 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1017 case GPIOSTATE0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1018 case GPIODIR0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1019 case GPIOSTATE1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1020 case GPIODIR1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1021 case GPIOSTATE0P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1022 case GPIODIR0P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1023 case GPIOSTATE1P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1024 case GPIODIR1P:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1025 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1026 tm_return->status = E_NOSUBSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1027 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1028 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1029 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1030 case CONVERTED_ADC0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1031 case CONVERTED_ADC1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1032 case CONVERTED_ADC2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1033 case CONVERTED_ADC3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1034 case CONVERTED_ADC4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1035 case CONVERTED_ADC5:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1036 case CONVERTED_ADC6:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1037 case CONVERTED_ADC7:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1038 case CONVERTED_ADC8:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1039 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1040 value = adc.converted[index - CONVERTED_ADC0];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1041 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1042 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1043 case RAW_ADC0:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1044 case RAW_ADC1:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1045 case RAW_ADC2:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1046 case RAW_ADC3:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1047 case RAW_ADC4:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1048 case RAW_ADC5:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1049 case RAW_ADC6:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1050 case RAW_ADC7:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1051 case RAW_ADC8:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1052 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1053 value = adc.raw[index - RAW_ADC0];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1054 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1055 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1056 case ADC0_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1057 case ADC1_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1058 case ADC2_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1059 case ADC3_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1060 case ADC4_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1061 case ADC5_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1062 case ADC6_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1063 case ADC7_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1064 case ADC8_COEFF_A:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1065 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1066 value = adc_cal.a[index - ADC0_COEFF_A];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1067 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1068 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1069 case ADC0_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1070 case ADC1_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1071 case ADC2_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1072 case ADC3_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1073 case ADC4_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1074 case ADC5_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1075 case ADC6_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1076 case ADC7_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1077 case ADC8_COEFF_B:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1078 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1079 value = adc_cal.b[index - ADC0_COEFF_B];
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1080 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1081 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1082 case SLEEP_MODE:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1083 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1084 tm_return->status = E_NOSUBSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1085 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1086 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1087 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1088 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1089 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1090 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1091 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1092 return;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1093 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1094 } // end switch
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1095
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1096 memcpy(tm_return->result, (UWORD8 *)&value, 2);
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1097 tm_return->size = 2;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1098 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1099 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1100
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1101 void Cust_tm_misc_enable(T_TM_RETURN *tm_return, WORD16 action)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1102 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1103 UWORD8 status;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1104
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1105 // FIXME: This enum really should go into testmode header file.
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1106 enum ME_CFG_WRITE_E {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1107 CFG_WRITE_MKDIRS = 100,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1108 CFG_WRITE_RF_CAL = 102,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1109 CFG_WRITE_RF_CFG = 103,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1110 CFG_WRITE_TX_CAL = 104,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1111 CFG_WRITE_TX_CFG = 105,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1112 CFG_WRITE_RX_CAL = 106,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1113 CFG_WRITE_RX_CFG = 107,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1114 CFG_WRITE_SYS_CAL = 108,
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1115 CFG_WRITE_SYS_CFG = 109
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1116 };
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1117
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1118 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1119 tm_return->index = action;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1120 tm_return->status = E_OK;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1121
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1122 // FIXME: This code should actually be in misc_enable()
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1123 switch(action)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1124 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1125 case CFG_WRITE_MKDIRS:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1126 ffs_mkdir("/gsm");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1127 ffs_mkdir("/pcm");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1128 ffs_mkdir("/sys");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1129 ffs_mkdir("/mmi");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1130 ffs_mkdir("/vos");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1131 ffs_mkdir("/var");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1132 ffs_mkdir("/gsm/rf");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1133 ffs_mkdir("/gsm/com");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1134 ffs_mkdir("/vos/vm");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1135 ffs_mkdir("/vos/vrm");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1136 ffs_mkdir("/vos/vrp");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1137 ffs_mkdir("/var/log");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1138 ffs_mkdir("/var/tst");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1139 ffs_mkdir("/gsm/rf/tx");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1140 ffs_mkdir("/gsm/rf/rx");
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1141 break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1142 case CFG_WRITE_RF_CAL: config_ffs_write('f'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1143 case CFG_WRITE_RF_CFG: config_ffs_write('F'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1144 case CFG_WRITE_TX_CAL: config_ffs_write('t'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1145 case CFG_WRITE_TX_CFG: config_ffs_write('T'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1146 case CFG_WRITE_RX_CAL: config_ffs_write('r'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1147 case CFG_WRITE_RX_CFG: config_ffs_write('R'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1148 case CFG_WRITE_SYS_CAL: config_ffs_write('s'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1149 case CFG_WRITE_SYS_CFG: config_ffs_write('S'); break;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1150 default:
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1151 tm_return->status = E_BADINDEX;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1152 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1153 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1154
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1155 void Cust_tm_special_param_write(T_TM_RETURN *tm_return, WORD16 index, UWORD16 value)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1156 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1157 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1158 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1159 tm_return->status = E_NOSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1160 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1161
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1162 void Cust_tm_special_param_read(T_TM_RETURN *tm_return, WORD16 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1163 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1164 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1165 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1166 tm_return->status = E_NOSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1167 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1168
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1169 void Cust_tm_special_table_write(T_TM_RETURN *tm_return, WORD8 index, UWORD8 size, UWORD8 table[])
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1170 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1171 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1172 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1173 tm_return->status = E_NOSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1174 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1175
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1176 void Cust_tm_special_table_read(T_TM_RETURN *tm_return, WORD8 index)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1177 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1178 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1179 tm_return->index = index;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1180 tm_return->status = E_NOSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1181 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1182
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1183 void Cust_tm_special_enable(T_TM_RETURN *tm_return, WORD16 action)
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1184 {
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1185 tm_return->size = 0;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1186 tm_return->index = action;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1187 tm_return->status = E_NOSYS;
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1188 }
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1189
bf5d58fc0de7 l1tm_cust.c: initial import from MV100 source
Mychaela Falconia <falcon@freecalypso.org>
parents: 185
diff changeset
1190 #endif // TESTMODE