mt6139_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:
- * ---------
- * mt6139_common.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * MT6139 chip 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 _MT6139_COMMON_H_
- #define _MT6139_COMMON_H_
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- /*---------------------------------------------------------------------------*/
- // rxamcalmode
- #define RXAMCALMODE_MT6139B_READ_ACODE 0
- #define RXAMCALMODE_MT6139B_READ_BCCODE 1
- #define RXAMCALMODE_MT6139B_NORMAL 2
- #define RXAMCALMODE_MT6139C_READ_ACODE 0
- #define RXAMCALMODE_MT6139C_HOLD_BCCODE 1
- #define RXAMCALMODE_MT6139C_NORMAL 2
- // register read
- #define ADDR_MT6139_AUXOUT_CW0 0x0000010F
- #define ADDR_MT6139_AUXOUT_CW1 0x0000011F
- #define ADDR_MT6139_AUXOUT_CW2 0x0000012F // Acode
- #define ADDR_MT6139_AUXOUT_CW3 0x0000013F
- #define ADDR_MT6139_AUXOUT_CW4 0x0000014F
- #define ADDR_MT6139_AUXOUT_CW5 0x0000015F
- #define ADDR_MT6139_AUXOUT_CW6 0x0000016F
- #define ADDR_MT6139_AUXOUT_CW7 0x0000017F // AUTO_CAL
- #define ADDR_MT6139_AUXOUT_CW8 0x0000018F // BCCODEI
- #define ADDR_MT6139_AUXOUT_CW9 0x0000019F // BCCODEQ
- #define ADDR_MT6139_AUXOUT_CW10 0x000001AF
- #define ADDR_MT6139_AUXOUT_CW11 0x000001BF
- #define ADDR_MT6139_AUXOUT_CW15 0x000001FF
- // register write
- #define ADDR_MT6139_CW0 0x00
- #define ADDR_MT6139_CW1 0x01
- #define ADDR_MT6139_CW2 0x02 // Acode
- #define ADDR_MT6139_CW3 0x03
- #define ADDR_MT6139_CW4 0x04
- #define ADDR_MT6139_CW5 0x05
- #define ADDR_MT6139_CW6 0x06
- #define ADDR_MT6139_CW7 0x07 // AUTO_CAL
- #define ADDR_MT6139_CW8 0x08 // BCCODEI
- #define ADDR_MT6139_CW9 0x09 // BCCODEQ
- #define ADDR_MT6139_CW10 0x0A
- #define ADDR_MT6139_CW11 0x0B
- #define ADDR_MT6139_CW15 0x0C
- #define MT6139_CW0_AFC_LEN 6
- #define MT6139_CW0_SYNCP_LEN 2
- #define MT6139_CW1_BAND_LEN 2
- #define MT6139_CW1_N_INTEGER_LEN 7
- #define MT6139_CW1_N_FRACTION_LEN 8
- #define MT6139_CW2_DC_DAC_AI_LEN 6
- #define MT6139_CW2_DC_DAC_AQ_LEN 6
- #define MT6139_CW2_MODE_LEN 3
- #define MT6139_CW2_GAIN_TABLE_LEN 6
- #define MT6139_CW4_CAL_DELAY_LEN 2
- #define MT6139_CW4_VCO_VSET_LEN 2
- #define MT6139_CW4_CAL_MODE_LEN 2
- #define MT6139_CW4_SYN_PFD_LEN 2
- #define MT6139_CW5_RESB_LEN 5
- #define MT6139_CW5_RES_LEN 5
- #define MT6139_CW6_VCO_SCA_LEN 7
- #define MT6139_CW7_RX_GAIN_LEN 8
- #define MT6139_CW8_RX_CTRL_SW_LEN 5
- #define MT6139_CW8_DC_DAC_BI_LEN 7
- #define MT6139_CW8_DC_DAC_CI_LEN 7
- #define MT6139_CW9_DC_DAC_BQ_LEN 7
- #define MT6139_CW9_DC_DAC_CQ_LEN 7
- #define MT6139_CW10_AM_DACI_LEN 7
- #define MT6139_CW10_AM_DACQ_LEN 7
- #define MT6139_CW11_TXBIAST_LEN 2
- #define MT6139_CW11_TX_PW_LEN 2
- #define MT6139_CW11_TXVAPC_LEN 2
- #define MT6139_CW11_TXFLT_LEN 4
- #define MT6139_CW11_TXMODGAIN_LEN 3
- #define MT6139_CW15_AUXOUT_SELECTION_LEN 7
- #define MT6139_CW15_ADDRESS_DATA_OUT_LEN 4
- // CW2 mode
- #define MODE_MT6139_CW2_STAND_BY 0x02
- #define MODE_MT6139_CW2_RX 0x03
- #define MODE_MT6139_CW2_RX_AM_CAL 0x06
- // way of trigger to set MT6139 to register
- #define SET_MT6139_TO_COEF_REG_BY_GET_ACCODE 0
- #define SET_MT6139_TO_COEF_REG_BY_PM_START 1
- #define SET_MT6139_TO_COEF_REG_BY_GET_BCCCODE 2
- // way of trigger to set MT6139 CW2 to register
- #define SET_MT6139_CW2_TO_REG_BY_GET_ACODE 0
- #define SET_MT6139_CW2_TO_REG_BY_GET_BCCODE 1
- /*---------------------------------------------------------------------------*/
- typedef struct
- {
- unsigned char uc_por;
- unsigned char uc_gpo;
- unsigned char uc_vcosel;
- unsigned char uc_afc;
- unsigned char uc_flt;
- unsigned char uc_dien;
- unsigned char uc_synpw;
- unsigned char uc_syncp;
- }S_MT6139_CW0;
- typedef struct
- {
- unsigned char uc_trx;
- unsigned char uc_band;
- unsigned char uc_bufmode;
- unsigned char uc_n_integer;
- unsigned char uc_n_fraction;
- }S_MT6139_CW1;
- typedef struct
- {
- unsigned char uc_dc_dac_ai;
- unsigned char uc_dc_dac_aq;
- unsigned char uc_auto_cal; // only for MT6139C above
- unsigned char uc_mode;
- unsigned char uc_gain_table;
- }S_MT6139_CW2;
- typedef struct
- {
- unsigned char uc_txdivil;
- unsigned char uc_rfmixpi;
- unsigned char uc_rfmixpq;
- unsigned char uc_rfmixp;
- unsigned char uc_rflnap;
- unsigned char uc_syndivp;
- unsigned char uc_synpfdp;
- unsigned char uc_rxdivp;
- unsigned char uc_ifpgap2;
- unsigned char uc_ifpgap1;
- unsigned char uc_ifpolp;
- }S_MT6139_CW3;
- typedef struct
- {
- unsigned char uc_otaen;
- unsigned char uc_fldis;
- unsigned char uc_cal_delay;
- unsigned char uc_vco_vset;
- unsigned char uc_dread;
- unsigned char uc_calmode;
- unsigned char uc_lgac;
- unsigned char uc_modreg;
- unsigned char uc_c_fra_in;
- unsigned char uc_sxrstdiv;
- unsigned char uc_syntyp;
- unsigned char uc_synpfd;
- unsigned char uc_sca_cr_fi;
- }S_MT6139_CW4;
- typedef struct
- {
- unsigned char uc_rx_lna_mid;
- unsigned char uc_rx_ft0;
- unsigned char uc_rx_ft1;
- unsigned char uc_rx_qt0;
- unsigned char uc_rx_qt1;
- unsigned char uc_rx_resb;
- unsigned char uc_resb;
- unsigned char uc_res;
- }S_MT6139_CW5;
- typedef struct
- {
- unsigned char uc_t_clk;
- unsigned char uc_t_latch;
- unsigned char uc_vco_bufp;
- unsigned char uc_monitor;
- unsigned char uc_sio5;
- unsigned char uc_vco_sca;
- unsigned char uc_vcoset;
- }S_MT6139_CW6;
- typedef struct
- {
- unsigned char uc_reserved;
- unsigned char uc_lo_vsw;
- unsigned char uc_lpf_corner;
- unsigned char uc_auto_cal;
- unsigned char uc_man_cal; // MT6139E above
- unsigned char uc_auto_gain_select;
- unsigned char uc_rx_gain;
- }S_MT6139_CW7;
- typedef struct
- {
- unsigned char uc_reserved;
- unsigned char uc_rx_ctrl_sw; // MT6139E above
- unsigned char uc_rx_ctrl_swen; // MT6139E above
- unsigned char uc_dc_dac_bi;
- unsigned char uc_dc_dac_ci;
- }S_MT6139_CW8;
- typedef struct
- {
- unsigned char uc_reserved;
- unsigned char uc_pwr_dac_am; // MT6139E above
- unsigned char uc_pwr_dac_a; // MT6139E above
- unsigned char uc_pwr_dac_b; // MT6139E above
- unsigned char uc_pwr_dac_c; // MT6139E above
- unsigned char uc_dc_dac_bq;
- unsigned char uc_dc_dac_cq;
- }S_MT6139_CW9;
- typedef struct
- {
- unsigned char uc_reserved;
- unsigned char uc_am_daci;
- unsigned char uc_am_dacq;
- }S_MT6139_CW10;
- typedef struct
- {
- unsigned char uc_txdiv_gc1;
- unsigned char uc_txdiv_gc0;
- unsigned char uc_txbiast;
- unsigned char uc_tx_pw;
- unsigned char uc_txvapc;
- unsigned char uc_txflt;
- unsigned char uc_txmodgain;
- unsigned char uc_txdbuf;
- unsigned char uc_txgbuf;
- unsigned char uc_txdiv4;
- unsigned char uc_txdiv2;
- unsigned char uc_txdiqm;
- unsigned char uc_txgiqm;
- unsigned char uc_txctl;
- }S_MT6139_CW11;
- typedef struct
- {
- unsigned char uc_auxout_selection;
- unsigned char uc_address_data_out;
- }S_MT6139_CW15;
- #endif