📄 wmmessage.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: WMMessage.h 1883 2005-07-05 14:45:24Z ian $
*
* Message codes for communicating with Wolfson drivers.
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
*---------------------------------------------------------------------------*/
#ifndef __WMMESSAGE_H__
#define __WMMESSAGE_H__
/*
* To use these messages, send them to the driver to pass on to the
* Wolfson Driver API. Each message has two parameters passed with
* it, both nominally of type WM_DWORD. The comment above each message
* describes the real type and use of the two parameters.
*
* In the driver, the messages should translate to a call to the function
* WMDriverMessage( hDevice, msg_id, param1, param2 ).
*
* The return value passed back from the messages depends on the driver
* implementation, and will vary from system to system.
*/
/*
* Include files
*/
#include "WMTypes.h"
/*
* Definitions
*/
/* A base for the messages - this should be out of the standard range */
#define WMMSG_BASE 0x00009780
#define WMMSG_DEBUG_BASE 0x00009700
/*-----------------------------------------------------------------------------
* Message: WMMSG_SELECT_DEFAULT_OUTPUT
*
* Selects the stream to use as the default output stream. This controls where
* audio playback data will be sent if WMAUDIO_DEFAULT_OUTPUT is passed to
* WMAudioOpenChannel.
*
* Parameters:
* param1 [in] (WM_REGTYPE) DAC to set as default - WM_STREAM_*
* param2 [unused]
*---------------------------------------------------------------------------*/
#define WMMSG_SELECT_DEFAULT_OUTPUT WMMSG_BASE+0
/*-----------------------------------------------------------------------------
* Message: WMMSG_SELECT_DEFAULT_INPUT
*
* Selects the stream to use as the default input stream. This controls where
* audio record data will come from if WMAUDIO_DEFAULT_INPUT is passed to
* WMAudioOpenChannel.
*
* Parameters:
* param1 [in] (WM_REGTYPE) DAC to set as default - WM_STREAM_*
* param2 [unused]
*---------------------------------------------------------------------------*/
#define WMMSG_SELECT_DEFAULT_INPUT WMMSG_BASE+1
/*-----------------------------------------------------------------------------
* Message: WMMSG_SELECT_RECORD_SOURCES
*
* Selects a left and right channel input to be summed into the ADC.
*
* Parameters:
* param1 [in] (WM_AUDIO_SIGNAL) Left channel to add to recording
* param2 [in] (WM_AUDIO_SIGNAL) Right channel to add to recording
*---------------------------------------------------------------------------*/
#define WMMSG_SELECT_RECORD_SOURCES WMMSG_BASE+2
/*-----------------------------------------------------------------------------
* Message: WMMSG_SELECT_RECORD_PATHS
*
* Mutes a left and right channel input to the ADC.
*
* Parameters:
* param1 [in] (WM_AUDIO_SIGNAL) Left channel to stop recording
* param2 [in] (WM_AUDIO_SIGNAL) Right channel to stop recording
*---------------------------------------------------------------------------*/
#define WMMSG_SELECT_RECORD_PATHS WMMSG_BASE+3
/*-----------------------------------------------------------------------------
* Message: WMMSG_UNSELECT_RECORD_PATHS
*
* Mutes a left and right channel input to the ADC.
*
* Parameters:
* param1 [in] (WM_AUDIO_SIGNAL) Left channel to stop recording
* param2 [in] (WM_AUDIO_SIGNAL) Right channel to stop recording
*---------------------------------------------------------------------------*/
#define WMMSG_UNSELECT_RECORD_PATHS WMMSG_BASE+4
/*-----------------------------------------------------------------------------
* Message: WMMSG_LOAD_PROFILE
*
* Loads the profile with the given name.
*
* Parameters:
* param1 [in] (const char *) Name of profile to load
* param2 [unused]
*---------------------------------------------------------------------------*/
#define WMMSG_LOAD_PROFILE WMMSG_BASE+5
/*-----------------------------------------------------------------------------
* The following messages are useful for debugging and testing.
*---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
* Message: WMMSG_WRITE_REGISTER
*
* Write a value to a register on the codec.
*
* Parameters:
* param1 [in] (WM_REGTYPE) Register to write to
* param2 [in] (WM_REGVAL) Value to write
*---------------------------------------------------------------------------*/
#define WMMSG_WRITE_WMREGISTER WMMSG_DEBUG_BASE+0
#define WPDM_PRIVATE_WRITE_AC97 WMMSG_WRITE_WMREGISTER
/*-----------------------------------------------------------------------------
* Message: WMMSG_READ_REGISTER
*
* Reads the current value of a register on the codec.
*
* Parameters:
* param1 [in] (WM_REGTYPE) Register to read from
* param2 [out] (WM_REGVAL *) Variable to receive current value
*---------------------------------------------------------------------------*/
#define WMMSG_READ_WMREGISTER WMMSG_DEBUG_BASE+1
#define WPDM_PRIVATE_READ_AC97 WMMSG_READ_WMREGISTER
/*-----------------------------------------------------------------------------
* Message: WMMSG_DIAG_MSG
*
* Diagnostic messages, used for testing.
*
* Parameters:
* param1 [in] (WM_DWORD) Action to perform
* See WMMSG_DIAG_* below
* param2 [varies] Action-specific parameter
*---------------------------------------------------------------------------*/
#define WMMSG_DIAG_MSG WMMSG_DEBUG_BASE+2
#define WPDM_PRIVATE_DIAG_MSG WMMSG_DIAG_MSG
/*-----------------------------------------------------------------------------
* Message: WMMSG_POWERUP_MSG
*
* Power up sections of the codec.
*
* Parameters:
* param1 [in] (WM_DRIVER_ID) One of the WM_DRIVER_* constants
* param2 [in] (WM_POWERFLAG) What to power up - a combination
* of WM_POWER_* constants
*---------------------------------------------------------------------------*/
#define WMMSG_POWERUP_MSG WMMSG_DEBUG_BASE+3
#define WPDM_PRIVATE_POWERUP_MSG WMMSG_POWERUP_MSG
/*-----------------------------------------------------------------------------
* Message: WMMSG_POWERDOWN_MSG
*
* Power down sections of the codec.
*
* Parameters:
* param1 [in] (WM_DRIVER_ID) One of the WM_DRIVER_* constants
* param2 [in] (WM_POWERFLAG) What to power down - a combination
* of WM_POWER_* constants
*---------------------------------------------------------------------------*/
#define WMMSG_POWERDOWN_MSG WMMSG_DEBUG_BASE+4
#define WPDM_PRIVATE_POWERDOWN_MSG WMMSG_POWERDOWN_MSG
/*-----------------------------------------------------------------------------
* Message: WMMSG_RAW_WRITE_WMREGISTER
*
* Write a value to a register on the codec using the hardware layer directly.
*
* Parameters:
* param1 [in] (WM_REGTYPE) Register to write to
* param2 [in] (WM_REGVAL) Value to write
*---------------------------------------------------------------------------*/
#define WMMSG_RAW_WRITE_WMREGISTER WMMSG_DEBUG_BASE+5
#define WPDM_PRIVATE_RAW_WRITE_AC97 WMMSG_RAW_WRITE_WMREGISTER
/*-----------------------------------------------------------------------------
* Message: WMMSG_RAW_READ_WMREGISTER
*
* Reads the current value of a register on the codec.
*
* Parameters:
* param1 [in] (WM_REGTYPE) Register to read from
* param2 [out] (WM_REGVAL *) Variable to receive current value
*---------------------------------------------------------------------------*/
#define WMMSG_RAW_READ_WMREGISTER WMMSG_DEBUG_BASE+6
#define WPDM_PRIVATE_RAW_READ_AC97 WMMSG_RAW_READ_WMREGISTER
/*-----------------------------------------------------------------------------
* Message: WMMSG_READ_DEVICE_ID
*
* Reads the device ID of the codec.
*
* Parameters:
* param1 [out] (WM_CHIPTYPE *) Variable to receive device ID
* param2 [out] (WM_CHIPREV *) Variable to receive revision
*---------------------------------------------------------------------------*/
#define WMMSG_READ_DEVICE_ID WMMSG_DEBUG_BASE+7
/*-----------------------------------------------------------------------------
* Diagnostic messages used for WMMSG_DIAG_MSG.
*
* Pass the code as param1.
* Pass the parameter (if specified) as param2.
*---------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
* Message: WMMSG_DIAG_RESET
*
* Performs a cold reset on the codec.
*
* Parameters:
* param2 [unused]
*---------------------------------------------------------------------------*/
#define WMMSG_DIAG_RESET 1
#define WPDM_DIAG_RESET WMMSG_DIAG_RESET
/*-----------------------------------------------------------------------------
* Message: WMMSG_DIAG_WAKE
*
* Wakes a sleeping codec. Corresponds to a warm reset on AC'97.
*
* Parameters:
* param2 [unused]
*---------------------------------------------------------------------------*/
#define WMMSG_DIAG_WAKE 2
#define WPDM_DIAG_WAKE WMMSG_DIAG_WAKE
#endif /* __WMMESSAGE_H__ */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -