⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ac97codec.h

📁 EP931X系列的WinCE声卡驱动源代码
💻 H
字号:
//**********************************************************************
//                                                                      
// Filename: ac97audio.h
//                                                                      
// Description: interface for the AC97 codec.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Use of this source code is subject to the terms of the Cirrus end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to 
// use this source code. For a copy of the EULA, please see the 
// LICENSE.RTF on your install media.
//
// Copyright(c) Cirrus Logic Corporation 2002, All Rights Reserved                       
//                                                                      
//**********************************************************************
#ifndef _H_AC97CODEC
#define _H_AC97CODEC

class AC97Codec : public CodecInterface
{
    public:
        AC97Codec(void);
        virtual MMRESULT Initialize(void );

        virtual MMRESULT    SetVolume
        (
            ULONG ulRightVolume, 
            ULONG ulLeftVolume, 
            ULONG ulChannel
        );

        virtual MMRESULT    SetRecordSampleRate(ULONG ulFrequency, ULONG ulChannel);
        virtual MMRESULT    SetPlaybackSampleRate(ULONG ulFrequency, ULONG ulChannel);
        virtual BOOL        HasSRC(void) { return TRUE; };
        virtual MMRESULT    StartRecord(ULONG ulChannel);
        virtual MMRESULT    StartPlayback(ULONG ulChannel);
        virtual MMRESULT    StopPlayback(ULONG ulChannel);
        virtual MMRESULT    StopRecord(ULONG ulChannel);
        virtual ULONG       GetDmaPort(void);
        virtual ULONG       DmaSampleSize(void) {return 16;}
        virtual             ~AC97Codec(void);



        //
        // Routines for debugging AC97 capture and playback.
        //
        void                ProducePIOTone(void);
        void                CapturePIO(void);
        void                CaptureNPlay(void);

        //
        // Functions to read and write the codec registers.
        //
        static MMRESULT PokeAC97(ULONG ulCodecReg, ULONG ulValue);
        static MMRESULT PeekAC97(UINT ulCodecReg, PULONG pulValue);


    private:
        volatile ULONG *    m_puAC97Ch;
        ULONG               m_ulRXCR;        
        ULONG               m_ulTXCR;

        // MMRESULT            SetSampleRate(ULONG ulFrequency, ULONG ulChannel);
        // MMRESULT            WriteCodecReg(UCHAR ucReg, UCHAR usValue);
        // MMRESULT            ReadCodecReg(UCHAR ucReg,  PUCHAR pucValue);
        // MMRESULT            WriteCodecRegSPI(UCHAR ucRegAddr, UCHAR ucRegValue);
        // void                ReadAllCodecReg(void);
        // CRITICAL_SECTION    m_CriticalSection;
        // ULONG               m_ulM2SClock;
        // ULONG               m_ulS2LRClock;
        // LARGE_INTEGER       m_PerfFreq;    
        // ULONG               m_ulActualFreq;
        // ULONG               m_ulCurrentFreq;
        // BOOL                m_bTwoWire;
};


#endif // _H_AC97CODEC

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -