📄 wm8753audio.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: WM8753Audio.h 4465 2007-06-04 09:49:24Z fb $
*
* This file contains platform-independent routines for controlling
* audio on Wolfson 8753 codecs.
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
*---------------------------------------------------------------------------*/
#ifndef __WM8753AUDIO_H__
#define __WM8753AUDIO_H__
/*
* Include files
*/
/*
* Definitions
*/
/*
* Function prototypes
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Only provide these if we're doing audio support for WM8753 devices.
*/
#if WM_AUDIO && WM8753_FAMILY
/*-----------------------------------------------------------------------------
* Function: WM8753ConfigureInterface
*
* Configures the streaming format for the link for the given interface.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* audioIF the interface to configure
* isMaster whether the codec masters the link
* format the streaming format to use
* width the number of bits per sample
* flags extra configuration flags
*
* Returns: WMSTATUS
* See WMStatus.h.
*---------------------------------------------------------------------------*/
WMSTATUS WM8753ConfigureInterface( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_INTERFACE audioIF,
WM_BOOL isMaster,
WM_AUDIOIF_FORMAT format,
WM_AUDIOIF_WIDTH width,
WM_AUDIOIF_FLAGS flags
);
/*-----------------------------------------------------------------------------
* Function: WM8753UnconfigureInterface
*
* Unconfigures the streaming format for the link for the given interface.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* audioIF the interface to configure
*
* Returns: WMSTATUS
* See WMStatus.h.
*---------------------------------------------------------------------------*/
WMSTATUS WM8753UnconfigureInterface( WM_DEVICE_HANDLE hDevice,
WM_AUDIO_INTERFACE audioIF
);
/*-----------------------------------------------------------------------------
* Function: WM8753EnableStream
*
* Called to enable the device to handle the given stream. This configures
* the interface and sets the sample rate according to the default values.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* stream The stream to enable
*
* Returns: WMSTATUS
* See WMStatus.h.
*---------------------------------------------------------------------------*/
WMSTATUS WM8753EnableStream( WM_DEVICE_HANDLE hDevice,
WM_STREAM_ID stream
);
/*-----------------------------------------------------------------------------
* Function: WM8753DisableStream
*
* Called to disable the given stream. This unconfigures the interface.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* stream The stream to enable
*
* Returns: WMSTATUS
* See WMStatus.h.
*---------------------------------------------------------------------------*/
WMSTATUS WM8753DisableStream( WM_DEVICE_HANDLE hDevice,
WM_STREAM_ID stream
);
/*-----------------------------------------------------------------------------
* Function: WM8753ConfigurePath
*
* Configure and enable the paths from the DAC to the outputs.
* NOTE: This function is enabling as many of the outputs as possible
* so that there is a good chance that anything coming from the
* DAC will end up being heard through any of the outputs.
* You will probably want to change this set up to suit your
* particular application.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* stream The stream to configure
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WM8753ConfigurePath( WM_DEVICE_HANDLE hDevice,
WM_STREAM_ID stream
);
/*-----------------------------------------------------------------------------
* Function: WM8753SetSampleRate
*
* Called to set the sample rate in the audio-specific sections of the chip.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* stream The stream for which to set the sample rate
* sampleRate The new sample rate.
*
* Returns: WMSTATUS
* See WMStatus.h.
*---------------------------------------------------------------------------*/
WMSTATUS WM8753SetSampleRate( WM_DEVICE_HANDLE hDevice,
WM_STREAM_ID stream,
WM_SAMPLE_RATE sampleRate
);
/*-----------------------------------------------------------------------------
* Function: WM8753GetSampleRate
*
* Returns the sample rate in the audio-specific sections of the chip.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* stream The stream for which to get the sample rate
* pSampleRate Variable to receive the sample rate
*
* Returns: WMSTATUS
* See WMStatus.h.
*---------------------------------------------------------------------------*/
WMSTATUS WM8753GetSampleRate( WM_DEVICE_HANDLE hDevice,
WM_STREAM_ID stream,
WM_SAMPLE_RATE *pSampleRate
);
#if WM_VOICE && DEBUG
/*-----------------------------------------------------------------------------
* Function: WM8753VoiceDumpRegs
*
* Dump all the Voice DAC related registers
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: none
*---------------------------------------------------------------------------*/
void WM8753VoiceDumpRegs( WM_DEVICE_HANDLE hDevice );
#endif /* WM_VOICE && DEBUG */
#endif /* WM_AUDIO && WM8753_FAMILY */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __WM8753AUDIO_H__ */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -