📄 wmaudiopaths.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: WMAudioPaths.h 2819 2006-03-27 08:03:10Z fb $
*
* This file contains definitions and routines for controlling audio paths.
*
* NOTE: This code is here as an example. Each application is different
* and the input paths require will vary. You should optimise these functions
* for your particular application.
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
*---------------------------------------------------------------------------*/
#ifndef __WMAUDIOPATHS_H__
#define __WMAUDIOPATHS_H__
/*
* Include files
*/
#include "WMStatus.h"
#include "WMTypes.h"
#include "WMAudio.h"
/*
* Definitions
*/
/*
* Only build this if we are asked to.
*/
#if WM_AUDIO
/*
* Function prototypes
*/
#ifdef __cplusplus
extern "C" {
#endif
/*-----------------------------------------------------------------------------
* Function: WMAudioMuteAllOutputs
*
* This function will mute or unmute the outputs depending on the value of
* the parameter mute.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* mute TRUE to mute the outputs. FALSE to unmute the outputs.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioMuteAllOutputs( WM_DEVICE_HANDLE hDevice, WM_BOOL mute );
/*-----------------------------------------------------------------------------
* Function: WMAudioMuteAllInputs
*
* This function will mute or unmute the inputs depending on the value of
* the parameter mute.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* mute TRUE to mute the inputs. FALSE to unmute the inputs.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioMuteAllInputs( WM_DEVICE_HANDLE hDevice, WM_BOOL mute );
/*-----------------------------------------------------------------------------
* Function: WMAudioSetRecPaths
*
* Set up the given signals left and/or right channel record paths to the ADC.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* signalL signal to record on the left channel.
* signalR signal to record on the right channel.
*
* Returns: WMSTATUS
* WMS_UNSUPPORTED there is no guarantee that any record paths
* been set as one of the parameters was unsupported.
* For all other return values see WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioSetRecPaths( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_SIGNAL signalL,
WM_AUDIO_SIGNAL signalR
);
/*-----------------------------------------------------------------------------
* Function: WMAudioClearRecPaths
*
* Called to clear the signals PGA's for the input to the record ADCs.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice).
* signalL signal to clear on the left record channel.
* signalR signal to clear on the right record channel.
*
* Returns: WMSTATUS
* WMS_UNSUPPORTED there is no guarantee that any record paths been
* cleared as one of the parameters was unsupported.
* For all other return values see WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioClearRecPaths( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_SIGNAL signalL,
WM_AUDIO_SIGNAL signalR
);
/*-----------------------------------------------------------------------------
* Macro: WMAudioSetLineInRecPath
*
* Set up Line In to ADC as the record path.
*
* Parameters:
* _hDevice handle to the device (from WMOpenDevice)
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
#define WMAudioSetLineInRecPath( _hDevice ) \
WMAudioSetLineInRecPaths( _hDevice, \
WM_AUDIO_LINEIN, \
WM_AUDIO_LINEIN \
)
/*-----------------------------------------------------------------------------
* Macro: WMAudioClearLineInRecPath
*
* Clear down the Line In to ADC record path.
*
* Parameters:
* _hDevice handle to the device (from WMOpenDevice)
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
#define WMAudioClearLineInRecPath( _hDevice ) \
WMAudioClearLineInRecPaths( _hDevice, \
WM_AUDIO_LINEIN, \
WM_AUDIO_LINEIN \
)
/*-----------------------------------------------------------------------------
* Function: WMAudioSetLineInRecPaths
*
* Set up Line In, left and/or right channels as the record path.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* lineInL line In signal to record on left ADC channel.
* lineInR line In signal to record on right ADC channel.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioSetLineInRecPaths( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_SIGNAL lineInL,
WM_AUDIO_SIGNAL lineInR
);
/*-----------------------------------------------------------------------------
* Function: WMAudioClearLineInRecPaths
*
* Turns off the Line In as the record path.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* lineInL line In signal to clear on left ADC channel.
* lineInR line In signal to clear on right ADC channel.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioClearLineInRecPaths( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_SIGNAL lineInL,
WM_AUDIO_SIGNAL lineInR
);
/*-----------------------------------------------------------------------------
* Macro: WMAudioSetMicRecPath
*
* Set up a microphone path to ADC left and/or right channels as the
* record path.
*
* Parameters:
* _hDevice handle to the device (from WMOpenDevice)
* _micSignal microphone input to use.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
#define WMAudioSetMicRecPath( _hDevice, _micSignal) \
WMAudioSetMicRecPaths( _hDevice, \
_micSignal, \
_micSignal \
)
/*-----------------------------------------------------------------------------
* Macro: WMAudioClearMicRecPath
*
* Set up a microphone path to ADC left and/or right channels as the
* record path.
*
* Parameters:
* _hDevice handle to the device (from WMOpenDevice)
* _micSignal microphone input to use.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
#define WMAudioSetMicRecPath( _hDevice, _micSignal) \
WMAudioSetMicRecPaths( _hDevice, \
_micSignal, \
_micSignal \
)
/*-----------------------------------------------------------------------------
* Function: WMAudioSetMicRecPaths
*
* Set up a microphone path to ADC left and/or right channels as the
* record path.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* micSignalL left channel microphone input to use.
* micSignalR right channel microphone input to use.
* channels which ADC channel(s) to record signal on.
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMAudioSetMicRecPaths( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_SIGNAL micSignalL,
WM_AUDIO_SIGNAL micSignalR
);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -