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

📄 ac97.h

📁 Windows CE 6.0 BSP for VOIP sample phone. Intel PXA270 platform.
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//

/*++

$Workfile: AC97.H $

$Date: 1/11/05 4:40p $

Abstract:  
    Header file for AC 97 specific functions

Functions:

Notes: 

--*/


/* 
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** Portions of the source code contained or described herein and all documents
** related to such source code (Material) are owned by Intel Corporation
** or its suppliers or licensors and is licensed by Microsoft Corporation for distribution.  
** Title to the Material remains with Intel Corporation or its suppliers and licensors. 
** Use of the Materials is subject to the terms of the Microsoft license agreement which accompanied the Materials.  
** No other license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise 
** Some portion of the Materials may be copyrighted by Microsoft Corporation.
*/



#ifndef __XSC_AC97_H__
#define __XSC_AC97_H__

// Index of Codec Registers on AC-link.
// Note:  Only items having a "Usage" comment are actively used by the driver.        

//      Register Name           Index           // Usage
//-----------------------------------------------------------------------
#define RESET                   0X00            // RESET CODEC TO DEFAULT                   
#define MASTER_VOLUME           0X02            // LINE OUT VOLUME
#define HEADPHONE_VOLUME        0X04
#define MASTER_VOLUME_MONO      0X06
#define MASTER_TONE_R_L         0X08
#define PC_BEEP_VOLUME          0X0A
#define PHONE_VOLUME            0X0C
#define MIC_VOLUME              0X0E            // MICROPHONE VOLUME/ AGC
#define LINE_IN_VOLUME          0X10            // LINE IN VOLUME
#define CD_VOLUME               0X12
#define VIDEO_VOLUME            0X14
#define AUX_VOLUME              0X16
#define PCM_OUT_VOL             0X18
#define RECORD_SELECT           0X1A            // SELECT LINE IN OR MICROPHONE
#define RECORD_GAIN             0X1C
#define RECORD_GAIN_MIC         0X1E            //undefined for UCB1400
#define GENERAL_PURPOSE         0X20
#define CONTROL_3D              0X22
#define ADDTL_POWERDOWN_CTRL_STAT 0X24
#define POWERDOWN_CTRL_STAT     0X26            // POWER MANAGEMENT
#define EXTENDED_AUDIO_ID       0X28
#define EXTENDED_AUDIO_CTRL     0X2A            // BIT 0 must be set to 1 for variable rate audio
#define AUDIO_DAC_RATE          0X2C            // 16 bit unsigned is sample rate in hertz
#define AUDIO_ADC_RATE          0X32            // 16 bit unsigned is sample rate in hertz

//Wolfson
#define AUGPIO_PIN_DIR          0x4c            //GPIO pins input/output
#define AUGPIO_PIN_POL          0x4e            //GPIO pins polarity
#define AUGPIO_PIN_STICK        0x50            //GPIO pins sticky
#define AUGPIO_PIN_STATUS       0x54            // GPIO pins status
#define AUGPIO_PIN_FUNC         0x56            //16 bit register to config GPIO pins as other functions
#define AUADD_FUNC1             0x58            //16bit Additional Function 1 register
#define AUADD_FUNC2             0x5C            //16bit Additional Analog Function 2 register

#define ALC_CONTROL             0x60            // ALC control
#define ALC_NG_CONTROL          0x62

#define VENDOR_ID1              0x7c            // id first 16 bits
#define VENDOR_ID2              0x7e            // id second 16 bits

#define VRA_ENABLED_MASK        0x1             // VRA bit set to 1 enables sample rate conversion


#define BASS_BIT_POSTN          (0x1u<<11)
#define TREB_BIT_POSTN          (0x1u<<00)
#define MODE_BIT_POSTN          (0x1u<<07)

//power management bits
#define PWR_ADC                 (0x1)
#define PWR_DAC                 (0x1<<1)
#define PWR_ANL                 (0x1<<2)
#define PWR_REF                 (0x1<<3)
#define PWR_PR0                 (0x1<<8) //write this bit to power down the adc
#define PWR_PR1                 (0x1<<9) //write this bit to power down the dac
#define PWR_PR0_ADC             (0x1<<8) //write this bit to power down the adc
#define PWR_PR1_DAC             (0x1<<9) //write this bit to power down the dac
#define PWR_PR2                 (0x1<<10)
#define PWR_PR3                 (0x1<<11)
#define PWR_PR4                 (0x1<<12)
#define PWR_PR5                 (0x1<<13)
#define PWR_PR6                 (0x1<<14)
#define PWR_EAPD                (0x1<<15)

//smart power bits
#define PWR_SLP0                (0x1<<4)
#define PWR_SLP1                (0x1<<5)
//#define PWR_SMART_NONE          
#define PWR_SMART_CODEC         PWR_SLP0
#define PWR_SMART_PLL           PWR_SLP1
#define PWR_SMART_BOTH          (PWR_SLP0 & PWR_SLP1)

// Volume Specific Bits
#define MUTE_VOL                0X8000

#define RECORD_GAIN_MAX         0X0f0f
#define RECORD_GAIN_MIN         0X0
#define MUTE_MASK               0x8000

#define AUDIO_LINE_INPUT_STEREO 0X4040
#define AUDIO_MIC_INPUT_MONO     0X0

// Codec Register Masks.

#define MASTER_VOLUME_R_MASK    0x0000003F      // 5 bits required. 6 optional.
#define MASTER_VOLUME_SHIFT     8               // Left volume bit2 13:8

                                                //   Bit 7 is zero for writes.
// Useful Constants
#define DWORD_ZEROS     ((DWORD)0x00000000)


#endif // __XSC_AC97_H__

⌨️ 快捷键说明

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