FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/p_cfile/l1p_ctl.c @ 310:cd2507a8ec57
l1p_ctl.c: passes compilation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 02 Oct 2017 20:17:05 +0000 |
parents | 871cf4253768 |
children | 5f8ab159aa76 |
comparison
equal
deleted
inserted
replaced
309:871cf4253768 | 310:cd2507a8ec57 |
---|---|
231 } // End if "radio_freq != beacon_frequency" | 231 } // End if "radio_freq != beacon_frequency" |
232 | 232 |
233 // Process AGC to apply | 233 // Process AGC to apply |
234 *agc = Cust_get_agc_from_IL(radio_freq, | 234 *agc = Cust_get_agc_from_IL(radio_freq, |
235 input_level >> 1, | 235 input_level >> 1, |
236 curve_id, *lna_off); | 236 curve_id); |
237 | 237 |
238 // Store lna_off and input_level field used for current CTRL in order to be able | 238 // Store lna_off and input_level field used for current CTRL in order to be able |
239 // to build IL from pm in READ phase. | 239 // to build IL from pm in READ phase. |
240 l1a_l1s_com.Scell_used_IL.input_level = (UWORD8)input_level; | 240 l1a_l1s_com.Scell_used_IL.input_level = (UWORD8)input_level; |
241 l1a_l1s_com.Scell_used_IL.lna_off = *lna_off; | 241 l1a_l1s_com.Scell_used_IL.lna_off = *lna_off; |
274 WORD32 serving_index; | 274 WORD32 serving_index; |
275 UWORD16 arfcn; | 275 UWORD16 arfcn; |
276 UWORD8 lna_off; | 276 UWORD8 lna_off; |
277 UWORD16 dco_algo_ctl_pw_temp = 0; | 277 UWORD16 dco_algo_ctl_pw_temp = 0; |
278 UWORD8 if_ctl = 0; | 278 UWORD8 if_ctl = 0; |
279 #if (CODE_VERSION != SIMULATION) | 279 #if (RF_FAM == 61) && (CODE_VERSION != SIMULATION) |
280 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; | 280 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
281 #endif | 281 #endif |
282 | 282 |
283 #if (L1_FF_MULTIBAND == 0) | 283 #if (L1_FF_MULTIBAND == 0) |
284 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; | 284 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; |
291 // Calibration factors | 291 // Calibration factors |
292 delta1_freq = l1ctl_encode_delta1(radio_freq); | 292 delta1_freq = l1ctl_encode_delta1(radio_freq); |
293 delta2_freq = l1ctl_encode_delta2(radio_freq); | 293 delta2_freq = l1ctl_encode_delta2(radio_freq); |
294 | 294 |
295 // AGC used in the control phase (format F7.1) | 295 // AGC used in the control phase (format F7.1) |
296 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID, l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; | 296 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1; |
297 | 297 |
298 // LNA attenuation | 298 // LNA attenuation |
299 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); | 299 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); |
300 | 300 |
301 // DRP correction | 301 // DRP correction |
493 { | 493 { |
494 // Daughter frequency input_level used for AGC processing | 494 // Daughter frequency input_level used for AGC processing |
495 selected_IL = &l1a_l1s_com.Scell_info.transfer_meas; | 495 selected_IL = &l1a_l1s_com.Scell_info.transfer_meas; |
496 } | 496 } |
497 *lna_off = selected_IL->lna_off; | 497 *lna_off = selected_IL->lna_off; |
498 *agc = Cust_get_agc_from_IL(radio_freq,selected_IL->input_level >> 1, MAX_ID, *lna_off); | 498 *agc = Cust_get_agc_from_IL(radio_freq,selected_IL->input_level >> 1, MAX_ID); |
499 | 499 |
500 // Store lna_off and input_level field used for current CTRL in order to be able | 500 // Store lna_off and input_level field used for current CTRL in order to be able |
501 // to build IL from pm in READ phase. | 501 // to build IL from pm in READ phase. |
502 l1a_l1s_com.Scell_used_IL.input_level = selected_IL->input_level; | 502 l1a_l1s_com.Scell_used_IL.input_level = selected_IL->input_level; |
503 l1a_l1s_com.Scell_used_IL.lna_off = *lna_off; | 503 l1a_l1s_com.Scell_used_IL.lna_off = *lna_off; |
622 WORD32 serving_index; | 622 WORD32 serving_index; |
623 UWORD16 arfcn; | 623 UWORD16 arfcn; |
624 UWORD8 lna_off; | 624 UWORD8 lna_off; |
625 UWORD16 dco_algo_ctl_pw_temp = 0; | 625 UWORD16 dco_algo_ctl_pw_temp = 0; |
626 UWORD8 if_ctl = 0; | 626 UWORD8 if_ctl = 0; |
627 #if (CODE_VERSION != SIMULATION) | 627 #if (RF_FAM == 61) && (CODE_VERSION != SIMULATION) |
628 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; | 628 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
629 #endif | 629 #endif |
630 | 630 |
631 #if(L1_FF_MULTIBAND == 0) | 631 #if(L1_FF_MULTIBAND == 0) |
632 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; | 632 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; |
645 // Compute calibration factors | 645 // Compute calibration factors |
646 delta1_freq = l1ctl_encode_delta1(radio_freq); | 646 delta1_freq = l1ctl_encode_delta1(radio_freq); |
647 delta2_freq = l1ctl_encode_delta2(radio_freq); | 647 delta2_freq = l1ctl_encode_delta2(radio_freq); |
648 | 648 |
649 // AGC used in the control phase (format F7.1) | 649 // AGC used in the control phase (format F7.1) |
650 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID, l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; | 650 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1; |
651 | 651 |
652 // LNA attenuation | 652 // LNA attenuation |
653 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); | 653 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); |
654 | 654 |
655 // Burst 0: Reset ILmin_beacon and ILmin_others | 655 // Burst 0: Reset ILmin_beacon and ILmin_others |
1002 WORD32 serving_index; | 1002 WORD32 serving_index; |
1003 UWORD16 arfcn; | 1003 UWORD16 arfcn; |
1004 UWORD8 lna_off; | 1004 UWORD8 lna_off; |
1005 UWORD16 dco_algo_ctl_pw_temp = 0; | 1005 UWORD16 dco_algo_ctl_pw_temp = 0; |
1006 UWORD8 if_ctl = 0; | 1006 UWORD8 if_ctl = 0; |
1007 #if (CODE_VERSION != SIMULATION) | 1007 #if (RF_FAM == 61) && (CODE_VERSION != SIMULATION) |
1008 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; | 1008 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
1009 #endif | 1009 #endif |
1010 | 1010 |
1011 #if(L1_FF_MULTIBAND == 0) | 1011 #if(L1_FF_MULTIBAND == 0) |
1012 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; | 1012 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; |
1025 // Compute calibration factors | 1025 // Compute calibration factors |
1026 delta1_freq = l1ctl_encode_delta1(radio_freq); | 1026 delta1_freq = l1ctl_encode_delta1(radio_freq); |
1027 delta2_freq = l1ctl_encode_delta2(radio_freq); | 1027 delta2_freq = l1ctl_encode_delta2(radio_freq); |
1028 | 1028 |
1029 // Last known AGC (format F7.1) | 1029 // Last known AGC (format F7.1) |
1030 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; | 1030 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1; |
1031 | 1031 |
1032 // LNA attenuation | 1032 // LNA attenuation |
1033 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); | 1033 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); |
1034 | 1034 |
1035 // Burst 0: Reset ILmin_beacon and ILmin_others | 1035 // Burst 0: Reset ILmin_beacon and ILmin_others |
1318 WORD32 serving_index; | 1318 WORD32 serving_index; |
1319 UWORD16 arfcn; | 1319 UWORD16 arfcn; |
1320 UWORD8 lna_off; | 1320 UWORD8 lna_off; |
1321 UWORD16 dco_algo_ctl_pw_temp = 0; | 1321 UWORD16 dco_algo_ctl_pw_temp = 0; |
1322 UWORD8 if_ctl = 0; | 1322 UWORD8 if_ctl = 0; |
1323 #if (CODE_VERSION != SIMULATION) | 1323 #if (RF_FAM == 61) && (CODE_VERSION != SIMULATION) |
1324 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; | 1324 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
1325 #endif | 1325 #endif |
1326 | 1326 |
1327 #if(L1_FF_MULTIBAND == 0) | 1327 #if(L1_FF_MULTIBAND == 0) |
1328 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; | 1328 serving_index = l1a_l1s_com.Scell_info.radio_freq - l1_config.std.radio_freq_index_offset; |
1340 // Compute calibration factors | 1340 // Compute calibration factors |
1341 delta1_freq = l1ctl_encode_delta1(radio_freq); | 1341 delta1_freq = l1ctl_encode_delta1(radio_freq); |
1342 delta2_freq = l1ctl_encode_delta2(radio_freq); | 1342 delta2_freq = l1ctl_encode_delta2(radio_freq); |
1343 | 1343 |
1344 // Last known AGC (format F7.1) | 1344 // Last known AGC (format F7.1) |
1345 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; | 1345 used_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1; |
1346 | 1346 |
1347 // LNA attenuation | 1347 // LNA attenuation |
1348 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); | 1348 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); |
1349 | 1349 |
1350 // Burst 0: Reset ILmin_beacon and ILmin_others | 1350 // Burst 0: Reset ILmin_beacon and ILmin_others |
1579 WORD16 used_agc, current_IL, current_calibrated_IL, new_calibrated_IL; | 1579 WORD16 used_agc, current_IL, current_calibrated_IL, new_calibrated_IL; |
1580 WORD32 index; | 1580 WORD32 index; |
1581 UWORD16 arfcn; | 1581 UWORD16 arfcn; |
1582 UWORD16 dco_algo_ctl_pw_temp = 0; | 1582 UWORD16 dco_algo_ctl_pw_temp = 0; |
1583 UWORD8 if_ctl = 0; | 1583 UWORD8 if_ctl = 0; |
1584 #if (CODE_VERSION != SIMULATION) | 1584 #if (RF_FAM == 61) && (CODE_VERSION != SIMULATION) |
1585 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; | 1585 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GPRS; |
1586 #endif | 1586 #endif |
1587 | 1587 |
1588 // Calibration factors | 1588 // Calibration factors |
1589 delta1_freq = l1ctl_encode_delta1(radio_freq); | 1589 delta1_freq = l1ctl_encode_delta1(radio_freq); |
1600 | 1600 |
1601 // LNA attenuation | 1601 // LNA attenuation |
1602 lna_value = lna_off * l1ctl_get_lna_att(radio_freq); | 1602 lna_value = lna_off * l1ctl_get_lna_att(radio_freq); |
1603 | 1603 |
1604 // Used AGC in the control phase (format F7.1) | 1604 // Used AGC in the control phase (format F7.1) |
1605 used_agc = (Cust_get_agc_from_IL(radio_freq, last_known_il >> 1, PWR_ID, lna_off)) << 1; | 1605 used_agc = (Cust_get_agc_from_IL(radio_freq, last_known_il >> 1, PWR_ID)) << 1; |
1606 | 1606 |
1607 | 1607 |
1608 // DRP correction | 1608 // DRP correction |
1609 #if (L1_FF_MULTIBAND == 0) | 1609 #if (L1_FF_MULTIBAND == 0) |
1610 arfcn = Convert_l1_radio_freq(radio_freq); | 1610 arfcn = Convert_l1_radio_freq(radio_freq); |