annotate src/cs/layer1/p_cfile/l1p_driv.c @ 624:012028896cfb

FFS dev.c, Leonardo target: Fujitsu MB84VF5F5F4J2 #if 0'ed out The FFS code we got from TI/Openmoko had a stanza for "Fujitsu MB84VF5F5F4J2 stacked device", using a fake device ID code that would need to be patched manually into cfgffs.c (suppressing and overriding autodetection) and using an FFS base address in the nCS2 bank, indicating that this FFS config was probably meant for the MCP version of Leonardo which allows for 16 MiB flash with a second bank on nCS2. We previously had this FFS config stanza conditionalized under CONFIG_TARGET_LEONARDO because the base address contained therein is invalid for other targets, but now that we actually have a Leonardo build target in FC Magnetite, I realize that the better approach is to #if 0 out this stanza altogether: it is already non-functional because it uses a fake device ID code, thus it is does not add support for more Leonardo board variants, instead it is just noise.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 22 Dec 2019 21:24:29 +0000
parents 0740b5ff15f6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
302
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /************* Revision Controle System Header *************
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * GSM Layer 1 software
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * L1P_DRIVE.C
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 *
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * Filename l1p_driv.c
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * Copyright 2003 (C) Texas Instruments
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 *
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 ************* Revision Controle System Header *************/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #define L1P_DRIVE_C
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 #include "l1_macro.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 #include "l1_confg.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #if L1_GPRS
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #if (CODE_VERSION == SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 #include <string.h>
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 #include "l1_types.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 #include "sys_types.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #include "l1_const.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 #include "l1_time.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #if TESTMODE
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #include "l1tm_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 #if (AUDIO_TASK == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include "l1audio_const.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #include "l1audio_cust.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #include "l1audio_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #if (L1_GTT == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include "l1gtt_const.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "l1gtt_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #if (L1_MP3 == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #include "l1mp3_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #if (L1_MIDI == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #include "l1midi_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "l1_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "l1_varex.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "cust_os.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #include "l1_msgty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #if L2_L3_SIMUL
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #include "hw_debug.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #include "l1p_cons.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #include "l1p_msgt.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #include "l1p_deft.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #include "l1p_vare.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #include "l1p_tabs.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #include "sim_cons.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #include "sim_def.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 extern T_hw FAR hw;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #include "l1_proto.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #include <string.h>
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #include "l1_types.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #include "sys_types.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #include "l1_const.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 #include "l1_time.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 #if TESTMODE
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #include "l1tm_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 #if (AUDIO_TASK == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 #include "l1audio_const.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #include "l1audio_cust.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 #include "l1audio_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 #if (L1_GTT == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #include "l1gtt_const.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 #include "l1gtt_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #if (L1_MP3 == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #include "l1mp3_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 #if (L1_MIDI == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 #include "l1midi_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 #include "l1_defty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #include "l1_varex.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #include "cust_os.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 #include "l1_msgty.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 #if L2_L3_SIMUL
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 #include "hw_debug.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 #include "l1p_cons.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 #include "l1p_msgt.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 #include "l1p_deft.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 #include "l1p_vare.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 #include "l1p_tabs.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 #include "l1_proto.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 #include "tpudrv.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 #if(RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 #include "l1_rf61.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 #include "tpudrv61.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #include "l1_ctl.h"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 /* Prototypes of external functions used in this file. */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 void l1dmacro_synchro (UWORD32 when, UWORD32 value);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 void l1dmacro_offset (UWORD32 offset_value, WORD32 relative_time);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 void l1dmacro_afc (UWORD16 afc_value, UWORD8 win_id);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (RF_FAM == 61) )
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 UWORD16 Cust_get_pwr_data(UWORD8 txpwr, UWORD16 radio_freq
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 #if(REL99 && FF_PRF)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 ,UWORD8 number_uplink_timeslot
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 void Cust_get_ramp_tab(API *a_ramp, UWORD8 txpwr_ramp_up, UWORD8 txpwr_ramp_down, UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 BOOL l1ps_swap_iq_ul (UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 BOOL l1ps_swap_iq_dl (UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 #if (L1_MADC_ON == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 void l1pdmacro_rx_up (UWORD16 radio_freq,UWORD8 adc_active, UWORD8 csf_filter_choice
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #if (NEW_SNR_THRESHOLD == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 ,UWORD8 saic_flag
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #endif /* NEW_SNR_THRESHOLD == 1*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 #else /* RF_FAM == 61*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 void l1pdmacro_rx_up (UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 void l1pdmacro_rx_down (UWORD16 radio_freq, UWORD8 num_rx, BOOL rx_done_flag);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 void l1pdmacro_tx_up (UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 void l1pdmacro_tx_down (UWORD16 radio_freq, WORD16 time, BOOL tx_flag, UWORD8 timing_advance,UWORD8 adc_active);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 void l1pdmacro_tx_synth(UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 void l1pdmacro_anchor (WORD16 time);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 void l1dmacro_rx_synth(UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 void l1dmacro_agc(UWORD16 radio_freq, WORD8 agc_value, UWORD8 lna_off
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 ,UWORD8 if_ctl
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 #if (CODE_VERSION == SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 void l1dmacro_rx_ms (UWORD16 arfcn, BOOL rxnb_select);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 #if (L1_MADC_ON == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 void l1dmacro_rx_ms (UWORD16 arfcn,UWORD8 adc_active);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 void l1dmacro_rx_ms (UWORD16 arfcn);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 void l1pdmacro_it_dsp_gen(WORD16 time);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 /* Prototypes of functions defined in this file. */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 // TPU Drivers...
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 // DSP Drivers...
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 void l1pddsp_synchro (UWORD8 switch_mode, UWORD8 camp_timeslot);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 void l1pddsp_idle_prach_data (BOOL polling, UWORD8 cs_type, UWORD16 channel_request_data,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 UWORD8 bsic, UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 void l1pddsp_idle_prach_power (UWORD8 txpwr, UWORD16 radio_freq, UWORD8 ts);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 void l1pddsp_single_tx_block (UWORD8 burst_nb, UWORD8 *data, UWORD8 tsc,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 UWORD16 radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 #if FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 void l1pddsp_idle_rx_nb (UWORD8 burst_nb, UWORD8 tsq, UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 UWORD8 timeslot_no, BOOL ptcch_dl, BOOL usf_interrupt);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 void l1pddsp_idle_rx_nb (UWORD8 burst_nb, UWORD8 tsq, UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 UWORD8 timeslot_no, BOOL ptcch_dl);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 void l1pddsp_transfer_mslot_ctrl (UWORD8 burst_nb, UWORD8 dl_bitmap, UWORD8 ul_bitmap,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 UWORD8 *usf_table, UWORD8 mac_mode, UWORD8 *ul_buffer_index,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 UWORD8 tsc, UWORD16 radio_freq, UWORD8 synchro_timeslot,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 #if FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 UWORD8 dsp_usf_interrupt
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 UWORD8 usf_vote_enable
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 void l1pddsp_transfer_mslot_power (UWORD8 *txpwr, UWORD16 radio_freq, UWORD8 ul_bitmap);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 void l1pddsp_ul_ptcch_data (UWORD8 cs_type, UWORD16 channel_request_data, UWORD8 bsic,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 UWORD16 radio_freq, UWORD8 timeslot_no);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 void l1pddsp_interf_meas_ctrl (UWORD8 nb_meas_req);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 void l1pddsp_transfer_meas_ctrl (UWORD8 meas_position);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 /* l1pd_afc() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 void l1pd_afc(void)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 l1ddsp_load_afc(l1s.afc);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 l1dtpu_load_afc(l1s.afc);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 /* l1pdtpu_interf_meas() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 UWORD8 l1pdtpu_interf_meas(UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 WORD8 agc,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 UWORD8 lna_off,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 UWORD8 meas_bitmap,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 UWORD32 offset_serv,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 UWORD16 win_id,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 UWORD8 synchro_ts
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 ,UWORD8 if_ctl
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 )
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 UWORD8 bit_mask = 0x80;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 UWORD8 ts;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 BOOL rf_programmed = FALSE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 UWORD8 count = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 if(!win_id)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 // Nothing programmed yet, we must avoid Mirror effect in Ctrl phase.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 l1pdmacro_anchor(l1_config.params.rx_change_offset_time);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 for (ts=0; ts<8; ts++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 // the bitmap corresponds to that of the idle frame of the network!!!
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 #if ((CHIPSET==3)||(CHIPSET == 4))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 // limitation of 5 measurements for SAMSON (TPU RAM size limitation)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 if((meas_bitmap & bit_mask)&&(count <= 4))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 if(meas_bitmap & bit_mask)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 UWORD16 local_win_id;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 UWORD16 offset;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 WORD16 when;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 UWORD16 offset_chg;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 if((ts>synchro_ts) && (count==0))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 // The 1st Work does not contain any Interf meas.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 // We must ovoid a possible Mirror effect for the rest of TS.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 l1pdmacro_anchor(l1_config.params.rx_change_offset_time);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 // Increment nbr of meas. programmed.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 count++;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 local_win_id = (8 - synchro_ts + ts) * BP_SPLIT;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 if(local_win_id >= (BP_SPLIT * 8)) local_win_id -= BP_SPLIT * 8; // Modulo.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 // Compute offset
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 offset_chg = ((local_win_id * BP_DURATION) >> BP_SPLIT_PW2);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 offset = offset_serv + offset_chg;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 if(offset >= TPU_CLOCK_RANGE) offset -= TPU_CLOCK_RANGE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 if(!rf_programmed)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 // Compute offset change timing
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 when = offset_chg +
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 PROVISION_TIME -
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 l1_config.params.rx_synth_setup_time -
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 EPSILON_OFFS;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 if(when < 0) when += TPU_CLOCK_RANGE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 // Program TPU scenario
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 l1dmacro_offset (offset, when); // change TPU offset according to win_id
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 l1dmacro_rx_synth (radio_freq); // pgme SYNTH.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 #if (RF_FAM !=61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 l1dmacro_agc (radio_freq, agc,lna_off); // pgme AGC.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 l1dmacro_agc (radio_freq, agc,lna_off, if_ctl); // pgme AGC.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 rf_programmed = TRUE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 // Compute offset change timing
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 when = offset_chg - BP_DURATION + PROVISION_TIME + PW_ACQUIS_DURATION + 20;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 if(when < 0) when += TPU_CLOCK_RANGE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 // Program TPU scenario
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 l1dmacro_offset (offset, when); // change TPU offset according to win_id
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 #if (CODE_VERSION == SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 l1dmacro_rx_ms (radio_freq, 1); // pgm PWR acquisition.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 #if (L1_MADC_ON == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 l1dmacro_rx_ms (radio_freq,INACTIVE); // pgm PWR acquisition.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 l1dmacro_rx_ms (radio_freq); // pgm PWR acquisition.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 l1dmacro_offset (offset_serv, IMM); // restore offset
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 bit_mask >>= 1;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 } // for(ts...
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 return(count);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 /* l1dtpu_serv_rx() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 /* rx_id: range 0-7, first slot of RX group */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 /* rx_group_id: used in case |RX| |RX| */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 /* */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 void l1pdtpu_serv_rx_nb(UWORD16 radio_freq, UWORD8 agc, UWORD8 lna_off,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 UWORD8 rx_id, UWORD32 offset_serv, UWORD8 num_rx,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 UWORD8 rx_group_id, BOOL rx_done_flag,UWORD8 adc_active
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 ,UWORD8 csf_filter_choice
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 ,UWORD8 if_ctl
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 #if (NEW_SNR_THRESHOLD == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 ,UWORD8 saic_flag
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 #endif /* NEW_SNR_THRESHOLD*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 )
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 UWORD16 offset;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 #if (CODE_VERSION == SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 UWORD32 tpu_w_page;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 if (hw.tpu_r_page==0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 tpu_w_page=1;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 tpu_w_page=0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 hw.rx_id[tpu_w_page][rx_group_id-1]=rx_id;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 hw.num_rx[tpu_w_page][rx_group_id-1]=num_rx;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 hw.rx_group_id[tpu_w_page]=rx_group_id;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 offset = offset_serv + (rx_id * BP_DURATION);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 if(offset >= TPU_CLOCK_RANGE) offset -= TPU_CLOCK_RANGE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 if (rx_group_id == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 // Time tracking.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 l1dmacro_synchro (l1_config.params.rx_change_synchro_time, offset_serv); // Adjust serving OFFSET.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 #if L2_L3_SIMUL
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 #if (DEBUG_TRACE == BUFFER_TRACE_OFFSET)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 buffer_trace(3, 0x43, offset_serv, l1s.actual_time.fn, 0);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 // Change offset to align on RX.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 l1dmacro_offset(offset, IMM);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 // Program Synth.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 // Program ADC measurement
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 // Program AGC.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 l1dmacro_rx_synth(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 if(adc_active == ACTIVE)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 l1dmacro_adc_read_rx();
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 l1dmacro_agc (radio_freq, agc, lna_off
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 ,if_ctl
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 // Change offset to align on RX.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 l1dmacro_offset(offset, IMM); // Change offset to align on RX.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 l1pdmacro_rx_up (radio_freq
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 ,adc_active
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 ,csf_filter_choice
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 #if (NEW_SNR_THRESHOLD == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 ,saic_flag
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 #endif /* NEW_SNR_THRESHOLD*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 ); // RX window opened.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 l1pdmacro_rx_down(radio_freq, num_rx, rx_done_flag); // RX window closed.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 // Restore offset to synchro value.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 l1dmacro_offset (offset_serv, IMM);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 /* l1dtpu_serv_tx() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 #ifndef ABB_RAMP_UP_TIME //Flexi ABB Delays defines it in tpudrvXX.h
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 #define ABB_RAMP_UP_TIME 32 // maximum time for ramp up
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 #ifndef ABB_RAMP_DELAY//Flexi ABB Delays defines it in tpudrvXX.h
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 #define ABB_RAMP_DELAY 6 // minimum ramp delay APCDEL
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 #ifndef ABB_BULON_HOLD_TIME //Flexi ABB Delays defines it in tpudrvXX.h
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 #define ABB_BULON_HOLD_TIME 32 // min. hold time for BULON after BULENA down
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 void l1pdtpu_serv_tx(UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 UWORD8 timing_advance,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 UWORD32 offset_serv,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 UWORD8 tx_id,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 UWORD8 num_tx,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 UWORD8 tx_group_id,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 UWORD8 switch_flag,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 BOOL burst_type,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 BOOL rx_flag,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 UWORD8 adc_active)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 WORD16 time;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 UWORD32 offset_tx;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 UWORD32 timing_advance_in_qbit = (UWORD32)timing_advance << 2;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (RF_FAM == 61))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 UWORD16 apcdel1_data, apcdel1_data_up;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 UWORD8 i;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 static UWORD8 static_switch_flag = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 #if (CODE_VERSION == SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 UWORD32 tpu_w_page;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 if (hw.tpu_r_page==0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 tpu_w_page=1;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 tpu_w_page=0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 hw.tx_id[tpu_w_page][tx_group_id-1]=tx_id;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 hw.num_tx[tpu_w_page][tx_group_id-1]=num_tx;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 hw.tx_group_id[tpu_w_page]=tx_group_id;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 // Reset timing advance if TA_ALGO not enabled.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 #if !TA_ALGO
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 timing_advance_in_qbit = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 // In case another group of TX bursts is called, the previous slot was a hole
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 // An IT has to be generated to the DSP so that ramps and power level are reloaded
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 // This does not apply to combinations of PRACH and TX NB
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 if ((tx_group_id > 1) && (!static_switch_flag))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 // exact timing for generation of IT during hole not required but
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 // time > time of previous ramp down (BULENA -> BULON down = 32 qb) + margin (10 qb)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 #if (RF_FAM != 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 time = TX_TABLE[tx_id-1] + PROVISION_TIME + ABB_BULON_HOLD_TIME + 10
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 - l1_config.params.prg_tx_gsm;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 time = TX_TABLE[tx_id-1] + PROVISION_TIME + APC_RAMP_DOWN_TIME + 10
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 - l1_config.params.prg_tx_gsm;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 if (burst_type == TX_NB_BURST)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 time -= timing_advance_in_qbit; // time can never be negative here
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 l1pdmacro_it_dsp_gen(time);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 if (tx_group_id == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 //MS TX, set ABB in MS mode
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 // ABB set to MS mode if |TX|TX|.., |TX|PRACH|, |PRACH|TX| or |PRACH|PRACH|
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 // switch_flag is set for the first burst of TX/PRACH or PRACH/PRACH combinations
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 // MS mode in ABB must be maintained for second burst (static_switch_flag)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 if ((num_tx > 1) || (switch_flag) || (static_switch_flag))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 l1ps_dsp_com.pdsp_ndb_ptr->d_bbctrl_gprs = l1_config.params.bbctrl | B_MSLOT;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 l1ps_dsp_com.pdsp_ndb_ptr->d_bbctrl_gprs = l1_config.params.bbctrl;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 // handle special case |TX| |TX|TX|
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 //MS TX, set ABB in MS mode
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 if ((num_tx > 1) || (switch_flag) || (static_switch_flag))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 l1ps_dsp_com.pdsp_ndb_ptr->d_bbctrl_gprs = l1_config.params.bbctrl | B_MSLOT;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 // Compute offset value for TX.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 // PRG_TX has become variable, no longer contained in TIME_OFFSET_TX !
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 if ((burst_type == TX_NB_BURST) || (switch_flag==1))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 offset_tx = offset_serv + TX_TABLE[tx_id] + PROVISION_TIME
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 - l1_config.params.prg_tx_gsm - timing_advance_in_qbit;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 offset_tx = offset_serv + TX_TABLE[tx_id] + PROVISION_TIME
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 - l1_config.params.prg_tx_gsm;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 // offset_tx mod 5000
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 if (offset_tx >= TPU_CLOCK_RANGE)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 offset_tx -= TPU_CLOCK_RANGE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 if(rx_flag == TRUE)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553 time = offset_tx -
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 l1_config.params.tx_synth_setup_time -
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 EPSILON_OFFS
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 - offset_serv;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 if ((burst_type == TX_NB_BURST) || (switch_flag==1))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 time += timing_advance_in_qbit - TA_MAX;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 time = TPU_CLOCK_RANGE - EPSILON_SYNC;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 if (time < 0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 time += TPU_CLOCK_RANGE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 if (!static_switch_flag)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 l1dmacro_offset (offset_tx, (WORD32) time); // load OFFSET for TX before each burst.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 #if L2_L3_SIMUL
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 #if (DEBUG_TRACE == BUFFER_TRACE_OFFSET)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 buffer_trace(2, offset_tx,l1s.actual_time.fn,0,0);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 time=0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 // program PLL only if no TX control carried out in same frame: |TX| |TX|TX| possible
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 // |PRACH|TX|, |TX|PRACH| or |PRACH|PRACH| also possible
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 if (tx_group_id == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 l1pdmacro_tx_synth(radio_freq); // load SYNTH.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 if (!static_switch_flag) // window opened for previous time slot (TX/PRACH or PRACH/PRACH)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 l1pdmacro_tx_up(radio_freq); // TX window opened
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 #if (CODE_VERSION == SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 if (burst_type == TX_RA_BURST)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 time += l1_config.params.tx_ra_duration;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 if (num_tx > 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 // num_tx * BP_DURATION
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 time += TX_TABLE[num_tx - 1] + l1_config.params.tx_nb_duration;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 time += l1_config.params.tx_nb_duration;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 // Read APCDEL1 register DELU(4:0): delay of ramp up start, DELD (9:5) delay of ramp down start
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 // This value is used for computations in MS TX or TX/PRACH combinations
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 // This value is not modified by the computations
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 apcdel1_data = (l1s_dsp_com.dsp_ndb_ptr->d_apcdel1 >> 6) & 0x03ff;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 apcdel1_data_up = apcdel1_data & 0x001f; //delay of ramp up start
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 // Read APCDEL1 register DELU(4:0): delay of ramp up start, DELD (9:5) delay of ramp down start
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 // This value is used for computations in MS TX or TX/PRACH combinations
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 // This value is not modified by the computations
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 apcdel1_data = (l1s_dsp_com.dsp_ndb_ptr->d_apcdel1) & 0x03ff;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 apcdel1_data_up = apcdel1_data & 0x001f; //delay of ramp up start
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 if (!switch_flag)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620 if (burst_type == TX_NB_BURST)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 // If PRACH precedes TX normal burst(s) we have to add BP_DURATION
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 if (static_switch_flag)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 time += BP_DURATION;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 // generate DSP IT for each TX slot after ramp up
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 // Margin:
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 // ABB_RAMP_DELAY = 4*1.5bits internal ABB delay BULENA ON -> ramp up
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 // apcdel1_data_up = additional delay BULENA ON -> ramp up
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 // ABB_RAMP_UP_TIME: maximum time for ramp up: 16 coeff.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 // 10 qbits of additional margin
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 for (i=0; i<num_tx; i++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 l1pdmacro_it_dsp_gen(time + ABB_RAMP_DELAY + ABB_RAMP_UP_TIME + i*BP_DURATION + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 for (i=0; i<num_tx; i++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 l1pdmacro_it_dsp_gen(time + APC_RAMP_DELAY + APC_RAMP_UP_TIME + i*BP_DURATION + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 if (num_tx > 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 // (num_tx - 1) * BP_DURATION + normal burst duration
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645 time += TX_TABLE[num_tx - 1] + l1_config.params.tx_nb_duration - (num_tx - 1);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 time += l1_config.params.tx_nb_duration;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 else //PRACH
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651 // If TX NB precedes PRACH we have to add BP_DURATION and TA (in qbits)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 if (static_switch_flag == 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654 if (timing_advance_in_qbit > 240) // clip TA, cf. comment below
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 timing_advance_in_qbit = 240;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656 time += BP_DURATION + timing_advance_in_qbit;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658 // If PRACH precedes PRACH we have to add BP_DURATION
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 else if (static_switch_flag == 2)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 time += BP_DURATION ;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663 l1pdmacro_it_dsp_gen(time + ABB_RAMP_DELAY + ABB_RAMP_UP_TIME + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 l1pdmacro_it_dsp_gen(time + APC_RAMP_DELAY + APC_RAMP_UP_TIME + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670 time += l1_config.params.tx_ra_duration;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 else if (switch_flag == 1) // |TX|PRACH| or |PRACH|TX|
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 // => ABB windows are opened as for TX_NB in MS mode
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 // => Ramp up start of PRACH is delayed inside this window by the TA of the TX_NB
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 // => DSP inserts dummy bits such that ramp and modulation match
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680 // Rem.: the TA passed for the PRACH is the one for the following TX_NB!!!
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3)) || (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 // In combinations of TX_NB and PRACH apcdel1_bis and apcdel2_bis apply to the PRACH
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 UWORD16 apcdel1_bis_data, apcdel1_bis_data_up, apcdel2_bis_data_up, prach_delay;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 API d_ctrl_abb_gprs;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 // clip TA (in qbit): max. TA supported = BP_DURATION - PRACH duration - max. ramp time
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 // = 625 - 88*4 - 32 = 241
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688 if (timing_advance_in_qbit > 240)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689 timing_advance_in_qbit = 240;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 prach_delay = apcdel1_data_up + timing_advance_in_qbit;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692 apcdel1_bis_data_up = prach_delay & 0x001f;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 apcdel2_bis_data_up = (prach_delay >> 5) & 0x001f;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 // For ramp down delay we need to keep the original value from APCDEL1 (bits 9:5)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 // APCDEL2 default value is '0'
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 apcdel1_bis_data = apcdel1_bis_data_up | (apcdel1_data & 0x03e0);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 #if(RF_FAM != 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 l1s_dsp_com.dsp_ndb_ptr->d_apcdel1_bis = (apcdel1_bis_data << 6) | 0x04;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 l1s_dsp_com.dsp_ndb_ptr->d_apcdel2_bis = (apcdel2_bis_data_up << 6) | 0x34;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 l1s_dsp_com.dsp_ndb_ptr->d_apcdel1_bis = (apcdel1_bis_data );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 l1s_dsp_com.dsp_ndb_ptr->d_apcdel2_bis = (apcdel2_bis_data_up);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707 if (burst_type == TX_RA_BURST) // |PRACH|TX|
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 #if(RF_FAM != 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 l1pdmacro_it_dsp_gen(time + ABB_RAMP_DELAY + ABB_RAMP_UP_TIME + prach_delay + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 l1pdmacro_it_dsp_gen(time + APC_RAMP_DELAY + APC_RAMP_UP_TIME + prach_delay + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715 // apcdel1_bis, apcdel2_bis must be programmed for the current ts (PRACH)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716 // here we need to overwrite (mask) bits for APCDEL1, APCDEL2 programming done in l1pddsp_transfer_mslot_power()
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 d_ctrl_abb_gprs = l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[tx_id];
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718 d_ctrl_abb_gprs |= ((1 << B_BULRAMPDEL_BIS) | (1 << B_BULRAMPDEL2_BIS));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 d_ctrl_abb_gprs &= ~((1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[tx_id] = d_ctrl_abb_gprs;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 else // |TX|PRACH|
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 #if(RF_FAM != 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 l1pdmacro_it_dsp_gen(time + ABB_RAMP_DELAY + ABB_RAMP_UP_TIME + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727 l1pdmacro_it_dsp_gen(time + APC_RAMP_DELAY + APC_RAMP_UP_TIME + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 // apcdel1_bis, apcdel2_bis must be programmed for the next ts (PRACH)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 d_ctrl_abb_gprs = l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[tx_id + 1];
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732 d_ctrl_abb_gprs |= ((1 << B_BULRAMPDEL_BIS) | (1 << B_BULRAMPDEL2_BIS));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 d_ctrl_abb_gprs &= ~((1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[tx_id + 1] = d_ctrl_abb_gprs;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 #endif // ANALOG
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738 static_switch_flag = 1;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740 #endif // DSP == 33 || DSP == 34 || (DSP == 36) || (DSP == 37)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742 else if (switch_flag == 2) // |PRACH|PRACH|
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 // Combination handled by programming ABB with MS mode = 1
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 // => first burst length of first PRACH = BP_DURATION
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747 l1pdmacro_it_dsp_gen(time + ABB_RAMP_DELAY + ABB_RAMP_UP_TIME + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751 l1pdmacro_it_dsp_gen(time + APC_RAMP_DELAY + APC_RAMP_UP_TIME + apcdel1_data_up + 10);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 static_switch_flag = 2;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 #endif //Codeversion
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 // In case of combinations TX_NB/PRACH or PRACH/PRACH the TX window is kept open
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 if (!switch_flag)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 l1pdmacro_tx_down(radio_freq, time, switch_flag, timing_advance_in_qbit,adc_active); // TX window closed
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 l1dmacro_offset (offset_serv, IMM); // Restore offset with serving value.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765 static_switch_flag = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768 #if L2_L3_SIMUL
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 #if (DEBUG_TRACE == BUFFER_TRACE_OFFSET)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770 buffer_trace(2, offset_serv,l1s.actual_time.fn,0,0);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 /* l1pddsp_synchro() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782 void l1pddsp_synchro(UWORD8 switch_mode, UWORD8 camp_timeslot)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784 // Set "b_abort" to TRUE.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785 l1s_dsp_com.dsp_db_w_ptr->d_ctrl_system |= (1 << B_TASK_ABORT);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 // Set switch mode within "b_switch_to_gprs" & "b_switch_to_gms"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs = (switch_mode << B_SWITCH);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790 // In case of a switch to GPRS_SCHEDULER, last_used_txpwr is set to "NO_TXPWR"
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791 // in order to force GSM ramp programming when the MS will switch back to
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 // GSM_SCHEDULER
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 // Moreover, the d_win_start_gprs register must be initialized only during the
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794 // GSM->GPRS switch too.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 if(switch_mode == GPRS_SCHEDULER)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 l1s.last_used_txpwr = NO_TXPWR;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 // Set camp timeslot.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800 l1ps_dsp_com.pdsp_ndb_ptr->d_win_start_gprs = camp_timeslot;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806 /* l1pddsp_idle_prach_data() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 void l1pddsp_idle_prach_data(BOOL polling,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813 UWORD8 cs_type,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814 UWORD16 channel_request_data,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 UWORD8 bsic,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816 UWORD16 radio_freq)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 UWORD16 swap_bit; // 16 bit wide to allow shift left.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820 // UL on TS=3.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= 0x80 >> 3;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 // Swap I/Q management.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824 swap_bit = l1ps_swap_iq_ul(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= swap_bit << 15;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827 // Load UL buffer according to "polling" bit.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828 if(polling)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830 // Select first UL polling buffer.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
831 l1ps_dsp_com.pdsp_ndb_ptr->a_ul_buffer_gprs[3] = 8;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
832
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
833 // Store CS type.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
834 l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][0] = cs_type;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
835
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
836 // Store UL data block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
837 if(cs_type == CS_PAB8_TYPE)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
838 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
839 l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][2] = ((API)(bsic << 2)) |
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
840 ((API)(channel_request_data) << 8);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
841 l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][3] = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
842 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
843 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
844 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
845 l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][2] = ((API)(channel_request_data) << 5);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
846 l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][3] = ((API)(bsic << 10));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
847 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
848 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
849 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
850 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
851 // Set "b_access_prach" to indicate 1 Prach only to DSP.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
852 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= (1 << B_ACCESS_PRACH);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
853
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
854 // Select first UL data buffer.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
855 l1ps_dsp_com.pdsp_ndb_ptr->a_ul_buffer_gprs[3] = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
856
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
857 // Store CS type.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
858 l1ps_dsp_com.pdsp_ndb_ptr->a_du_gprs[0][0] = cs_type;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
859
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
860 // Store UL data block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
861 if(cs_type == CS_PAB8_TYPE)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
862 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
863 l1ps_dsp_com.pdsp_ndb_ptr->a_du_gprs[0][1] = ((API)(bsic << 2)) |
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
864 ((API)(channel_request_data) << 8);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
865 l1ps_dsp_com.pdsp_ndb_ptr->a_du_gprs[0][2] = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
866 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
867 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
868 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
869 l1ps_dsp_com.pdsp_ndb_ptr->a_du_gprs[0][1] = ((API)(channel_request_data) << 5);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
870 l1ps_dsp_com.pdsp_ndb_ptr->a_du_gprs[0][2] = ((API)(bsic << 10));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
871 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
872
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
873 if (l1pa_l1ps_com.pra_info.prach_alloc == FIX_PRACH_ALLOC)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
874 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
875 // Set fix alloc bit.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
876 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs |= (2 << B_MAC_MODE);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
877 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
878 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
879 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
880 // Reset MAC mode to dynamic allocation
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
881 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs &= ~(3 << B_MAC_MODE);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
882
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
883 #if !FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
884 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
885 // Enable USF vote on timeslot 0
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
886 l1ps_dsp_com.pdsp_ndb_ptr->d_usf_vote_enable = 0x80;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
887 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
888 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
889 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
890 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
891 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
892
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
893 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
894 /* l1pddsp_idle_prach_power() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
895 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
896 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
897 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
898 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
899 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
900 void l1pddsp_idle_prach_power(UWORD8 txpwr,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
901 UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
902 UWORD8 ts)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
903 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
904 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (RF_FAM == 61))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
905 UWORD16 pwr_data;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
906 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
907
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
908 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) )
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
909 // Force FIXED transmit power if requested.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
910 if(l1_config.tx_pwr_code == 0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
911 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
912 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[ts] = l1_config.params.fixed_txpwr;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
913
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
914 // Control bitmap: update RAMP, use RAMP[5][..].
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
915 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[ts] =
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
916 ((1 << B_RAMP_GPRS) | (5 << B_RAMP_NB_GPRS) | (1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
917
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
918 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
919 #if (CODE_VERSION != SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
920 Cust_get_ramp_tab(l1ps_dsp_com.pdsp_ndb_ptr->a_ramp_gprs[5],
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
921 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
922 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
923 1 /* arbitrary value for arfcn */ );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
924 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
925 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
926 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
927 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
928 // Get H/W value corresponding to txpwr command.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
929 pwr_data = Cust_get_pwr_data(txpwr, radio_freq
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
930 #if(REL99 && FF_PRF)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
931 ,1
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
932 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
933 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
934
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
935 // Store Transmit power.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
936 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[ts] = ((pwr_data << 6) | 0x12);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
937
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
938 // Control bitmap: update RAMP, use RAMP[5][..].
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
939 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[ts] = ((1 << B_RAMP_GPRS) | (5 << B_RAMP_NB_GPRS) | (1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
940
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
941 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
942 #if (CODE_VERSION != SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
943 Cust_get_ramp_tab(&(l1ps_dsp_com.pdsp_ndb_ptr->a_ramp_gprs[5][0]), txpwr, txpwr, radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
944 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
945 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
946 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
947
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
948 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
949 // Force FIXED transmit power if requested.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
950 if(l1_config.tx_pwr_code == 0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
951 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
952 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[ts] = l1_config.params.fixed_txpwr;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
953
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
954 // Control bitmap: update RAMP, use RAMP[5][..].
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
955 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[ts] =
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
956 ((1 << B_RAMP_GPRS) | (5 << B_RAMP_NB_GPRS) | (1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
957
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
958 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
959 #if (DSP ==38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
960 Cust_get_ramp_tab(l1ps_dsp_com.pdsp_ndb_ptr->a_drp_ramp2_gprs[5],
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
961 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
962 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
963 1 /* arbitrary value for arfcn */ );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
964 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
965 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
966 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
967 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
968 // Get H/W value corresponding to txpwr command.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
969 pwr_data = Cust_get_pwr_data(txpwr, radio_freq
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
970 #if(REL99 && FF_PRF)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
971 ,1
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
972 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
973 );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
974
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
975 // Store Transmit power.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
976 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[ts] = (API) (pwr_data);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
977
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
978 // Control bitmap: update RAMP, use RAMP[5][..].
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
979 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[ts] = ((1 << B_RAMP_GPRS) | (5 << B_RAMP_NB_GPRS) | (1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
980
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
981 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
982 #if(DSP == 38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
983 Cust_get_ramp_tab(&(l1ps_dsp_com.pdsp_ndb_ptr->a_drp_ramp2_gprs[5][0]), txpwr, txpwr, radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
984 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
985 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
986 #endif //RF_FAM == 61
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
987
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
988 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
989
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
990 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
991 /* l1pddsp_single_block() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
992 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
993 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
994 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
995 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
996 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
997 void l1pddsp_single_tx_block(UWORD8 burst_nb,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
998 UWORD8 *data,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
999 UWORD8 tsc,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1000 UWORD16 radio_freq)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1001 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1002 UWORD16 swap_bit; // 16 bit wide to allow shift left.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1003
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1004 // Burst number within a block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1005 l1ps_dsp_com.pdsp_db_w_ptr->d_burst_nb_gprs = burst_nb;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1006
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1007 // UL on TS=3.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1008 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= 0x80 >> 3;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1009
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1010 // Swap I/Q management.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1011 swap_bit = l1ps_swap_iq_ul(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1012 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= swap_bit << 15;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1013
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1014 // Select first UL polling buffer.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1015 l1ps_dsp_com.pdsp_ndb_ptr->a_ul_buffer_gprs[3] = 8;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1016
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1017 // Store CS type: CS1 for Polling.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1018 l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][0] = CS1_TYPE_POLL;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1019
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1020 if(burst_nb == BURST_1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1021 // Store UL data block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1022 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1023 API *ul_block_ptr = &(l1ps_dsp_com.pdsp_ndb_ptr->a_pu_gprs[0][2]);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1024 UWORD8 i,j;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1025
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1026 // Copy first 22 bytes in the first 11 words after header.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1027 for (i=0, j=0; j<11; j++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1028 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1029 ul_block_ptr[j] = ((API)(data[i])) | ((API)(data[i+1]) << 8);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1030 i += 2;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1031 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1032 // Copy last UWORD8 (23rd) in the 12th word after header.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1033 ul_block_ptr[11] = data[22];
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1034 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1035
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1036 // Training sequence.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1037 // Rem: bcch_freq_ind is set within Hopping algo.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1038 l1s_dsp_com.dsp_db_w_ptr->d_ctrl_system |= tsc << B_TSQ;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1039 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1040
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1041 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1042 /* l1pddsp_idle_rx_nb() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1043 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1044 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1045 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1046 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1047 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1048 #if FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1049 void l1pddsp_idle_rx_nb(UWORD8 burst_nb,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1050 UWORD8 tsc,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1051 UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1052 UWORD8 timeslot_no,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1053 BOOL ptcch_dl,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1054 BOOL usf_interrupt)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1055 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1056 void l1pddsp_idle_rx_nb(UWORD8 burst_nb,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1057 UWORD8 tsc,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1058 UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1059 UWORD8 timeslot_no,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1060 BOOL ptcch_dl)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1061 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1062 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1063 UWORD16 swap_bit; // 16 bit wide to allow shift left.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1064
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1065 // DL on TS=0.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1066 l1ps_dsp_com.pdsp_db_w_ptr->d_task_d_gprs |= 0x80 >> timeslot_no;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1067
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1068 // Swap I/Q management.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1069 swap_bit = l1ps_swap_iq_dl(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1070 l1ps_dsp_com.pdsp_db_w_ptr->d_task_d_gprs |= swap_bit << 15;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1071
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1072 if(ptcch_dl)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1073 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1074 // PTCCH/DL case must be flagged to DSP.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1075 l1ps_dsp_com.pdsp_db_w_ptr->d_task_d_gprs |= (1 << B_PTCCH_DL);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1076 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1077
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1078 // Burst number within a block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1079 l1ps_dsp_com.pdsp_db_w_ptr->d_burst_nb_gprs = burst_nb;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1080
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1081 // Channel coding is forced to CS1.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1082 l1ps_dsp_com.pdsp_ndb_ptr->a_ctrl_ched_gprs[timeslot_no] = CS1_TYPE_DATA;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1083
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1084 // pass information to DSP which good USF value is to be expected
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1085 l1ps_dsp_com.pdsp_ndb_ptr->a_usf_gprs[0] = (API) 0x07;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1086
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1087 #if FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1088 // In case of connection establishment mode with dynamic or fixed
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1089 // allocation scheme we need to request the DSP USF interrupt for PRACH
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1090 // scheduling. Latched by DSP during Work3
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1091 if (burst_nb == 3)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1092 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1093 if (usf_interrupt)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1094 l1ps_dsp_com.pdsp_ndb_ptr->d_usf_vote_enable |= (1 << B_USF_IT);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1095 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1096 l1ps_dsp_com.pdsp_ndb_ptr->d_usf_vote_enable &= ~(1 << B_USF_IT);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1097 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1098 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1099
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1100 // RIF receiver algorithm: select 156.25.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1101 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs &= 0xFFFF ^ (1 << B_RIF_RX_MODE);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1102
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1103 // Training sequence.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1104 // Rem: bcch_freq_ind is set within Hopping algo.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1105 l1s_dsp_com.dsp_db_w_ptr->d_ctrl_system |= tsc << B_TSQ;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1106
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1107 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1108
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1109
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1110 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1111 /* l1pddsp_transfer_mslot_ctrl() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1112 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1113 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1114 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1115 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1116 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1117 void l1pddsp_transfer_mslot_ctrl(UWORD8 burst_nb,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1118 UWORD8 dl_bitmap,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1119 UWORD8 ul_bitmap,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1120 UWORD8 *usf_table,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1121 UWORD8 mac_mode,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1122 UWORD8 *ul_buffer_index,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1123 UWORD8 tsc,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1124 UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1125 UWORD8 synchro_timeslot,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1126 #if FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1127 UWORD8 dsp_usf_interrupt
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1128 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1129 UWORD8 usf_vote_enable
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1130 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1131 )
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1132 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1133 UWORD8 i;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1134 UWORD16 swap_bit; // 16 bit wide to allow shift left.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1135
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1136 // Burst number within a block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1137 l1ps_dsp_com.pdsp_db_w_ptr->d_burst_nb_gprs = burst_nb;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1138
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1139 // DL bitmap.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1140 l1ps_dsp_com.pdsp_db_w_ptr->d_task_d_gprs = dl_bitmap;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1141
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1142 // UL bitmap.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1143 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs = ul_bitmap;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1144
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1145 // Swap I/Q management for DL.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1146 swap_bit = l1ps_swap_iq_dl(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1147 l1ps_dsp_com.pdsp_db_w_ptr->d_task_d_gprs |= swap_bit << 15;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1148
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1149 // Swap I/Q management for UL.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1150 swap_bit = l1ps_swap_iq_ul(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1151 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= swap_bit << 15;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1152
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1153 if(burst_nb == 0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1154 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1155 // Store USF table
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1156 for(i=0;i<(8 - synchro_timeslot);i++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1157 l1ps_dsp_com.pdsp_ndb_ptr->a_usf_gprs[i] = usf_table[i+synchro_timeslot];
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1158
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1159 // Automatic CS detection.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1160 for(i=0;i<8;i++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1161 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1162 l1ps_dsp_com.pdsp_ndb_ptr->a_ctrl_ched_gprs[i] = CS_AUTO_DETECT;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1163
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1164 // Select first UL polling buffer.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1165 l1ps_dsp_com.pdsp_ndb_ptr->a_ul_buffer_gprs[i] = ul_buffer_index[i];
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1166 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1167
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1168 #if !FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1169 // USF vote enable programming
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1170
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1171 #if (DSP == 33) || (DSP == 34) || (DSP == 35) || (DSP == 36) || (DSP == 37) || (DSP == 38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1172 // Multislot TX allowed and usf_vote_enable suported: programs usf_vote_enable
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1173 l1ps_dsp_com.pdsp_ndb_ptr->d_usf_vote_enable = usf_vote_enable;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1174 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1175 // Single slot TX only and usf_vote_enable not supported
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1176 // Modify MAC mode
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1177 if (usf_vote_enable)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1178 // USF vote enabled --> Set MAC mode to dynamic mode
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1179 mac_mode = DYN_ALLOC;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1180 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1181 // USF vote disabled --> Set MAC mode to fixed mode
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1182 mac_mode = FIX_ALLOC_NO_HALF;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1183 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1184
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1185 #endif // !FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1186
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1187 // MAC mode.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1188 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs &= ~(3 << B_MAC_MODE);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1189 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs |= mac_mode << B_MAC_MODE;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1190 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1191
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1192 #if FF_L1_IT_DSP_USF
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1193 if(burst_nb == 3)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1194 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1195 // Program DSP to generate an interrupt once USF available if
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1196 // required. Latched by DSP during Work3.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1197 if (dsp_usf_interrupt)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1198 l1ps_dsp_com.pdsp_ndb_ptr->d_usf_vote_enable = (1 << B_USF_IT);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1199 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1200 l1ps_dsp_com.pdsp_ndb_ptr->d_usf_vote_enable = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1201 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1202 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1203
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1204 // RIF receiver algorithm: select 156.25.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1205 l1ps_dsp_com.pdsp_ndb_ptr->d_sched_mode_gprs &= 0xFFFF ^ (1 << B_RIF_RX_MODE);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1206
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1207 // d_fn
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1208 // ----
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1209 // bit [0..7] -> b_fn_report, unused for GPRS
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1210 // bit [8..15] -> b_fn_sid , FN%104
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1211 l1s_dsp_com.dsp_db_w_ptr->d_fn = ((l1s.next_time.fn_mod104)<<8);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1212
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1213 // Training sequence.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1214 // Rem: bcch_freq_ind is set within Hopping algo.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1215 l1s_dsp_com.dsp_db_w_ptr->d_ctrl_system |= tsc << B_TSQ;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1216
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1217 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1218
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1219
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1220 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1221 /* l1pddsp_transfer_mslot_power() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1222 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1223 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1224 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1225 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1226 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1227 void l1pddsp_transfer_mslot_power(UWORD8 *txpwr,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1228 UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1229 UWORD8 ul_bitmap)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1230 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1231 #define NO_TX 100
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1232
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1233 UWORD16 i; // 16 bit needed for shifting pupose.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1234 UWORD8 last_TX = NO_TX;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1235 UWORD8 txpwr_ramp_up;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1236 UWORD8 txpwr_ramp_down;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1237 UWORD8 cpt_TX = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1238 UWORD8 ts_mask;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1239
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1240 #if (REL99 && FF_PRF)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1241 UWORD8 number_uplink_timeslot = 0 ; // number of uplink timeslot for power reduction feature
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1242 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1243
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1244
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1245 #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3) || (RF_FAM == 61))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1246 UWORD16 pwr_data;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1247 UWORD16 d_ramp_idx;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1248 WORD16 ts_conv;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1249 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1250
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1251 //Locosto #if ((ANLG_FAM == 1) || (ANLG_FAM == 2) || (ANLG_FAM == 3))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1252
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1253 // This function is called with an ul_bitmap which represents the abolute
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1254 // position of any Tx bursts in this frame. This bitmap has already
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1255 // absorbed any synchro change (in dl_tn), hence we need to do some
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1256 // processing to recover the actual Tx timeslot number which is used
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1257 // as an index into the txpwr array.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1258 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1259 // Example : MS Class 8 with 4 Rx and 1 Tx :
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1260 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1261 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1262 // dl_ts_alloc : 0x0f 0 0 0 0 R R R R
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1263 // ul_ts_alloc : 0x02 0 0 0 0 0 0 T 0
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1264 // shift + combine : 0 0 0 0 R R R R 0 T
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1265 // set dl_tn=4 : R R R R 0 T 0 0
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1266 // ul_bitmap : 0x04 0 0 0 0 0 1 0 0
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1267 // i : 5
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1268 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1269 // Example : MS Class 8 with 1 Rx and 1 Tx on TS=7
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1270 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1271 // dl_ts_alloc : 0x01 0 0 0 0 0 0 0 R
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1272 // ul_ts_alloc : 0x01 0 0 0 0 0 0 0 T
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1273 // shift + combine : 0 0 0 0 0 0 0 R 0 0 T
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1274 // set dl_tn=7 : R 0 0 T 0 0 0 0
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1275 // ul_bitmap : 0x10 0 0 0 1 0 0 0 0
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1276 // i : 3
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1277 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1278 // We recover the actual timeslot from the ul_bitmap by the following
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1279 // method :
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1280 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1281 // ts = (i + dl_tn) - 3
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1282 //
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1283 // Where i is the loopindex usd to detect "1" in the ul_bitmap.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1284 // This works for MS class 8 because (3 <= i <= 5) if the
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1285 // multislot class is respected.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1286
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1287 #if (REL99 && FF_PRF)// power reduction feature
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1288 for (i=0; i<8; i++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1289 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1290 // computed number of uplink timeslot in order to determine uplink power reduction
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1291 ts_mask = (0x80>>i);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1292 if (ul_bitmap & ts_mask)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1293 number_uplink_timeslot++;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1294 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1295 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1296
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1297
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1298 ts_conv = l1a_l1s_com.dl_tn - 3;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1299
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1300 // Index of the programmed ramps
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1301 d_ramp_idx = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1302
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1303 for(i=0;i<8;i++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1304 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1305 // Program Transmit power and ramp for allocated timeslots.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1306 if(ul_bitmap & (0x80>>i))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1307 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1308 // Fixe transmit power.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1309 if(l1_config.tx_pwr_code == 0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1310 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1311 // Store Transmit power.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1312 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[i] = l1_config.params.fixed_txpwr;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1313
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1314 // Control bitmap: update RAMP, use RAMP[d_ramp_idx][..].
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1315 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[i] =
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1316 ((d_ramp_idx << B_RAMP_NB_GPRS) | (1 << B_RAMP_GPRS) | (1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1317
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1318 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1319 #if (RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1320 #if (DSP ==38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1321 Cust_get_ramp_tab(l1ps_dsp_com.pdsp_ndb_ptr->a_drp_ramp2_gprs[d_ramp_idx++],
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1322 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1323 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1324 1 /* arbitrary value for arfcn */ );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1325 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1326 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1327 #if (CODE_VERSION != SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1328 Cust_get_ramp_tab(l1ps_dsp_com.pdsp_ndb_ptr->a_ramp_gprs[d_ramp_idx++],
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1329 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1330 0, /* not used */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1331 1 /* arbitrary value for arfcn */ );
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1332 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1333 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1334 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1335 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1336 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1337 // count the number of TX windows
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1338 cpt_TX ++;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1339
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1340 // Get power amplifier data.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1341 #if(REL99 && FF_PRF)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1342 pwr_data = Cust_get_pwr_data(txpwr[i+ts_conv], radio_freq, number_uplink_timeslot);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1343 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1344 pwr_data = Cust_get_pwr_data(txpwr[i+ts_conv], radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1345 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1346
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1347
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1348 // Store Transmit power.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1349 #if(RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1350 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[i] = (pwr_data);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1351 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1352 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_power_gprs[i] = ((pwr_data << 6) | 0x12);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1353 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1354
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1355 // Control bitmap: update RAMP, use RAMP[d_ramp_idx][..] for slot i.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1356 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[i] = ((d_ramp_idx << B_RAMP_NB_GPRS) | (1 << B_RAMP_GPRS) | (1 << B_BULRAMPDEL) | (1 << B_BULRAMPDEL2));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1357
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1358 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1359 // ==========
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1360 // for the 1st TX the RAMP is: RAMP_UP_TX1 / RAMP_DOWN_TX1
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1361 // for the 2nd TX the RAMP is: RAMP_UP_TX2 / RAMP_DOWN_TX1
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1362 // for the 3rd TX the RAMP is: RAMP_UP_TX3 / RAMP_DOWN_TX2
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1363 // (...)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1364 // for the (i)th TX the RAMP is: RAMP_UP_TX_(i) / RAMP_DOWN_TX_(i-1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1365 // for the additionnal RAMP : xxxx / RAMP_DOWN_TX_last
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1366
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1367 txpwr_ramp_up = txpwr[i+ts_conv]; // the ramp up is the current TX
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1368
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1369 if(last_TX == NO_TX) // specific case of the first TX
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1370 txpwr_ramp_down = txpwr[i+ts_conv]; // the ramp down is the current TX
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1371 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1372 txpwr_ramp_down = txpwr[last_TX+ts_conv]; // the ramp down is the previous TX
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1373
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1374 #if(RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1375 #if(DSP == 38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1376 Cust_get_ramp_tab(&(l1ps_dsp_com.pdsp_ndb_ptr->a_drp_ramp2_gprs[d_ramp_idx++][0]), txpwr_ramp_up, txpwr_ramp_down, radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1377 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1378 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1379 #if (CODE_VERSION != SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1380 Cust_get_ramp_tab(&(l1ps_dsp_com.pdsp_ndb_ptr->a_ramp_gprs[d_ramp_idx++][0]), txpwr_ramp_up, txpwr_ramp_down, radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1381 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1382 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1383 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1384
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1385 // memorize the last TX window
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1386 last_TX = i;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1387 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1388 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1389 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1390 // program an interrupt in the TS following
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1391 // the last TX window and needed by the DSP
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1392
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1393 // Is it the TS following a TX window ?
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1394 #if 0 /* original LoCosto code */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1395 if((i == last_TX+1) && (i<8))
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1396 #else /* FreeCalypso TCS211 reconstruction */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1397 if (i == last_TX+1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1398 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1399 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1400 // program the interrupt
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1401 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[i] = (1 << B_MS_RULE);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1402 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1403 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1404 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1405
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1406 // in a multi-TX case an additionnal ramp down must be set
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1407 if(cpt_TX > 1)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1408 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1409 // Control bitmap: update RAMP, use RAMP[d_ramp_idx][..] for slot i and set the interrupt
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1410 #if 0 /* FreeCalypso TCS211 reconstruction */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1411 if((last_TX+1) <= 7)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1412 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1413 l1ps_dsp_com.pdsp_db_w_ptr->a_ctrl_abb_gprs[last_TX+1] = ((d_ramp_idx << B_RAMP_NB_GPRS) | (1 << B_RAMP_GPRS) | (1 << B_MS_RULE));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1414
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1415 // Store Ramp.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1416 // ==========
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1417 txpwr_ramp_up = txpwr[last_TX+ts_conv]; // this ramp up is unused (default: set to last_TX)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1418 txpwr_ramp_down = txpwr[last_TX+ts_conv]; // the ramp down is the last TX
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1419
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1420 #if(RF_FAM == 61)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1421 #if(DSP ==38) || (DSP == 39)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1422 Cust_get_ramp_tab(&(l1ps_dsp_com.pdsp_ndb_ptr->a_drp_ramp2_gprs[d_ramp_idx][0]), txpwr_ramp_up, txpwr_ramp_down, radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1423 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1424 #else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1425 #if (CODE_VERSION != SIMULATION)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1426 Cust_get_ramp_tab(&(l1ps_dsp_com.pdsp_ndb_ptr->a_ramp_gprs[d_ramp_idx][0]), txpwr_ramp_up, txpwr_ramp_down, radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1427 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1428 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1429 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1430 // #endif Locosto
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1431 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1432
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1433
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1434 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1435 /* l1pddsp_ul_ptcch_data() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1436 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1437 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1438 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1439 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1440 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1441 void l1pddsp_ul_ptcch_data(UWORD8 cs_type,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1442 UWORD16 channel_request_data,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1443 UWORD8 bsic,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1444 UWORD16 radio_freq,
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1445 UWORD8 timeslot_no)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1446 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1447 UWORD16 swap_bit; // 16 bit wide to allow shift left.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1448
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1449 // UL on TS=timeslot_no.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1450 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= 0x80 >> timeslot_no;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1451
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1452 // Swap I/Q management.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1453 swap_bit = l1ps_swap_iq_ul(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1454 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= swap_bit << 15;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1455
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1456 // Set "b_ptcch_ul" to indicate PTCCH/UL to DSP.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1457 l1ps_dsp_com.pdsp_db_w_ptr->d_task_u_gprs |= (1 << B_PTCCH_UL);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1458
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1459 // Store CS type.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1460 l1ps_dsp_com.pdsp_ndb_ptr->a_ptcchu_gprs[0] = cs_type;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1461
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1462 // Store UL data block.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1463 if(cs_type == CS_PAB8_TYPE)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1464 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1465 l1ps_dsp_com.pdsp_ndb_ptr->a_ptcchu_gprs[1] = ((API)(bsic << 2)) |
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1466 ((API)(channel_request_data) << 8);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1467 l1ps_dsp_com.pdsp_ndb_ptr->a_ptcchu_gprs[2] = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1468 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1469 else
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1470 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1471 l1ps_dsp_com.pdsp_ndb_ptr->a_ptcchu_gprs[1] = ((API)(channel_request_data) << 5);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1472 l1ps_dsp_com.pdsp_ndb_ptr->a_ptcchu_gprs[2] = ((API)(bsic << 10));
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1473 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1474 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1475
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1476
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1477 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1478 /* l1pddsp_interf_meas_ctrl() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1479 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1480 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1481 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1482 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1483 void l1pddsp_interf_meas_ctrl(UWORD8 nb_meas_req)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1484 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1485 // Interference measurement task set as a monitoring task within GSM interface.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1486 // 101 means 1 meas, 102 means 2 meas ...
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1487 // Rem: swap I/Q is not managed for power measurements.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1488 l1s_dsp_com.dsp_db_w_ptr->d_task_md = INTERF_DSP_TASK + nb_meas_req;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1489 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1490
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1491
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1492 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1493 /* l1pddsp_transfer_meas_ctrl() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1494 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1495 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1496 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1497 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1498 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1499 void l1pddsp_transfer_meas_ctrl(UWORD8 meas_position)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1500 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1501 // Store measurement position.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1502 // Rem: This is a L1S filtered information giving the position of the meas. as a
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1503 // bitmap.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1504 // Rem: swap I/Q is not managed for power measurements.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1505 l1ps_dsp_com.pdsp_db_w_ptr->d_task_pm_gprs = meas_position;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1506 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1507
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1508 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1509 /* l1pddsp_meas_ctrl() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1510 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1511 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1512 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1513 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1514 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1515 void l1pddsp_meas_ctrl(UWORD8 nbmeas, UWORD8 pm_pos)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1516 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1517 // Request Signal level measurement task to DSP. A bit map is passed
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1518 // to DSP in order to specify the position of the measurement.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1519 // Note: MSB is TN = 0 and LSB is TN = 7.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1520 // Rem: swap I/Q is not managed for power measurements.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1521 // Note: currently a maximum of four Pm can be performed / TDMA. This would
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1522 // be modified in a near futur.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1523 // Note: If a Rx is programmed i.e. pm_pos = 1, only a maximum
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1524 // of 3 Pm is requested to DSP and position of the Pm are right shifted (Rx on TN = 0).
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1525 // Remark: In packet Idle mode Rx are still on TN = 0. This implies three Pm
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1526 // always after the Rx.
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1527 l1ps_dsp_com.pdsp_db_w_ptr->d_task_pm_gprs = ((UWORD8) (0xff << (8 - nbmeas))) >> pm_pos;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1528 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1529
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1530 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1531 /* l1pddsp_meas_read() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1532 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1533 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1534 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1535 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1536 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1537 void l1pddsp_meas_read(UWORD8 nbmeas, UWORD8 *a_pm)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1538 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1539 UWORD8 i = 0;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1540 UWORD8 j;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1541 UWORD8 bit_mask = 0x80;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1542
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1543 // Looks for first PM position
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1544 while ((i < 8) && (l1ps_dsp_com.pdsp_db_r_ptr->d_task_pm_gprs & bit_mask) == 0)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1545 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1546 i++;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1547 bit_mask >>= 1;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1548 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1549
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1550 // Read 'nbmeas' contiguous PM levels from the first PM position
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1551 // Note: PM are always programmed on contiguous timeslots
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1552 #if 0 /* original LoCosto code */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1553 for (j = 0; ((j < nbmeas)&&(i < 8)); j++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1554 #else /* FreeCalypso TCS211 reconstruction */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1555 for (j = 0; j < nbmeas; j++)
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1556 #endif
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1557 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1558 // Download PM from DSP/MCU memory interface
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1559 a_pm[j] = (l1ps_dsp_com.pdsp_db_r_ptr->a_burst_pm_gprs[i] & 0xffff) >> 5;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1560
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1561 // Read next PM on following TN
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1562 i++;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1563 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1564 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1565
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1566 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1567 /* l1pddsp_load_bcchn_task() */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1568 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1569 /* Parameters : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1570 /* Return : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1571 /* Functionality : */
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1572 /*-------------------------------------------------------*/
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1573 void l1pddsp_load_bcchn_task(UWORD8 tsq,UWORD16 radio_freq )
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1574 {
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1575 UWORD16 swap_bit = l1ps_swap_iq_dl(radio_freq);
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1576
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1577 l1s_dsp_com.dsp_db_w_ptr->d_task_md = NBN_DSP_TASK | (swap_bit << 15); // Load BCCHN task
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1578 l1s_dsp_com.dsp_db_w_ptr->d_ctrl_system |= tsq << B_TSQ;
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1579 }
0740b5ff15f6 reconstructed L1_GPRS source imported from tcs211-l1-reconst
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1580 #endif