fm_radio.h
上传用户: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:
- * ---------
- * fm_radio.h
- *
- * Project:
- * --------
- * Maui META APP
- *
- * Description:
- * ------------
- * FM radio 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 _FM_RADIO_H_
- #define _FM_RADIO_H_
- // 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
- /*---------------------------------------------------------------------------*/
- typedef enum
- {
- FM_DISABLE = 0,
- FM_ENABLE
- }E_FM_ENABLE_T;
- typedef struct
- {
- FM_IF_CNT_DELTA_REQ_T s_if_cnt_delta;
- FM_RSSI_THRESHOLD_REQ_T s_rssi_thrsh;
- FM_FREQ_RANGE_REQ_T s_freq_range;
- }S_FM_SEARCH_STATION_T;
- typedef struct
- {
- FM_RSSI_CNF_T s_rssi;
- FM_IF_CNT_CNF_T s_if_cnt;
- FM_HL_Side_CNF_T s_hl_side;
- FM_Stereo_Mono_CNF_T s_stero_mono;
- }S_FM_STATUS_T;
- typedef struct
- {
- //Audio_Set_Volume_Req s_vol;
- FM_MONO_STEREO_BLEND_REQ_T s_mono_stereo_blend;
- FM_SOFT_MUTE_ONOFF_REQ_T s_soft_mute_onoff;
- //FM_STAGE_REQ_T s_soft_mute_level;
- FM_STAGE_REQ_T s_stereo_blend_level;
- }S_FM_AUDIO_T;
- /*---------------------------------------------------------------------------*/
- class CFMRADIO
- {
- private:
- // common
- CMETAHANDLE m_META_HANDLE_Obj;
- E_METAAPP_RESULT_T m_eConfirmState;
- bool m_bFMSupport;
- FM_CHIP_ID_CNF_T m_sFMChipId;
- // frequecny
- FM_FREQ_REQ_T m_sFMFreq;
- // search station
- S_FM_SEARCH_STATION_T m_sSearchStation;
- FM_VAILD_FREQ_CNF_T m_sValidFreq;
- // RSSI & IF counter
- S_FM_STATUS_T m_sStatus;
- // volume
- short m_sSETVOLUME;
- S_FM_AUDIO_T m_sAudio;
- HANDLE m_hEvent;
- // data read/write
- unsigned char m_ucAddr;
- unsigned short m_usData;
- protected:
- public:
- void Confirm(E_METAAPP_RESULT_T confirm_state);
- CFMRADIO(void);
- ~CFMRADIO();
- // void REQ_Finish(void);
- // void REQ_TimeOut(void);
- void REQ_FM_Power_On(void);
- void REQ_FM_Power_Off(void);
- void REQ_Set_Freq(void);
- void REQ_SetRssiThreold(void);
- void REQ_SetAudio(void);
- void REQ_Get_FM_Status(void);
- void REQ_SearchFreq(void);
- void REQ_ReadData(void);
- void REQ_WriteData(void);
- void __stdcall CNF_AudioSetVolume(const AUDIO_RESULT status, const short token, void *usrData);
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
- void (*ConfirmCallback)(void);
- //---------------------------------------------------------------------------
- // Public interface
- void REQ_FM_Power_On_Start(void);
- void REQ_FM_Power_Off_Start(void);
- void REQ_Set_Freq_Start(FM_FREQ_REQ_T freq);
- //void REQ_SetRssiThreold_Start(FM_RSSI_THRESHOLD_REQ_T rssi_threshold);
- void REQ_Get_FM_Status_Start(void);
- void REQ_SearchFreq_Start(S_FM_SEARCH_STATION_T search_station);
- void REQ_SetAudio_Start(S_FM_AUDIO_T audio);
- void REQ_ReadData_Start(unsigned char addr);
- void REQ_WriteData_Start(unsigned char addr, unsigned short data);
- // query
- bool Query_FMSupport_Start(void);
- bool REQ_Query_FMChipID_Start(FM_CHIP_ID_CNF_T& fm_chip_id);
- // global information
- E_METAAPP_RESULT_T Get_ConfirmState(void);
- bool Get_FMSupport(void);
- FM_CHIP_ID_CNF_T* Get_FMChipID(void);
- S_FM_STATUS_T* Get_FMStatus(void);
- FM_VAILD_FREQ_CNF_T* Get_ValidFreq(void);
- unsigned short Get_Data(void);
- };
- /*---------------------------------------------------------------------------*/
- #endif