rf_common.cpp
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:6k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * rf_common.cpp
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * RF common header
- *
- * Author:
- * -------
- * Andy Ueng (mtk00490)
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * $Revision$
- * $Modtime$
- * $Log$
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
-
- #pragma hdrstop
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- //-----------------------------------------------------------------------------
- const int Default_TrimIQ = 0;
- const int Default_OffsetIQ = 0;
- const int Default_TxCalbias = 0;
- const int Default_TxIQSwap = 0;
- const short Default_ARFCN[4] = { 0, 512, 512, 128 };
- const short Default_StartARFCN[4] = { 0, 512, 512, 128 };
- const short Default_StopARFCN[4] = {124, 885, 810, 251 };
- const int Default_PCL = 10;
- const int Default_AFC = 4100;
- const int Default_TA = 0;
- // BB TX parameters
- const int Default_BBTXCommonModeVoltage = 0;
- const int Default_BBTXGain = 0;
- const int Default_BBTXCalrcsel = 0;
- const int Default_BBTXPhasesel = 0;
- const int Default_APCBatLowVoltage = 0;
- const int Default_APCBatHighVoltage = 0;
- const int Default_APCBatLowTemperature = 0;
- const int Default_APCBatHighTemperature = 0;
- const int Trim_Setting_Map[] =
- { 7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8 };
- const int PCL_RANGE[][16] =
- {
- { 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4 },
- { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 },
- { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 },
- { 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4 },
- };
- const int NVRAM_APC_LOWEST_POWER[] =
- { 5, 0, 0, 5 };
- //-----------------------------------------------------------------------------
- FrequencyBand Get_FreqBandFromBandIndex( int band_idx )
- {
- FrequencyBand FreqBand;
- switch( band_idx )
- {
- case BANDSEL_GSM900:
- FreqBand = FrequencyBand900;
- break;
- case BANDSEL_DCS1800:
- FreqBand = FrequencyBand1800;
- break;
- case BANDSEL_PCS1900:
- FreqBand = FrequencyBand1900;
- break;
- case BANDSEL_GSM850:
- FreqBand = FrequencyBand850;
- break;
- }
- return FreqBand;
- }
- //---------------------------------------------------------------------------
- int Get_BandIndexFromFreqBand( FrequencyBand FreqBand )
- {
- int band_idx;
- switch( FreqBand )
- {
- case FrequencyBand850:
- band_idx = BANDSEL_GSM850;
- break;
- case FrequencyBand900:
- band_idx = BANDSEL_GSM900;
- break;
- case FrequencyBand1800:
- band_idx = BANDSEL_DCS1800;
- break;
- case FrequencyBand1900:
- band_idx = BANDSEL_PCS1900;
- break;
- }
- return band_idx;
- }
- //-----------------------------------------------------------------------------
- FrequencyBand Get_FreqBandFromAnsiString( AnsiString as_band )
- {
- FrequencyBand FreqBand;
- if( as_band.AnsiCompareIC("GSM") == 0 )
- {
- FreqBand = FrequencyBand900;
- }
- else if( as_band.AnsiCompareIC("DCS") == 0 )
- {
- FreqBand = FrequencyBand1800;
- }
- else if( as_band.AnsiCompareIC("PCS") == 0 )
- {
- FreqBand = FrequencyBand1900;
- }
- else if( as_band.AnsiCompareIC("GSM850") == 0 )
- {
- FreqBand = FrequencyBand850;
- }
-
- return FreqBand;
- }