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

📄 wmaudiointernal.h

📁 pxa270平台 windows mobile 5.2 wm9713 触摸屏+音频驱动
💻 H
字号:
/*-----------------------------------------------------------------------------
 * Copyright (c) Wolfson Microelectronics plc.  All rights reserved.
 *
 * This software as well as any related documentation is furnished under 
 * license and may only be used or copied in accordance with the terms of the 
 * license. The information in this file is furnished for informational use 
 * only, is subject to change without notice, and should not be construed as 
 * a commitment by Wolfson Microelectronics plc. Wolfson Microelectronics plc
 * assumes no responsibility or liability for any errors or inaccuracies that
 * may appear in this document or any software that may be provided in
 * association with this document. 
 *
 * Except as permitted by such license, no part of this document may be 
 * reproduced, stored in a retrieval system, or transmitted in any form or by 
 * any means without the express written consent of Wolfson Microelectronics plc. 
 *
 * $Id: WMAudioInternal.h 1639 2005-05-05 02:56:19Z ian $
 *
 * This file contains internal definitions for audio in the Wolfson library.
 * These definitions and functions are only used internally, and are not
 * exported to clients of the library.
 *
 * Warning:
 *  This driver is specifically written for Wolfson Codecs. It is not a 
 *  general CODEC device driver.
 *
 *---------------------------------------------------------------------------*/
#ifndef __WMAUDIOINTERNAL_H__
#define __WMAUDIOINTERNAL_H__

/*
 * Include files
 */
#include "WMAudio.h"
#include "WMWaveGen.h"

/*
 * Definitions
 */

/*
 * The external API uses the concept of audio streams.  These are
 * codec-independent - e.g. HiFi Stereo output, Voice input.  The DMA needs
 * to know exactly which channel to stream the data to or from, and has
 * specific channels for AC'97 output, SSP input, etc.  The mapping from
 * stream to channel is codec- and platform-specific.
 *
 * To simplify the mapping, we have another channel type.  This is the
 * codec-specific channel, but is still platform-independent.
 *
 * So we have:
 *   WM_STREAM_ID       external API stream - codec-independent
 *   WMAUDIO_CHANNEL    internal library channel - codec-specific
 *   WMDMA_CHANNEL      platform-level DMA channel
 * 
 * This section declares the internal WMAUDIO_CHANNEL type and values.
 */
typedef unsigned short WMAUDIO_CHANNEL;

#define WMAUDIO_AC97_STEREO_OUT     1
#define WMAUDIO_AC97_STEREO_IN      2
#define WMAUDIO_I2S_STEREO_OUT      3
#define WMAUDIO_I2S_STEREO_IN       4 
#define WMAUDIO_VOICE_OUT           5
#define WMAUDIO_VOICE_IN            6
#define WMAUDIO_AC97_MONO_OUT       7
#define WMAUDIO_DEFAULT_OUTPUT      101
#define WMAUDIO_DEFAULT_INPUT       102
#define WMAUDIO_INVALID_CHANNEL     ((WMAUDIO_CHANNEL) -1)
#define WMAUDIO_DEFINED_CHANNELS    7

/*
 * Various tests on the channels.
 */
#define WM_IS_INPUT_CHANNEL( _channel )         \
    ( WMAUDIO_AC97_STEREO_IN == _channel    ||  \
      WMAUDIO_I2S_STEREO_IN == _channel     ||  \
      WMAUDIO_VOICE_IN == _channel          ||  \
      WMAUDIO_DEFAULT_INPUT == _channel )
#define WM_IS_OUTPUT_CHANNEL( _channel )        \
    ( WMAUDIO_AC97_STEREO_OUT == _channel   ||  \
      WMAUDIO_I2S_STEREO_OUT == _channel    ||  \
      WMAUDIO_AC97_MONO_OUT == _channel     ||  \
      WMAUDIO_VOICE_OUT == _channel         ||  \
      WMAUDIO_DEFAULT_OUTPUT == _channel )
#define WM_IS_DEFAULT_CHANNEL( _channel )       \
    ( WMAUDIO_DEFAULT_INPUT == _channel     ||  \
      WMAUDIO_DEFAULT_OUTPUT == _channel )
#define WM_IS_VOICE_CHANNEL( _channel )         \
    ( WMAUDIO_VOICE_OUT == _channel         ||  \
      WMAUDIO_VOICE_IN == _channel )

/*
 * Microphone signal information fields
 */
typedef unsigned char WM_MIC_INFO;
#define WM_AUDIO_MIC_REC_BOOST      0x01
#define WM_AUDIO_MIC_REC_PGA        0x02
#define WM_AUDIO_MIC_REC_ALC        0x04

/* Check to see if the Microphone signal has a record boost facility */
#define WM_AUDIO_MIC_HAS_RECBOOST( _details )   \
                            ( ( _details ) && (_details)->micInfoFlags & WM_AUDIO_MIC_REC_BOOST )

/* Check to see if the Microphone signal has a record PGA */
#define WM_AUDIO_MIC_HAS_RECPGA( _details ) \
                            ( ( _details ) && (_details)->micInfoFlags & WM_AUDIO_MIC_REC_PGA )

/* Check to see if the Microphone signal has ALC facility */
#define WM_AUDIO_MIC_HAS_RECALC( _details ) \
                            ( ( _details ) && (_details)->micInfoFlags & WM_AUDIO_MIC_REC_ALC )


/*
 * Function prototypes
 */
#ifdef __cplusplus
extern "C" {
#endif

/*
 * Only provide these if we're doing audio support.
 */
/*-----------------------------------------------------------------------------
 * Function:    _WMAudioStreamToChannel
 *
 * Looks up the channel which corresponds to the given stream on this device.
 *
 * Parameters:
 *      hDevice     handle to the device (from WMOpenDevice)
 *      stream      the stream to convert
 *
 * Returns:     WMAUDIO_CHANNEL
 *      The channel to use, or WMAUDIO_INVALID_CHANNEL on error.
 *---------------------------------------------------------------------------*/
#if WM_AUDIO
    WMAUDIO_CHANNEL _WMAudioStreamToChannel( WM_DEVICE_HANDLE hDevice,
                                             WM_STREAM_ID stream
                                           );
#else
#	define _WMAudioStreamToChannel( _hDevice, stream ) WMAUDIO_INVALID_CHANNEL
#endif /* WM_AUDIO */

/*-----------------------------------------------------------------------------
 * Function:    _WMAudioGetRealStream
 *
 * This function returns the actual API stream corresponding to the stream
 * parameter.  This converts the default stream values to their corresponding
 * real stream values.
 *
 * Parameters:
 *      hDevice     handle to the device (from WMOpenDevice)
 *      stream      the stream to convert.
 *
 * Returns:     WM_STREAM_ID
 *      The real stream which should be used.
 *---------------------------------------------------------------------------*/
#if WM_AUDIO
	WM_STREAM_ID _WMAudioGetRealStream( WM_DEVICE_HANDLE hDevice, WM_STREAM_ID stream );
#else
#	define _WMAudioGetRealStream( _hDevice, stream ) WM_STREAM_INVALID_STREAM
#endif /* WM_AUDIO */

#ifdef __cplusplus
}   /* extern "C" */
#endif

#endif	/* __WMAUDIOINTERNAL_H__ */
/*------------------------------ END OF FILE ---------------------------------*/

⌨️ 快捷键说明

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