📄 wmvoice.c
字号:
/*-----------------------------------------------------------------------------
* 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: WMVoice.c 1571 2005-04-15 15:56:21Z ib $
*
* Configure the Voice interface.
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
* --------------------------------------------------------------------------*/
/*
* Include files
*/
#include "WMCommon.h"
#include "WMAudio.h"
#include "WMControlLink.h"
#include "WMStatus.h"
#include "WMVoice.h"
/*
* Only build this if we're doing Audio Voice support.
*/
#if WM_AUDIO && WM_VOICE
/*
* Global definitions
*/
/*
* Function prototypes
*/
/*-----------------------------------------------------------------------------
* Function: WMVoiceEnable
*
* Enable the Voice DAC Interface
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WMSTATUS
* See WMStatus.h
*---------------------------------------------------------------------------*/
WMSTATUS WMVoiceEnable( WM_DEVICE_HANDLE hDevice )
{
WMSTATUS status = WMS_UNSUPPORTED;
if ( !WM_IS_VOICE_SUPPORTED( hDevice ) )
{
status = WMS_UNSUPPORTED;
goto error;
}
#if WM_AUDIO_STREAM
/*
* Set up the platform specific stuff.
*/
WMPlatformSSPInit( hDevice );
/* Now enable the SSP port */
WMPlatformSSPEnable( hDevice );
#endif /* WM_AUDIO_STREAM */
/*
* We're done.
*/
return WMS_SUCCESS;
error:
return status;
}
/*-----------------------------------------------------------------------------
* Function: WMVoiceDisable
*
* Disables the Voice DAC Interface.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: void
*---------------------------------------------------------------------------*/
void WMVoiceDisable( WM_DEVICE_HANDLE hDevice )
{
/*
* Make sure we're stopped.
*/
WMVoiceStop( hDevice );
#if WM_AUDIO_STREAM
/*
* And disable the port.
*/
WMPlatformSSPDisable( hDevice );
#endif /* WM_AUDIO_STREAM */
}
/*-----------------------------------------------------------------------------
* Function: WMVoiceStart
*
* Starts the Voice DAC Interface running.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: void
*---------------------------------------------------------------------------*/
void WMVoiceStart( WM_DEVICE_HANDLE hDevice )
{
#if WM_AUDIO_STREAM
WMPlatformSSPStart( hDevice );
#endif /* WM_AUDIO_STREAM */
}
/*-----------------------------------------------------------------------------
* Function: WMVoiceStop
*
* Stops the Voice DAC Interface running.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: none
*---------------------------------------------------------------------------*/
void WMVoiceStop( WM_DEVICE_HANDLE hDevice )
{
#if WM_AUDIO_STREAM
WMPlatformSSPStop( hDevice );
#endif /* WM_AUDIO_STREAM */
}
#endif /* WM_AUDIO && WM_VOICE */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -