FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/tpu_drivers/p_source0/p_tpudr12.c @ 343:5df5579f9f92
p_tpudr12.c: initial import of p_tpudr61.c from LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 30 Oct 2017 05:11:46 +0000 |
parents | e92a17fee1c1 |
children | ad79bc0b3312 |
comparison
equal
deleted
inserted
replaced
342:5d9aed5e76e7 | 343:5df5579f9f92 |
---|---|
1 /* dummy C source file */ | 1 /************* Revision Controle System Header ************* |
2 * GSM Layer 1 software | |
3 * | |
4 * Filename p_tpudr12.c | |
5 * Copyright 2003 (C) Texas Instruments | |
6 * | |
7 ************* Revision Controle System Header *************/ | |
8 | |
9 #include "l1_macro.h" | |
10 #include "l1_confg.h" | |
11 | |
12 #if L1_GPRS | |
13 | |
14 #include "sys_types.h" | |
15 #include "iq.h" | |
16 #include "l1_const.h" | |
17 #include "l1_types.h" | |
18 | |
19 #if TESTMODE | |
20 #include "l1tm_defty.h" | |
21 #endif | |
22 | |
23 #if (AUDIO_TASK == 1) | |
24 #include "l1audio_const.h" | |
25 #include "l1audio_cust.h" | |
26 #include "l1audio_defty.h" | |
27 #endif | |
28 | |
29 #if (L1_GTT == 1) | |
30 #include "l1gtt_const.h" | |
31 #include "l1gtt_defty.h" | |
32 #endif | |
33 | |
34 #if (L1_MP3 == 1) | |
35 #include "l1mp3_defty.h" | |
36 #endif | |
37 | |
38 #if (L1_MIDI == 1) | |
39 #include "l1midi_defty.h" | |
40 #endif | |
41 | |
42 #if (L1_AAC == 1) | |
43 #include "l1aac_defty.h" | |
44 #endif | |
45 #include "l1_defty.h" | |
46 #include "l1_time.h" | |
47 #include "tpudrv.h" | |
48 #include "tpudrv61.h" | |
49 #include "armio.h" | |
50 | |
51 #if (L1_RF_KBD_FIX == 1) | |
52 #include "l1_varex.h" | |
53 #endif | |
54 | |
55 | |
56 // external function prototypes | |
57 #if (L1_RF_KBD_FIX == 1) | |
58 #if (L1_MADC_ON == 1) | |
59 void l1dmacro_rx_up (UWORD8 adc_active, UWORD8 csf_filter_choice, UWORD8 kbd_config | |
60 #if(NEW_SNR_THRESHOLD==1) | |
61 , UWORD8 saic_flag_rx_up | |
62 #endif | |
63 ); | |
64 #else | |
65 void l1dmacro_rx_up (UWORD8 csf_filter_choice, UWORD8 kbd_config | |
66 #if(NEW_SNR_THRESHOLD==1) | |
67 , UWORD8 saic_flag_rx_up | |
68 #endif | |
69 ); | |
70 #endif | |
71 #endif/*(L1_RF_KBD_FIX == 1)*/ | |
72 | |
73 #if (L1_RF_KBD_FIX == 0) | |
74 #if (L1_MADC_ON == 1) | |
75 void l1dmacro_rx_up (UWORD8 adc_active, UWORD8 csf_filter_choice | |
76 #if(NEW_SNR_THRESHOLD==1) | |
77 , UWORD8 saic_flag_rx_up | |
78 #endif | |
79 ); | |
80 #else | |
81 void l1dmacro_rx_up (UWORD8 csf_filter_choice | |
82 #if(NEW_SNR_THRESHOLD==1) | |
83 , UWORD8 saic_flag_rx_up | |
84 #endif | |
85 ); | |
86 #endif | |
87 #endif/*(L1_RF_KBD_FIX == 0)*/ | |
88 | |
89 | |
90 void l1dmacro_rx_down (WORD32 t); | |
91 #if (L1_RF_KBD_FIX == 1) | |
92 void l1dmacro_tx_up (UWORD8 kbd_config); | |
93 void l1dmacro_tx_down (WORD32 time, BOOL tx_flag, UWORD8 adc_active, UWORD8 kbd_config); | |
94 #endif/*#if (L1_RF_KBD_FIX == 1)*/ | |
95 | |
96 #if (L1_RF_KBD_FIX == 0) | |
97 void l1dmacro_tx_up (void); | |
98 void l1dmacro_tx_down (WORD32 time, BOOL tx_flag, UWORD8 adc_active); | |
99 #endif/*(L1_RF_KBD_FIX == 0)*/ | |
100 | |
101 // external variables and tables | |
102 extern SYS_UWORD16 *TP_Ptr; | |
103 //extern UWORD16 total_kbd_on_time; | |
104 | |
105 | |
106 /**************************************************************************/ | |
107 /**************************************************************************/ | |
108 /* EXTERNAL FUNCTIONS CALLED BY LAYER1 */ | |
109 /* COMMON TO L1 and TOOLKIT */ | |
110 /**************************************************************************/ | |
111 /**************************************************************************/ | |
112 | |
113 /*------------------------------------------*/ | |
114 /* l1dmacro_tx_synth */ | |
115 /*------------------------------------------*/ | |
116 /* programs RF synth for transmit */ | |
117 /* programs OPLL for transmit */ | |
118 /*------------------------------------------*/ | |
119 void l1pdmacro_tx_synth(SYS_UWORD16 radio_freq) | |
120 { | |
121 l1dmacro_tx_synth(radio_freq); | |
122 } | |
123 | |
124 /*------------------------------------------*/ | |
125 /* l1pdmacro_rx_up */ | |
126 /*------------------------------------------*/ | |
127 /* Open window for normal burst reception */ | |
128 /*------------------------------------------*/ | |
129 #if(L1_RF_KBD_FIX == 1) | |
130 | |
131 #if (L1_MADC_ON == 1) | |
132 void l1pdmacro_rx_up (SYS_UWORD16 radio_freq,UWORD8 adc_active, UWORD8 csf_filter_choice | |
133 #if(NEW_SNR_THRESHOLD==1) | |
134 , UWORD8 saic_flag_rx_up | |
135 #endif | |
136 ) | |
137 { | |
138 l1dmacro_rx_up(adc_active, csf_filter_choice, L1_KBD_DIS_RX_NB | |
139 #if(NEW_SNR_THRESHOLD==1) | |
140 , saic_flag_rx_up | |
141 #endif | |
142 ); | |
143 } | |
144 #else | |
145 void l1pdmacro_rx_up (SYS_UWORD16 radio_freq, UWORD8 csf_filter_choice | |
146 #if(NEW_SNR_THRESHOLD==1) | |
147 , UWORD8 saic_flag_rx_up | |
148 #endif | |
149 ) | |
150 { | |
151 l1dmacro_rx_up(csf_filter_choice, L1_KBD_DIS_RX_NB | |
152 #if(NEW_SNR_THRESHOLD==1) | |
153 , saic_flag_rx_up | |
154 #endif | |
155 ); | |
156 | |
157 } | |
158 #endif | |
159 | |
160 #endif /*#if(L1_RF_KBD_FIX == 1)*/ | |
161 | |
162 #if(L1_RF_KBD_FIX == 0) | |
163 #if (L1_MADC_ON == 1) | |
164 void l1pdmacro_rx_up (SYS_UWORD16 radio_freq,UWORD8 adc_active, UWORD8 csf_filter_choice | |
165 #if(NEW_SNR_THRESHOLD==1) | |
166 , UWORD8 saic_flag_rx_up | |
167 #endif | |
168 ) | |
169 { | |
170 l1dmacro_rx_up(adc_active, csf_filter_choice | |
171 #if(NEW_SNR_THRESHOLD==1) | |
172 , saic_flag_rx_up | |
173 #endif | |
174 ); | |
175 } | |
176 #else | |
177 void l1pdmacro_rx_up (SYS_UWORD16 radio_freq, UWORD8 csf_filter_choice | |
178 #if(NEW_SNR_THRESHOLD==1) | |
179 , UWORD8 saic_flag_rx_up | |
180 #endif | |
181 ) | |
182 { | |
183 l1dmacro_rx_up(csf_filter_choice | |
184 #if(NEW_SNR_THRESHOLD==1) | |
185 , saic_flag_rx_up | |
186 #endif | |
187 ); | |
188 | |
189 } | |
190 #endif | |
191 | |
192 | |
193 #endif/*#if(L1_RF_KBD_FIX == 0)*/ | |
194 | |
195 | |
196 /*------------------------------------------*/ | |
197 /* l1pdmacro_rx_down */ | |
198 /*------------------------------------------*/ | |
199 /* Close window for normal burst reception */ | |
200 /*------------------------------------------*/ | |
201 #if(L1_RF_KBD_FIX == 1) | |
202 | |
203 void l1pdmacro_rx_down (SYS_UWORD16 radio_freq, UWORD8 num_rx, BOOL rx_done_flag) | |
204 { | |
205 l1dmacro_rx_down (RX_DOWN_TABLE[num_rx - 1]); | |
206 l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_NB * (-TRF_R3_1 + RX_DOWN_TABLE[num_rx - 1] - TRF_R7); | |
207 } | |
208 #endif | |
209 | |
210 #if(L1_RF_KBD_FIX == 0) | |
211 | |
212 void l1pdmacro_rx_down (SYS_UWORD16 radio_freq, UWORD8 num_rx, BOOL rx_done_flag) | |
213 { | |
214 l1dmacro_rx_down (RX_DOWN_TABLE[num_rx - 1]); | |
215 | |
216 } | |
217 | |
218 #endif | |
219 /*------------------------------------------*/ | |
220 /* l1pdmacro_tx_up */ | |
221 /*------------------------------------------*/ | |
222 /* Open transmission window for normal burst*/ | |
223 /*------------------------------------------*/ | |
224 #if(L1_RF_KBD_FIX == 1) | |
225 | |
226 void l1pdmacro_tx_up (SYS_UWORD16 radio_freq) | |
227 { | |
228 l1dmacro_tx_up(L1_KBD_DIS_TX_NB); | |
229 } | |
230 #endif | |
231 | |
232 #if(L1_RF_KBD_FIX == 0) | |
233 void l1pdmacro_tx_up (SYS_UWORD16 radio_freq) | |
234 { | |
235 l1dmacro_tx_up(); | |
236 } | |
237 | |
238 #endif | |
239 | |
240 | |
241 /*-------------------------------------------*/ | |
242 /* l1pdmacro_tx_down */ | |
243 /*-------------------------------------------*/ | |
244 /* Close transmission window for normal burst*/ | |
245 /*-------------------------------------------*/ | |
246 #if(L1_RF_KBD_FIX == 1) | |
247 | |
248 void l1pdmacro_tx_down (SYS_UWORD16 radio_freq, WORD16 time, BOOL tx_flag, UWORD8 timing_advance,UWORD8 adc_active) | |
249 { | |
250 l1dmacro_tx_down (time, tx_flag, adc_active, L1_KBD_DIS_TX_NB); | |
251 l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_TX_NB * (-TRF_T3_1 + time + TRF_T12); | |
252 } | |
253 #endif | |
254 | |
255 #if(L1_RF_KBD_FIX == 0) | |
256 void l1pdmacro_tx_down (SYS_UWORD16 radio_freq, WORD16 time, BOOL tx_flag, UWORD8 timing_advance,UWORD8 adc_active) | |
257 { | |
258 l1dmacro_tx_down (time, tx_flag, adc_active); | |
259 | |
260 } | |
261 #endif | |
262 | |
263 /*---------------------------------------------*/ | |
264 /* l1pdmacro_it_dsp_gen */ | |
265 /*---------------------------------------------*/ | |
266 /* Generate IT to DSP */ | |
267 /*---------------------------------------------*/ | |
268 void l1pdmacro_it_dsp_gen(UWORD16 time) | |
269 { | |
270 // WARNING: 'time' must always be included between 0 and TPU_CLOCK_RANGE !!! | |
271 | |
272 *TP_Ptr++ = TPU_FAT (time); | |
273 *TP_Ptr++ = TPU_MOVE (TPU_IT_DSP_PG,0x0001); | |
274 } | |
275 | |
276 // TEMPORARY !!!!! | |
277 | |
278 /*---------------------------------------------*/ | |
279 /* l1pdmacro_anchor */ | |
280 /*---------------------------------------------*/ | |
281 /* Temporary macro used to program a TPU */ | |
282 /* scenario executed on the correct frame */ | |
283 /*---------------------------------------------*/ | |
284 void l1pdmacro_anchor(WORD16 time) | |
285 { | |
286 // WARNING: 'time' must always be included between 0 and TPU_CLOCK_RANGE !!! | |
287 | |
288 *TP_Ptr++ = TPU_FAT (time); | |
289 } | |
290 | |
291 #endif |