man_fdm.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:7k
- /*****************************************************************************
- * 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:
- * ---------
- * man_fdm.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * NVRAM access handling 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 _MAN_FDM_H_
- #define _MAN_FDM_H_
- #include <vcl.h>
- // audio
- #ifndef _AUDIO_COMMON_H_
- #include "audio_common.h"
- #endif
- // 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
- // NVRAM
- #ifndef _NVRAMEDITOR_H_
- #include "NVRAMEditor.h"
- #endif
- // RF
- #ifndef _RF_COMMON_H_
- #include "rf_common.h"
- #endif
- /*---------------------------------------------------------------------------*/
- #define NVRAM_STATUS_SUCCESS 0
- #define NVRAM_STATUS_FAIL 1
- /*---------------------------------------------------------------------------*/
- class CNVRAMMan
- {
- private:
- bool m_bIsInit;
- S_FORM_HANDLE_T m_sHandle;
- Variant m_vNVRAM_db_variant;
- unsigned long m_ulNvramIdb;
- E_METAAPP_RESULT_T m_eConfirmState;
- AnsiString m_asNVRAM_DB_File;
- CMETAHANDLE m_META_HANDLE_Obj;
- short m_sNVRAM_OPID;
- FT_NVRAM_READ_REQ *m_psNVRAM_ReadReq;
- FT_NVRAM_READ_CNF m_sNVRAM_ReadCnf;
- FT_NVRAM_WRITE_REQ *m_psNVRAM_WriteReq;
- const FT_NVRAM_WRITE_CNF *m_psNVRAM_WriteCnf;
- FT_NVRAM_RESET_REQ *m_psNVRAM_ResetReq;
- const FT_NVRAM_RESET_CNF *m_psNVRAM_ResetCnf;
- FT_NVRAM_RESET_REQ *m_psNVRAM_ResetDataReq;
- int m_iBufSize;
- char *m_cBuf;
- const char *m_cLID; // The name of logical data item ID
- unsigned short m_usRID; // Record ID
- unsigned char m_ucIsResetOk;
- int *m_iResetCountPtr;
- int m_iResetStatus;
- HANDLE m_WriteToNVRAMEvent;
- HANDLE m_ReadFromNVRAMEvent;
- // APC
- bool m_bVbiasSupport;
- // TX IQ
- E_NVRAM_BBTXCFG_VER_T m_eNvBbTxCfgVer;
- // audio
- E_AUDIO_FIR_VER_T m_eFirVer;
- bool m_bCustVolExSupport;
-
- protected:
- void Get_BbTxCfgVer_FromNVDB(void);
- void Confirm(E_METAAPP_RESULT_T confirm_state);
- public:
- // NVRAM
- void REQ_ReadNVRAM(void);
- void REQ_WriteNVRAM(void);
- void GetSupportInfoFromNVRAMDB(void);
- // call back
- void __stdcall CNF_ReadNVRAM(const FT_NVRAM_READ_CNF *cnf, const short token, void *usrData);
- void __stdcall CNF_WriteNVRAM(const FT_NVRAM_WRITE_CNF *cnf, const short token, void *usrData);
- void __stdcall CNF_ResetNVRAMData(const FT_NVRAM_RESET_CNF *cnf, const short token, void *usrData);
- void __stdcall CNF_ResetNVRAM(const FT_NVRAM_RESET_CNF *cnf, const short token, void *usrData);
- CNVRAMMan(void);
- ~CNVRAMMan();
- void REQ_Finish(void);
- void REQ_TimeOut(void);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- // Public member
- void (*ConfirmCallback)(void);
- void Init(char* fdm_database_file);
- void Init_NVRAM_DB(char* fdm_database_file);
- void REQ_Init(AnsiString as_file);
- void REQ_Init_NVRAM_DB(void);
- void REQ_Stop(void);
- void REQ_ReadNVRAM_Start(const char *LID_para, unsigned short RID, int size, char *buf);
- void REQ_WriteNVRAM_Start(const char *LID_para, unsigned short RID, int size, char *buf);
- void REQ_ResetNVRAMData_Start(const char *LID_para);
- void REQ_ResetNVRAMData(void);
- int REQ_ResetLayer1(int *ResetCountPtrPara);
- // Global information
- E_METAAPP_RESULT_T Get_ConfirmState(void);
- bool Get_IsInit(void);
- void Set_IsInit(bool is_init);
- AnsiString Get_NVRAM_DB_File(void);
- Variant Get_NvramDbVariant(void);
- void Set_NvramDbVariant(Variant variant);
- bool Get_VbiasSupport(void);
- E_NVRAM_BBTXCFG_VER_T Get_NvBbTxCfgVer(void);
- E_AUDIO_FIR_VER_T Get_FirVersion(void);
- bool Get_CustVolExSupport(void);
- void Set_FormHandle(S_FORM_HANDLE_T handle);
- };
- extern CNVRAMMan *NVRAMMan;
- /*---------------------------------------------------------------------------*/
- #endif