rf_common.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:10k
- /*****************************************************************************
- * 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.h
- *
- * 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!!
- *============================================================================
- ****************************************************************************/
- #ifndef _RF_COMMON_H_
- #define _RF_COMMON_H_
- #include <vcl.h>
- #include "meta.h"
- /*---------------------------------------------------------------------------*/
- // UI
- #define BTN_TAG_START 1
- #define BTN_TAG_STOP 0
- #define DRAW_PCL 0x001
- #define DRAW_VBIAS 0x002
- #define DRAW_RAMP 0x004
- #define DRAW_WEIGHT 0x008
- #define DRAW_BATTERY_COMPENSATE 0x010
- #define DRAW_TX_AFC_OFFSET 0x020
- #define DRAW_WORD3 0x040
- #define DRAW_BV 0x080
- #define DRAW_INTERSLOT_LOWEST_DAC 0x100
- #define DRAW_AD6546 0x200
- #define MOD_GMSK_INDEX 0
- #define MOD_EPSK_INDEX 1
- // image
- #define IN_RANGE 0
- #define OUT_OF_LEFT_RANGE 1
- #define OUT_OF_RIGHT_RANGE 2
- #define OUT_OF_TOP_RANGE 3
- #define OUT_OF_BOTTOM_RANGE 4
- // band
- #define MAX_SUPPORT_BAND_NUM 4
- // ARFCN
- #define ARFCN_END -1
- #define PCL_END -1
- typedef enum
- {
- BANDSEL_GSM900 = 0,
- BANDSEL_DCS1800,
- BANDSEL_PCS1900,
- BANDSEL_GSM850,
- BANDSEL_GSM400
- }E_BANDSEL;
- // TX IQ
- typedef enum
- {
- BBTXCFG_VER1 = 0,
- BBTXCFG_VER2,
- BBTXCFG_VER3,
- BBTXCFG_VER4,
- BBTXCFG_VER5
- }E_BBTXCFG_VER_T;
- typedef enum
- {
- NVRAM_BBTXCFG_VER1 = 0,
- NVRAM_BBTXCFG_VER2,
- NVRAM_BBTXCFG_VER3,
- NVRAM_BBTXCFG_VER4
- }E_NVRAM_BBTXCFG_VER_T;
- // scale
- #define RF_RX_GAIN_SCALE 8.0
- // modulation index
- #define MODU_GMSK_INDEX 0
- #define MODU_8PSK_INDEX 1
- // multislot
- #define MAX_SUPPORT_TIMESLOT_NUM 4
- // RX/TX
- typedef enum
- {
- DIR_RX = 0,
- DIR_TX
- }E_DIR_TXRX_T;
- // graphic ramp profile
- #define DRAW_GUI_PCL 0x1
- #define DRAW_GUI_RAMP 0x2
- #define PLOT_RAMP_GRID 0x01
- #define PLOT_RAMP_PROFILE_CURVE 0x02
- #define MAX_RAMP_DATA_VALUE 255
- // image
- #define RAMP_VSCALE_UNIT 5
- #define RAMP_VERTICAL_LABEL_NUM 10
- #define RAMP_UP_SAMPLE_NUM 16
- #define RAMP_DOWN_SAMPLE_NUM 16
- #define TOTAL_RAMP_SAMPLE_NUM (RAMP_UP_SAMPLE_NUM+RAMP_DOWN_SAMPLE_NUM)
- #define DATA_SAMPLE_NUM 8
- #define TOTAL_HORIZONTAL_SAMPLE ( TOTAL_RAMP_SAMPLE_NUM + DATA_SAMPLE_NUM )
- #define RAMP_CIRCLE_RADIOUS 6
- #define RAMP_UP_FLAG 0
- #define RAMP_DOWN_FLAG 1
- #define INTER_RAMP_SAMPLE_NUM 16
- // APC
- #define MIN_APC_DAC 0
- #define MAX_APC_DAC 1023
- #define MAX_APC_PCL_NUM 16
- #define APC_BATTERY_COMP_NUM 3
- #define APC_RAMP_UP_NUM 16
- #define APC_RAMP_DN_NUM 16
- // TX IQ
- #define MIN_OFFSET_IQ_OLD -32
- #define MAX_OFFSET_IQ_OLD 31
- #define MIN_OFFSET_IQ_NEW -64
- #define MAX_OFFSET_IQ_NEW 63
- #define MIN_TRIM_IQ -8
- #define MAX_TRIM_IQ 7
- #define MIN_CALBIAS_OLD -16
- #define MAX_CALBIAS_OLD 15
- #define MIN_CALBIAS_NEW -8
- #define MAX_CALBIAS_NEW 7
- #define MIN_PHASESEL_OLD -3
- #define MAX_PHASESEL_OLD 3
- #define MIN_PHASESEL_NEW -5
- #define MAX_PHASESEL_NEW 5
- #define BBTX_BATTERY_TEMP_SCALE 1000.0
- #define BBTX_BATTERY_VOLTAGE_SCALE 1000000.0
- #define BBTX_CALIBRATED_SCALE 191
- #define MIN_PA_VBIAS 0
- #define MAX_PA_VBIAS_MT6140 7
- #define MAX_PA_VBIAS_AERO2E 31
- //---------------------------------------------------------------------------
- typedef enum
- {
- GMSK=0,
- EPSK
- }E_MODULATION;
- //---------------------------------------------------------------------------
- typedef struct
- {
- int x[RAMP_DOWN_SAMPLE_NUM];
- int y[RAMP_DOWN_SAMPLE_NUM];
- }sRampPoint;
- typedef struct
- {
- int x;
- int y;
- }sPoint;
- typedef struct
- {
- sPoint LeftTop;
- sPoint RightBottom;
- }sImageRange;
- /*---------------------------------------------------------------------------*/
- typedef struct
- {
- // low band
- signed char bbtx_common_mode_voltage;
- signed char bbtx_gain;
- signed char bbtx_calrcsel;
- signed char bbtx_trimI;
- signed char bbtx_trimQ;
- signed char bbtx_offsetI;
- signed char bbtx_offsetQ;
- signed char bbtx_phsel;
- // high band
- signed char bbtx_common_mode_voltage_h;
- signed char bbtx_gain_h;
- signed char bbtx_calrcsel_h;
- signed char bbtx_trimI_h;
- signed char bbtx_trimQ_h;
- signed char bbtx_offsetI_h;
- signed char bbtx_offsetQ_h;
- signed char bbtx_phsel_h;
- // common
- double apc_bat_low_voltage;
- double apc_bat_high_voltage;
- double apc_bat_low_temperature;
- double apc_bat_high_temperature;
- unsigned char bbtx_isCalibrated;
- }S_BBTXPARAMETERS_UI;
- typedef struct
- {
- S_BBTXPARAMETERS_UI BBTXParameters;
- } S_UI_L1CAL_TXIQ;
- typedef struct {
- signed char TxTrimI;
- signed char TxTrimQ;
- signed char TxOffsetI;
- signed char TxOffsetQ;
- signed char TxCalbias;
- unsigned char TxIQSwap;
- signed char TxCMV;
- signed char TxGain;
- signed char TxCalrcsel;
- } ui_RfBBTXCfg2;
- //-------------------------------------------------------------------------
- // image
- typedef struct
- {
- int x;
- int y;
- }sRfPoint;
- // Renesas IP2
- typedef struct
- {
- sRfPoint LeftTop;
- sRfPoint RightBottom;
- }sRfImageRange;
- typedef struct
- {
- //int i_ta;
- //int i_tb;
- //int i_tc;
- unsigned char uc_tn;
- unsigned char uc_to;
- unsigned char uc_pm;
- unsigned char uc_addr;
- unsigned int c3mode;
- }sC3Mode;
- typedef struct
- {
- unsigned char uc_ap;
- unsigned char uc_as;
- unsigned char uc_ao;
- unsigned char uc_bd;
- }sBVW0;
- typedef struct
- {
- unsigned char uc_aof;
- unsigned char uc_ksg;
- unsigned char uc_ksd;
- unsigned char uc_are;
- unsigned char uc_kag;
- unsigned char uc_kad;
- unsigned char uc_vof;
- unsigned char uc_vre;
- }sBVW2;
- //-----------------------------------------------------------------------------
- extern const int Default_TrimIQ;
- extern const int Default_OffsetIQ;
- extern const int Default_TxCalbias;
- extern const int Default_TxIQSwap;
- extern const int Trim_Setting_Map[];
- extern const short Default_ARFCN[];
- extern const short Default_StartARFCN[];
- extern const short Default_StopARFCN[];
- extern const int Default_PCL;
- extern const int Default_AFC;
- extern const int Default_TA;
- extern const int PCL_RANGE[][16];
- extern const int NVRAM_APC_LOWEST_POWER[];
- // BB TX parameters
- extern const int Default_BBTXCommonModeVoltage;
- extern const int Default_BBTXGain;
- extern const int Default_BBTXCalrcsel;
- extern const int Default_BBTXPhasesel;
- extern const int Default_APCBatLowVoltage;
- extern const int Default_APCBatHighVoltage;
- extern const int Default_APCBatLowTemperature;
- extern const int Default_APCBatHighTemperature;
- //-----------------------------------------------------------------------------
- extern FrequencyBand Get_FreqBandFromBandIndex( int band_idx );
- extern int Get_BandIndexFromFreqBand( FrequencyBand FreqBand );
- extern FrequencyBand Get_FreqBandFromAnsiString( AnsiString as_band );
- #endif