FreeCalypso > hg > tcs211-l1-reconst
annotate chipsetsw/layer1/p_cfile/l1p_func.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 | 6d27bbc94e3c |
children |
rev | line source |
---|---|
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
1 /************* Revision Controle System Header ************* |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
2 * GSM Layer 1 software |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
3 * L1P_FUNC.C |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
4 * |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
5 * Filename l1p_func.c |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
6 * Copyright 2003 (C) Texas Instruments |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
7 * |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
8 ************* Revision Controle System Header *************/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
9 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
10 #define L1P_FUNC_C |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
11 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
12 #include "l1_macro.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
13 #include "l1_confg.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
14 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
15 #if L1_GPRS |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
16 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
17 #if (CODE_VERSION == SIMULATION) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
18 #include "stddef.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
19 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
20 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
21 #include "l1_types.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
22 #include "sys_types.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
23 #include "l1_const.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
24 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
25 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
26 #if TESTMODE |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
27 #include "l1tm_defty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
28 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
29 #if (AUDIO_TASK == 1) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
30 #include "l1audio_const.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
31 #include "l1audio_cust.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
32 #include "l1audio_defty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
33 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
34 #if (L1_GTT == 1) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
35 #include "l1gtt_const.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
36 #include "l1gtt_defty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
37 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
38 #if (L1_MP3 == 1) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
39 #include "l1mp3_defty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
40 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
41 #if (L1_MIDI == 1) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
42 #include "l1midi_defty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
43 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
44 #include "l1_defty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
45 #include "l1_varex.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
46 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
47 #include "cust_os.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
48 #include "l1_msgty.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
49 #include "l1_time.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
50 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
51 #include "l1p_cons.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
52 #include "l1p_msgt.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
53 #include "l1p_deft.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
54 #include "l1p_vare.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
55 #include "l1p_sign.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
56 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
57 #if(RF_FAM == 61) |
323
fcbeafbb0106
l1p_func.c: passes compilation
Mychaela Falconia <falcon@freecalypso.org>
parents:
322
diff
changeset
|
58 #include "l1_rf61.h" |
fcbeafbb0106
l1p_func.c: passes compilation
Mychaela Falconia <falcon@freecalypso.org>
parents:
322
diff
changeset
|
59 #include "tpudrv61.h" |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
60 #endif |
323
fcbeafbb0106
l1p_func.c: passes compilation
Mychaela Falconia <falcon@freecalypso.org>
parents:
322
diff
changeset
|
61 |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
62 #if (CODE_VERSION == SIMULATION) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
63 #include "l1_rf2.h" |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
64 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
65 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
66 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
67 /* Prototypes of external functions used in this file. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
68 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
69 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
70 void l1pddsp_meas_ctrl (UWORD8 nbmeas, UWORD8 pm_pos); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
71 void l1dtpu_meas (UWORD16 radio_freq,WORD8 agc,UWORD8 lna_off, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
72 UWORD16 win_id,UWORD16 tpu_synchro, UWORD8 adc_active |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
73 #if (RF_FAM == 61) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
74 ,UWORD8 afc_mode |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
75 ,UWORD8 if_ctl |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
76 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
77 ); |
327
294adc9e1d3c
l1p_func.c: Cust_get_agc_from_IL() argument count fix
Mychaela Falconia <falcon@freecalypso.org>
parents:
326
diff
changeset
|
78 WORD8 Cust_get_agc_from_IL (UWORD16 radio_freq, UWORD16 agc_index, UWORD8 table_id); |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
79 void l1ps_macs_init (void); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
80 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
81 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
82 /* initialize_l1pvar() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
83 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
84 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
85 /* ------------- */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
86 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
87 /* ------------- */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
88 /* Description : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
89 /* ------------- */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
90 /* This routine is used to initialize the l1pa, l1ps and */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
91 /* l1pa_l1ps_com global structures. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
92 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
93 void initialize_l1pvar(void) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
94 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
95 UWORD8 i; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
96 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
97 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
98 // Reset "l1ps" structure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
99 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
100 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
101 l1ps.last_PR_good = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
102 l1ps.ILmin_beacon = 255; |
324
ebf40b5f448c
l1p_func.c: initialize_l1pvar() reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
103 #if 0 /* FreeCalypso TCS211 reconstruction */ |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
104 l1ps.read_param.assignment_id = 0xFF; /* do not return non initialized value to RLC */ |
324
ebf40b5f448c
l1p_func.c: initialize_l1pvar() reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
323
diff
changeset
|
105 #endif |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
106 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
107 for(i = 0; i < 8; i++) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
108 l1ps.ILmin_others[i] = l1_config.params.il_min; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
109 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
110 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
111 // Reset "l1pa" structure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
112 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
113 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
114 for(i=0;i<NBR_L1PA_PROCESSES;i++) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
115 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
116 l1pa.state[i] = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
117 l1pa.l1pa_en_meas[i] = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
118 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
119 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
120 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
121 // Reset "l1pa_l1ps_com" structure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
122 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
123 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
124 // Initialize PC_MEAS_CHAN flag |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
125 l1ps.pc_meas_chan_ctrl = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
126 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
127 // Initialize active list used in Neighbour Measurement Transfer Process |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
128 l1pa_l1ps_com.cres_freq_list.alist = &(l1pa_l1ps_com.cres_freq_list.list[0]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
129 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
130 // Initialize parameters used in Neighbour Measurement Transfer Process |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
131 l1pa_l1ps_com.cres_freq_list.alist->nb_carrier = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
132 l1pa_l1ps_com.tcr_freq_list.new_list_present = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
133 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
134 l1pa_l1ps_com.transfer.semaphore = TRUE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
135 l1pa_l1ps_com.transfer.aset = &(l1pa_l1ps_com.transfer.set[0]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
136 l1pa_l1ps_com.transfer.fset[0] = &(l1pa_l1ps_com.transfer.set[1]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
137 l1pa_l1ps_com.transfer.fset[1] = &(l1pa_l1ps_com.transfer.set[2]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
138 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
139 // Initialize Downlink Power Control Struture. Set CRC to BAD, bcch_level |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
140 // and burst_level[] to INVALID. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
141 l1pa_l1ps_com.transfer.dl_pwr_ctrl.crc_error = TRUE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
142 l1pa_l1ps_com.transfer.dl_pwr_ctrl.bcch_level = (WORD8)0x80;//omaps00090550 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
143 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
144 for(i = 0; i < 4; i++) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
145 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
146 l1pa_l1ps_com.transfer.dl_pwr_ctrl.burst_level[i] = (WORD8)0x80;//omaps00090550 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
147 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
148 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
149 l1pa_l1ps_com.transfer.set[0].ul_tbf_alloc = &(l1pa_l1ps_com.transfer.ul_tbf_alloc[0]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
150 l1pa_l1ps_com.transfer.set[1].ul_tbf_alloc = &(l1pa_l1ps_com.transfer.ul_tbf_alloc[1]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
151 l1pa_l1ps_com.transfer.set[2].ul_tbf_alloc = &(l1pa_l1ps_com.transfer.ul_tbf_alloc[2]); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
152 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
153 for(i=0;i<3;i++) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
154 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
155 l1pa_l1ps_com.transfer.set[i].SignalCode = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
156 l1pa_l1ps_com.transfer.set[i].dl_tbf_synchro_timeslot = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
157 l1pa_l1ps_com.transfer.set[i].dl_tbf_synchro_timeslot = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
158 l1pa_l1ps_com.transfer.set[i].transfer_synchro_timeslot = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
159 l1pa_l1ps_com.transfer.set[i].allocated_tbf = NO_TBF; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
160 l1pa_l1ps_com.transfer.set[i].assignment_command = NO_TBF; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
161 l1pa_l1ps_com.transfer.set[i].multislot_class = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
162 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
163 l1pa_l1ps_com.transfer.set[i].packet_ta.ta = 255; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
164 l1pa_l1ps_com.transfer.set[i].packet_ta.ta_index = 255; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
165 l1pa_l1ps_com.transfer.set[i].packet_ta.ta_tn = 255; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
166 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
167 l1pa_l1ps_com.transfer.set[i].tsc = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
168 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
169 l1pa_l1ps_com.transfer.set[i].freq_param.chan_sel.h = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
170 l1pa_l1ps_com.transfer.set[i].freq_param.chan_sel. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
171 rf_channel.single_rf.radio_freq = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
172 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
173 l1pa_l1ps_com.transfer.set[i].tbf_sti.present = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
174 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
175 l1pa_l1ps_com.transfer.set[i].mac_mode = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
176 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
177 l1pa_l1ps_com.transfer.set[i].ul_tbf_alloc->tfi = 255; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
178 l1pa_l1ps_com.transfer.set[i].dl_tbf_alloc.tfi = 255; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
179 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
180 l1pa_l1ps_com.transfer.set[i].dl_pwr_ctl.p0 = 255; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
181 l1pa_l1ps_com.transfer.set[i].dl_pwr_ctl.bts_pwr_ctl_mode = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
182 l1pa_l1ps_com.transfer.set[i].dl_pwr_ctl.pr_mode = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
183 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
184 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
185 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
186 // Reset "l1pa_macs_com" structure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
187 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
188 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
189 l1ps_macs_com.fix_alloc_exhaust_flag = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
190 l1ps_macs_com.rlc_downlink_call = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
191 #if FF_L1_IT_DSP_USF |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
192 l1ps_macs_com.usf_status = USF_AVAILABLE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
193 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
194 #if L1_EDA |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
195 l1ps_macs_com.fb_sb_task_enabled = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
196 l1ps_macs_com.fb_sb_task_detect = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
197 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
198 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
199 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
200 // Reset MAC-S static structure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
201 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
202 l1ps_macs_init(); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
203 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
204 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
205 // Reset packet transfer mode commands. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
206 //++++++++++++++++++++++++++++++++++++++++++ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
207 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
208 l1pa_l1ps_com.transfer.ptcch.ta_update_cmd = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
209 l1pa_l1ps_com.transfer.psi_param.psi_param_update_cmd = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
210 l1pa_l1ps_com.transfer.tbf_release_param.tbf_release_cmd = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
211 l1pa_l1ps_com.transfer.pdch_release_param.pdch_release_cmd = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
212 l1pa_l1ps_com.transfer.repeat_alloc.repeat_allocation = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
213 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
214 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
215 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
216 /* l1ps_reset_db_mcu_to_dsp() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
217 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
218 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
219 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
220 /* Functionality : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
221 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
222 void l1ps_reset_db_mcu_to_dsp(T_DB_MCU_TO_DSP_GPRS *page_ptr) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
223 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
224 API i; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
225 API size = sizeof(T_DB_MCU_TO_DSP_GPRS) / sizeof(API); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
226 API *ptr = (API *)page_ptr; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
227 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
228 // Clear all locations. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
229 for(i=0; i<size; i++) *ptr++ = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
230 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
231 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
232 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
233 /* l1ps_reset_db_dsp_to_mcu() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
234 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
235 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
236 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
237 /* Functionality : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
238 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
239 void l1ps_reset_db_dsp_to_mcu(T_DB_DSP_TO_MCU *page_ptr) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
240 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
241 API i; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
242 API size = sizeof(T_DB_DSP_TO_MCU_GPRS) / sizeof(API); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
243 API *ptr = (API *)page_ptr; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
244 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
245 // Clear all locations. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
246 for(i=0; i<size; i++) *ptr++ = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
247 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
248 // Set crc result as "SB not found". |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
249 page_ptr->a_sch[0] = (1<<B_SCH_CRC); // B_SCH_CRC =1, BLUD =0 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
250 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
251 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
252 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
253 /* l1ps_swap_iq_dl() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
254 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
255 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
256 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
257 /* Functionality : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
258 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
259 BOOL l1ps_swap_iq_dl(UWORD16 radio_freq) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
260 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
261 UWORD8 swap_iq; |
325
b410d2a64a59
l1p_func.c: l1ps_swap_iq_dl() reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
324
diff
changeset
|
262 BOOL swap_flag; |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
263 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
264 #if (L1_FF_MULTIBAND == 0) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
265 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
266 if(((l1_config.std.id == DUAL) || (l1_config.std.id == DUALEXT) || (l1_config.std.id == DUAL_US)) && |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
267 (radio_freq >= l1_config.std.first_radio_freq_band2)) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
268 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
269 swap_iq = l1_config.std.swap_iq_band2; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
270 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
271 else |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
272 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
273 swap_iq = l1_config.std.swap_iq_band1; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
274 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
275 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
276 #else // L1_FF_MULTIBAND = 1 below |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
277 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
278 UWORD16 physical_band_id; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
279 physical_band_id = |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
280 l1_multiband_radio_freq_convert_into_physical_band_id(radio_freq); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
281 swap_iq = rf_band[physical_band_id].swap_iq; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
282 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
283 #endif // #if (L1_FF_MULTIBAND == 0) else |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
284 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
285 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
286 switch(swap_iq) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
287 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
288 case 0: /* No swap at all. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
289 case 2: /* DL, no swap. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
290 swap_flag = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
291 break; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
292 case 1: /* DL I/Q swap. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
293 case 3: /* DL I/Q swap. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
294 swap_flag = TRUE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
295 break; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
296 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
297 return(swap_flag); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
298 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
299 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
300 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
301 /* l1ps_swap_iq_ul() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
302 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
303 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
304 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
305 /* Functionality : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
306 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
307 BOOL l1ps_swap_iq_ul(UWORD16 radio_freq) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
308 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
309 UWORD8 swap_iq; |
326
84ef3a68e832
l1p_func.c: l1ps_swap_iq_ul() reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
325
diff
changeset
|
310 BOOL swap_flag; |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
311 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
312 #if (L1_FF_MULTIBAND == 0) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
313 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
314 if(((l1_config.std.id == DUAL) || (l1_config.std.id == DUALEXT) || (l1_config.std.id == DUAL_US)) && |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
315 (radio_freq >= l1_config.std.first_radio_freq_band2)) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
316 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
317 swap_iq = l1_config.std.swap_iq_band2; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
318 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
319 else |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
320 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
321 swap_iq = l1_config.std.swap_iq_band1; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
322 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
323 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
324 #else // L1_FF_MULTIBAND = 1 below |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
325 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
326 UWORD16 physical_band_id = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
327 physical_band_id = |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
328 l1_multiband_radio_freq_convert_into_physical_band_id(radio_freq); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
329 swap_iq = rf_band[physical_band_id].swap_iq; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
330 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
331 #endif // #if (L1_FF_MULTIBAND == 0) else |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
332 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
333 switch(swap_iq) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
334 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
335 case 0: /* No swap at all. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
336 case 1: /* UL, no swap. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
337 swap_flag = FALSE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
338 break; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
339 case 2: /* UL I/Q swap. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
340 case 3: /* UL I/Q swap. */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
341 swap_flag = TRUE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
342 break; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
343 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
344 return(swap_flag); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
345 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
346 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
347 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
348 /* l1ps_tcr_ctrl() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
349 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
350 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
351 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
352 /* Functionality : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
353 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
354 void l1ps_tcr_ctrl(UWORD8 pm_position) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
355 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
356 UWORD16 radio_freq_ctrl; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
357 UWORD8 lna_off; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
358 WORD8 agc; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
359 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
360 UWORD8 mode = PACKET_TRANSFER; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
361 UWORD8 input_level; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
362 #if (RF_FAM == 61) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
363 UWORD16 dco_algo_ctl_pw = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
364 UWORD8 if_ctl = 0; |
327
294adc9e1d3c
l1p_func.c: Cust_get_agc_from_IL() argument count fix
Mychaela Falconia <falcon@freecalypso.org>
parents:
326
diff
changeset
|
365 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
366 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
367 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
368 radio_freq_ctrl = l1pa_l1ps_com.cres_freq_list.alist->freq_list[l1pa_l1ps_com.tcr_freq_list.tcr_next_to_ctrl]; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
369 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
370 // Get AGC according to the last known IL. |
327
294adc9e1d3c
l1p_func.c: Cust_get_agc_from_IL() argument count fix
Mychaela Falconia <falcon@freecalypso.org>
parents:
326
diff
changeset
|
371 |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
372 input_level = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; |
328
2604e9569e31
l1p_func.c: l1ps_tcr_ctrl() reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
327
diff
changeset
|
373 agc = Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID); |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
374 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
375 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
376 #if (RF_FAM == 61) // Locosto DCO |
327
294adc9e1d3c
l1p_func.c: Cust_get_agc_from_IL() argument count fix
Mychaela Falconia <falcon@freecalypso.org>
parents:
326
diff
changeset
|
377 #if (PWMEAS_IF_MODE_FORCE == 0) |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
378 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_VALID , |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
379 input_level, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
380 l1pa_l1ps_com.p_idle_param.radio_freq, if_threshold); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
381 #else |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
382 if_ctl = IF_120KHZ_DSP; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
383 dco_algo_ctl_pw = DCO_IF_0KHZ; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
384 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
385 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
386 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
387 l1ddsp_load_dco_ctl_algo_pw(dco_algo_ctl_pw); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
388 l1s.tcr_prog_done=1; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
389 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
390 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
391 // Memorize the IL and LNA used for AGC setting. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
392 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
393 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
394 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
395 // tpu pgm: 1 measurement only. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
396 l1dtpu_meas(radio_freq_ctrl, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
397 agc, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
398 lna_off, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
399 l1s.tpu_win, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
400 l1s.tpu_offset,INACTIVE |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
401 #if(RF_FAM == 61) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
402 ,L1_AFC_SCRIPT_MODE |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
403 ,if_ctl |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
404 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
405 ); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
406 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
407 // Increment tpu window identifier. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
408 l1s.tpu_win += (l1_config.params.rx_synth_load_split + PWR_LOAD); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
409 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
410 // increment carrier counter for next measurement... |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
411 if(++l1pa_l1ps_com.tcr_freq_list.tcr_next_to_ctrl >= l1pa_l1ps_com.cres_freq_list.alist->nb_carrier) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
412 l1pa_l1ps_com.tcr_freq_list.tcr_next_to_ctrl = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
413 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
414 // Program DSP, in order to performed 1 measure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
415 // Second argument specifies PW position. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
416 l1pddsp_meas_ctrl(1, pm_position); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
417 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
418 #if (TRACE_TYPE!=0) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
419 //trace_fct(CST_CTRL_TRANSFER_MEAS, radio_freq_ctrl); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
420 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
421 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
422 // Update d_debug timer |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
423 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
424 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
425 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
426 // Flag measurement control. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
427 // ************************** |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
428 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
429 // Set flag "ms_ctrl" to nb_meas_to_perform. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
430 // It will be used as 2 tdma delayed to trigger Read phase. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
431 l1pa_l1ps_com.tcr_freq_list.ms_ctrl = 1; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
432 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
433 // Flag DSP and TPU programmation. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
434 // ******************************** |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
435 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
436 // Set "CTRL_MS" flag in the controle flag register. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
437 l1s.tpu_ctrl_reg |= CTRL_MS; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
438 l1s.dsp_ctrl_reg |= CTRL_MS; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
439 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
440 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
441 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
442 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
443 /* l1ps_bcch_meas_ctrl() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
444 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
445 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
446 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
447 /* Functionality : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
448 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
449 void l1ps_bcch_meas_ctrl(UWORD8 ts) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
450 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
451 UWORD8 lna_off; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
452 WORD8 agc; |
327
294adc9e1d3c
l1p_func.c: Cust_get_agc_from_IL() argument count fix
Mychaela Falconia <falcon@freecalypso.org>
parents:
326
diff
changeset
|
453 |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
454 UWORD8 mode = PACKET_TRANSFER; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
455 UWORD8 input_level; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
456 #if (RF_FAM == 61) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
457 UWORD16 dco_algo_ctl_pw =0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
458 UWORD8 if_ctl=0; |
327
294adc9e1d3c
l1p_func.c: Cust_get_agc_from_IL() argument count fix
Mychaela Falconia <falcon@freecalypso.org>
parents:
326
diff
changeset
|
459 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
460 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
461 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
462 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
463 if ((l1s.dsp_ctrl_reg & CTRL_ABORT) == 0) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
464 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
465 #define radio_freq_ctrl l1a_l1s_com.Scell_info.radio_freq |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
466 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
467 // Get AGC according to the last known IL. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
468 input_level = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; |
329
6d27bbc94e3c
l1p_func.c: reconstruction complete, perfect match to original TCS211 object
Mychaela Falconia <falcon@freecalypso.org>
parents:
328
diff
changeset
|
469 agc = Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID); |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
470 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
471 // Memorize the IL and LNA used for AGC setting. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
472 // Note: the same structure as for TCR meas is used for PC_MEAS_CHAN measurements |
329
6d27bbc94e3c
l1p_func.c: reconstruction complete, perfect match to original TCS211 object
Mychaela Falconia <falcon@freecalypso.org>
parents:
328
diff
changeset
|
473 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
474 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
475 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
476 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
477 #if (RF_FAM == 61) // Locosto DCO |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
478 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_VALID, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
479 input_level, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
480 radio_freq_ctrl,if_threshold); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
481 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
482 l1ddsp_load_dco_ctl_algo_pw(dco_algo_ctl_pw); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
483 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
484 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
485 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
486 // tpu pgm: 1 measurement only. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
487 l1dtpu_meas(radio_freq_ctrl, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
488 agc, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
489 lna_off, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
490 l1s.tpu_win, |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
491 l1s.tpu_offset,INACTIVE |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
492 #if(RF_FAM == 61) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
493 ,L1_AFC_SCRIPT_MODE |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
494 ,if_ctl |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
495 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
496 ); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
497 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
498 // Increment tpu window identifier. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
499 l1s.tpu_win += (l1_config.params.rx_synth_load_split + PWR_LOAD); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
500 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
501 // Program DSP, in order to performed 1 measure. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
502 // Second argument specifies PW position. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
503 l1pddsp_meas_ctrl(1, (UWORD8)ts); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
504 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
505 #if (TRACE_TYPE!=0) && (TRACE_TYPE!=5) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
506 //trace_fct(CST_CTRL_SCELL_TRANSFER_MEAS, radio_freq_ctrl); |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
507 #endif |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
508 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
509 // Update d_debug timer |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
510 l1s_dsp_com.dsp_db_w_ptr->d_debug = (l1s.debug_time + 2) ; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
511 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
512 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
513 // Flag measurement control. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
514 // ************************** |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
515 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
516 l1ps.pc_meas_chan_ctrl = TRUE; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
517 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
518 // Flag DSP and TPU programmation. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
519 // ******************************** |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
520 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
521 // Set "CTRL_MS" flag in the controle flag register. |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
522 l1s.tpu_ctrl_reg |= CTRL_MS; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
523 l1s.dsp_ctrl_reg |= CTRL_MS; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
524 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
525 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
526 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
527 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
528 /* l1ps_update_read_set_parameters() */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
529 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
530 /* Parameters : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
531 /* Return : */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
532 /* Functionality : Updating of the "Read_param" structure*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
533 /* usefull in case the aset structure has been updated */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
534 /* before the last read of the current block */ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
535 /*-------------------------------------------------------*/ |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
536 void l1ps_update_read_set_parameters(void) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
537 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
538 #define READ_PARAM l1ps.read_param |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
539 #define ASET l1pa_l1ps_com.transfer.aset |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
540 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
541 // Copy of the "aset" parameters in the "read_param" structure |
323
fcbeafbb0106
l1p_func.c: passes compilation
Mychaela Falconia <falcon@freecalypso.org>
parents:
322
diff
changeset
|
542 #if 0 /* FreeCalypso TCS211 reconstruction */ |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
543 READ_PARAM.dl_tn = l1a_l1s_com.dl_tn; |
323
fcbeafbb0106
l1p_func.c: passes compilation
Mychaela Falconia <falcon@freecalypso.org>
parents:
322
diff
changeset
|
544 #endif |
322
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
545 READ_PARAM.new_set = 0; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
546 READ_PARAM.assignment_id = ASET->assignment_id; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
547 READ_PARAM.allocated_tbf = ASET->allocated_tbf; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
548 READ_PARAM.dl_tfi = ASET->dl_tbf_alloc.tfi; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
549 READ_PARAM.ul_tfi = ASET->ul_tbf_alloc->tfi; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
550 READ_PARAM.dl_pwr_ctl = ASET->dl_pwr_ctl; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
551 READ_PARAM.pc_meas_chan = ASET->pc_meas_chan; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
552 |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
553 // We need to know on which frequency band we work for LNA state processing |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
554 if (!l1pa_l1ps_com.transfer.aset->freq_param.chan_sel.h) |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
555 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
556 // Single frequency |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
557 READ_PARAM.radio_freq_for_lna = l1pa_l1ps_com.transfer.aset->freq_param.chan_sel.rf_channel.single_rf.radio_freq; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
558 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
559 else |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
560 { |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
561 // Frequency hopping: all frequencies of the frequency list are on the same band |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
562 // We take the first frequency of the list |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
563 READ_PARAM.radio_freq_for_lna = l1pa_l1ps_com.transfer.aset->freq_param.freq_list.rf_chan_no.A[0]; |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
564 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
565 } |
b21e34ef9a80
l1p_func.c: initial import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
15
diff
changeset
|
566 #endif |