FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_ctl.c @ 91:51f3b9364365
l1_ctl.c: l1ctl_dpagc() reconstructed
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 07 Apr 2016 14:46:04 +0000 |
parents | 1bcd93a7c518 |
children | 3ef2a5f83a8e |
comparison
equal
deleted
inserted
replaced
90:1bcd93a7c518 | 91:51f3b9364365 |
---|---|
2518 WORD16 delta_drp_gain=0; | 2518 WORD16 delta_drp_gain=0; |
2519 UWORD8 i; | 2519 UWORD8 i; |
2520 UWORD8 *tab_ptr; | 2520 UWORD8 *tab_ptr; |
2521 T_DEDIC_SET *aset; | 2521 T_DEDIC_SET *aset; |
2522 WORD32 lna_value; | 2522 WORD32 lna_value; |
2523 UWORD16 arfcn; | 2523 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2524 UWORD16 arfcn; | |
2525 #endif | |
2524 UWORD8 lna_off; | 2526 UWORD8 lna_off; |
2525 UWORD16 dco_algo_ctl_pw_temp = 0; | 2527 UWORD16 dco_algo_ctl_pw_temp = 0; |
2526 UWORD8 if_ctl = 0; | 2528 UWORD8 if_ctl = 0; |
2527 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) | 2529 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2528 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; | 2530 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; |
2529 #endif | 2531 #endif |
2530 | 2532 |
2531 delta1_freq = l1ctl_encode_delta1(radio_freq); | 2533 delta1_freq = l1ctl_encode_delta1(radio_freq); |
2532 delta2_freq = l1ctl_encode_delta2(radio_freq); | 2534 delta2_freq = l1ctl_encode_delta2(radio_freq); |
2533 | 2535 |
2564 // in the associated CTL task to build the agc used in this CTL. | 2566 // in the associated CTL task to build the agc used in this CTL. |
2565 | 2567 |
2566 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); | 2568 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); |
2567 } | 2569 } |
2568 | 2570 |
2569 #if (L1_FF_MULTIBAND == 0) | 2571 #if (RF_RAM == 61) && (CODE_VERSION != SIMULATION) |
2572 #if (L1_FF_MULTIBAND == 0) | |
2570 arfcn = Convert_l1_radio_freq(radio_freq); | 2573 arfcn = Convert_l1_radio_freq(radio_freq); |
2571 #else | 2574 #else |
2572 arfcn=radio_freq; | 2575 arfcn = radio_freq; |
2573 #endif | 2576 #endif |
2577 #endif | |
2574 | 2578 |
2575 #if(RF_FAM == 61) | 2579 #if(RF_FAM == 61) |
2576 #if (CODE_VERSION != SIMULATION) | 2580 #if (CODE_VERSION != SIMULATION) |
2577 | 2581 |
2578 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , | 2582 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw_temp, &if_ctl, (UWORD8) L1_IL_VALID , |
2589 | 2593 |
2590 #endif | 2594 #endif |
2591 #endif | 2595 #endif |
2592 | 2596 |
2593 if (0==pm) // Check and filter illegal pm value by using last valid IL | 2597 if (0==pm) // Check and filter illegal pm value by using last valid IL |
2594 new_IL = IL_info_ptr->input_level; | 2598 new_IL = IL_info_ptr->input_level - lna_value; |
2595 else | 2599 else |
2596 new_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq)); | 2600 new_IL = -(pm - (last_known_agc - delta_drp_gain) + lna_value - l1ctl_get_g_magic(radio_freq)); |
2597 | 2601 |
2598 current_calibrated_IL = new_IL - delta1_freq - delta2_freq; | 2602 current_calibrated_IL = new_IL - delta1_freq - delta2_freq; |
2599 | 2603 |
2676 // input_level is always store with lna_on | 2680 // input_level is always store with lna_on |
2677 l1ctl_encode_lna( (UWORD8)(current_calibrated_IL>>1), | 2681 l1ctl_encode_lna( (UWORD8)(current_calibrated_IL>>1), |
2678 &(IL_info_ptr->lna_off), | 2682 &(IL_info_ptr->lna_off), |
2679 radio_freq ); | 2683 radio_freq ); |
2680 | 2684 |
2681 IL_info_ptr->input_level = (UWORD8)new_IL ; | 2685 IL_info_ptr->input_level = (UWORD8)new_IL + l1ctl_get_lna_att(radio_freq) * |
2686 IL_info_ptr->lna_off; | |
2682 | 2687 |
2683 #if L2_L3_SIMUL | 2688 #if L2_L3_SIMUL |
2684 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC) | 2689 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC) |
2685 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, | 2690 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, |
2686 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID)); | 2691 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID)); |