rf_apc_8psk.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_apc_8psk.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * 8PSK RF APC 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_APC_8PSK_H_
- #define _RF_APC_8PSK_H_
- #include <IniFiles.hpp>
- // common
- #ifndef _METAAPP_COMMON_H_
- #include "metaapp_common.h"
- #endif
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- #ifndef _MAN_HANDLE_H_
- #include "man_handle.h"
- #endif
- // RF
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- /*---------------------------------------------------------------------------*/
- #define LOW_VOLTAGE_8PSK_INDEX 0
- #define MID_VOLTAGE_8PSK_INDEX 1
- #define HIGH_VOLTAGE_8PSK_INDEX 2
- #define LOW_TEMPERATURE_8PSK_INDEX 0
- #define MID_TEMPERATURE_8PSK_INDEX 1
- #define HIGH_TEMPERATURE_8PSK_INDEX 2
- #define BATTERY_COMPENSATE_8PSK_SCALE 16384
- #define MAX_PA_VBIAS_NUM 8
- #define A60111A_WEIGHT_OFFSET 4
- /*---------------------------------------------------------------------------*/
- /*---------------------------------------------------------------------------*/
- typedef struct
- {
- bool EpskSetRampTableSupport;
- bool valid;
- }
- sRFEPSKSETRAMP;
- typedef struct
- {
- l1cal_rampTable_T s_ramp_table[MAX_SUPPORT_BAND_NUM];
- mt6140tx s_pa_vbias;
- ad6546tx s_ad6546;
- }S_EPSK_RAMP_T;
- /*---------------------------------------------------------------------------*/
- class CRFAPC8PSK
- {
- private:
- // common
- bool m_bDownloadTrigger;
- unsigned int m_uiRfModId;
- E_METAAPP_RESULT_T m_eConfirmState;
- CMETAHANDLE m_META_HANDLE_Obj;
-
- // band
- RFBandSupport_S band_support;
-
- // APC
- int CurWRBand;
- short RampApcLevelToken;
- int ApcBufSize;
- char *ApcBuf;
- // Vbias
- //bool m_VbiasSupport;
- int m_VbiasBufSize;
- char *m_VbiasBuf;
- // AD6546 special coefficient
- int m_iAD6546BufSize;
- char* m_cAD6546Buf;
- // B5P
- int B5PBufSize;
- char *B5PBuf;
- RF_BRIGHT5P_Coef_T b5p_coef;
- unsigned int W6S;
- unsigned short m_usHighApcDcOffset[MAX_SUPPORT_BAND_NUM];
- S_EPSK_RAMP_T m_sEpskRamp;
- // l1cal_rampTable_T m_sApcProfile[MAX_SUPPORT_BAND_NUM];
- unsigned char m_ucInterslotLowestDAC[MAX_SUPPORT_BAND_NUM];
- bool m_bSingleBand;
- RfSetRampApcLevel_Req RampApcLevelReq;
- bool *p_rf_epsk_set_ramp_table_support;
- // set EPSK level
- RfSetRampApcLevel_Req *m_pRfSetApcDac;
-
- protected:
- public:
- void Confirm(E_METAAPP_RESULT_T confirm_state);
- CRFAPC8PSK(void);
- ~CRFAPC8PSK();
- // NVRAM read/write
- void REQ_ReadApcFromNVRAM(void);
- void CNF_ReadApcFromNVRAM(void);
- void REQ_WriteApcToNVRAM(void);
- void CNF_WriteApcToNVRAM(void);
- void REQ_ReadVbiasFromNVRAM(void);
- void CNF_ReadVbiasFromNVRAM(void);
- void REQ_WriteVbiasToNVRAM(void);
- void CNF_WriteVbiasToNVRAM(void);
- void REQ_ReadAD6546CoefFromNVRAM(void);
- void CNF_ReadAD6546CoefFromNVRAM(void);
- void REQ_WriteAD6546CoefToNVRAM(void);
- void CNF_WriteAD6546CoefToNVRAM(void);
- void CNF_ReadWord3FromNVRAM(void);
- void CNF_WriteWord3ToNVRAM(void);
- void CNF_ReadB5PFromNVRAM(void);
- void CNF_WriteB5PToNVRAM(void);
- // BV
- void Compose_word6_4_0(sBVW0 &bvw0, unsigned int &word6_4_0);
- void Compose_word6_5_0(sBVW0 &bvw0, unsigned int &word6_5_0);
- void Compose_word6_6_0(sBVW0 &bvw0, unsigned int &word6_6_0);
- void Compose_word6_7_0(sBVW0 &bvw0, unsigned int &word6_7_0);
- void DeCompose_word6_x_0(unsigned int &word6_x_0, sBVW0 &bvw6x0);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- // Public member
- void (*ConfirmCallback)( void );
- // Public interface
- void REQ_Stop( void );
- void REQ_Read_APC_From_NVRAM_Start(unsigned int rf_id);
- void REQ_Read_APC_From_NVRAM_Single_Band_Start(unsigned int rf_id, int band);
- void REQ_Write_APC_To_NVRAM_Start(unsigned int rf_id);
- void REQ_Write_APC_To_NVRAM_Single_Band_Start(unsigned int rf_id, int band);
- // void REQ_Read_WORD3_From_NVRAM( void );
- // void REQ_Write_WORD3_To_NVRAM( void );
- void REQ_Read_B5P_From_NVRAM( void );
- void REQ_Write_B5P_To_NVRAM( void );
- // ini
- bool ApcGSM850SectionExist( char *filename );
- bool ApcGSM900SectionExist( char *filename );
- bool ApcDCS1800SectionExist( char *filename );
- bool ApcPCS1900SectionExist( char *filename );
- bool ApcSectionExist( char *filename, int band );
- bool AnyApcSectionExist( char *filename );
- bool RenesasWord3SectionExist( char *filename );
- bool RenesasWord6sSectionExist( char *filename );
- bool REQ_Read_APC_From_File_Single_Band(char *filename, unsigned int rf_id, int band);
- bool REQ_Read_APC_From_File(char *filename, unsigned int rf_id);
- bool REQ_Read_Word3_From_File( char *filename );
- bool REQ_Read_Word6s_From_File( char *filename );
- bool REQ_Read_W64_From_File( TIniFile *ini_file );
- bool REQ_Read_W65_From_File( TIniFile *ini_file );
- bool REQ_Read_W66_From_File( TIniFile *ini_file );
- bool REQ_Read_W67_From_File( TIniFile *ini_file );
- bool REQ_Write_APC_To_File_Single_Band(char *filename, unsigned int rf_id, int band);
- bool REQ_Write_APC_To_File(char *filename, unsigned int rf_id);
- bool REQ_Write_Word3_To_File( char *filename );
- bool REQ_Write_Word6s_To_File( char *filename );
- bool REQ_Write_W64_To_File( TIniFile *ini_file );
- bool REQ_Write_W65_To_File( TIniFile *ini_file );
- bool REQ_Write_W66_To_File( TIniFile *ini_file );
- bool REQ_Write_W67_To_File( TIniFile *ini_file );
- bool REQ_Write_To_M12193(char *filename, unsigned int rf_id);
- //bool Req_SetWord3ToReg( RF_BRIGHT5P_Coef_T &rf_mod_coef );
- bool Req_SetB5PToReg(RF_BRIGHT5P_Coef_T rf_mod_coef);
- bool Set_RenesasCoef(RF_BRIGHT5P_Coef_T rf_mod_coef);
- bool Get_RenesasCoef(RF_BRIGHT5P_Coef_T &rf_mod_coef);
- bool Set_W6sImmediateBSI(unsigned int w6s);
- bool Get_BvMode(void);
- void Set_BvMode(unsigned int bvmode);
- void Compose_wordC3(sC3Mode c3mode, unsigned int &wordC3);
- void DeCompose_wordC3(unsigned int wordC3, sC3Mode& c3mode);
- void REQ_SetW6sImmediateBSI_Start(unsigned int w6s);
- void REQ_SetW6sImmediateBSI(void);
- void REQ_EPSK_SetRampApcLevel_Start( RfSetRampApcLevel_Req *req );
- void REQ_EPSK_SetRampApcLevel( void );
- // runtime setting
- void REQ_RfEPSKSetRampTable_Start( int band_idx );
- bool REQ_RfEPSKSetRampTable( void );
- // query
- void Query_RfEPSKSetRampTable_Start( bool &RfEPSKSetRampTableSupport );
- bool Query_RfEPSKSetRampTable( void );
- // global information
- E_METAAPP_RESULT_T Get_ConfirmState( void );
- S_EPSK_RAMP_T* Get_ApcProfile(void);
- void Set_ApcProfile(S_EPSK_RAMP_T apc_profile);
- unsigned short Get_ApcProfilePower( int band_idx, int pcl_idx );
- void Set_ApcProfilePower( int band_idx, int pcl_idx, unsigned short power );
- short Get_TxAfcOffset( int band_idx, int pcl_idx );
- void Set_TxAfcOffset( int band_idx, short tx_afc_offset );
- unsigned char Get_InterslotLowestDAC( int band_idx );
- void Set_InterslotLowestDAC( int band_idx, unsigned char dac );
- };
- /*---------------------------------------------------------------------------*/
- #endif