📄 wmstatus.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: WMStatus.h 2364 2005-11-04 15:56:03Z ib $
*
* This file contains mask definitions for the status codes returned by the
* drivers for the Wolfson devices.
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
*---------------------------------------------------------------------------*/
#ifndef __WMSTATUS_H__
#define __WMSTATUS_H__
/*
* Include files
*/
/*
* Definitions
*/
#define WM_SUCCESS( _status ) ( WMS_RETURN_BASE == (_status & WMS_MASK) )
#define WM_ERROR( _status ) ( ! ( WM_SUCCESS( _status ) ) )
/*
* The status values.
* NB: If you add a new status value, make sure you also update WMStatusText
* in WMDiagnostics.c.
*/
typedef enum tagWM_STATUS
{
/* Successful return values */
WMS_RETURN_BASE = 0xDDDD0000,
WMS_SUCCESS = WMS_RETURN_BASE + 0x0000,
WMS_RETURN_TRUE = WMS_RETURN_BASE + 0x0001,
WMS_RETURN_FALSE = WMS_RETURN_BASE + 0x0002,
WMS_ERROR_BASE = 0xEEEE0000,
/* Link errors */
WMS_DEVICE_BUSY = WMS_ERROR_BASE + 0x0001, /* Device occupied */
WMS_DATA_TIMED_OUT = WMS_ERROR_BASE + 0x0002, /* A read timed out */
WMS_LOCK_TIMED_OUT = WMS_ERROR_BASE + 0x0003, /* Didn't get lock before timeout */
WMS_ACLINK_NOT_ACTIVE = WMS_ERROR_BASE + 0x0004, /* Nothing coming across the AC link */
WMS_CODEC_NOT_READY = WMS_ERROR_BASE + 0x0005, /* Codec ready bit not set on link */
WMS_NO_SUPPORTED_DEVICE = WMS_ERROR_BASE + 0x0006, /* No Wolfson device, or support not compiled */
WMS_REG_NOT_PRESENT = WMS_ERROR_BASE + 0x0007, /* No such register */
/* General errors */
WMS_RESOURCE_FAIL = WMS_ERROR_BASE + 0x0010, /* Couldn't allocate a resource */
WMS_INVALID_PARAMETER = WMS_ERROR_BASE + 0x0011, /* An invalid parameter was passed in */
WMS_UNSUPPORTED = WMS_ERROR_BASE + 0x0012, /* The command is not supported */
WMS_HW_ERROR = WMS_ERROR_BASE + 0x0013, /* General hardware error */
WMS_FAILURE = WMS_ERROR_BASE + 0x0014, /* General error */
WMS_WRONG_MODE = WMS_ERROR_BASE + 0x0015, /* Invalid state */
WMS_RESOURCE_CONFLICT = WMS_ERROR_BASE + 0x0016, /* Resource already exists, or other conflict */
WMS_INVALID_CHANNEL = WMS_ERROR_BASE + 0x0017, /* The given channel does not exist */
WMS_RESOURCE_NULL = WMS_ERROR_BASE + 0x0018, /* The resource is null */
WMS_UNKNOWN_MESSAGE = WMS_ERROR_BASE + 0x0019, /* An unknown driver message */
WMS_UNKNOWN_PROFILE = WMS_ERROR_BASE + 0x001A, /* The profile is not supported */
WMS_EVENT_TIMED_OUT = WMS_ERROR_BASE + 0x001B, /* the event did not occur before timeout*/
WMS_NOT_IMPLEMENTED = WMS_ERROR_BASE + 0x001F, /* The function has not been implemented */
/* ADC/Touch errors */
WMS_UNEXPECTED_DATA = WMS_ERROR_BASE + 0x0020, /* The data received wasn't what was expected */
WMS_NO_PEN_DOWN = WMS_ERROR_BASE + 0x0021, /* Pen not down so X or Y reading invalid */
WMS_SCATTERED_SAMPLES = WMS_ERROR_BASE + 0x0022, /* Touch samples too noisy - can't get valid reading */
WMS_AUXADC_INACTIVE = WMS_ERROR_BASE + 0x0023, /* ADC not currently generating data */
WMS_NO_DATA = WMS_ERROR_BASE + 0x0024, /* No ADC data received */
/* Audio errors */
WMS_INVALID_SIGNAL = WMS_ERROR_BASE + 0x0030, /* An invalid WM_AUDIO_SIGNAL was used */
/* Shadow register errors */
WMS_UNABLE_TO_SHADOW = WMS_ERROR_BASE + 0x0040, /* The register cannot be shadowed */
WMS_SHADOW_UNINTIALISED = WMS_ERROR_BASE + 0x0041, /* Read error: The register has not been set => value unknown */
WMS_MASK = 0xFFFF0000 /* For SUCCESS/ERROR check */
} WM_STATUS;
/* Backwards compatibility */
#define WMSTATUS WM_STATUS
/*
* Function prototypes
*/
#ifdef __cplusplus
extern "C" {
#endif
/*-----------------------------------------------------------------------------
* Function: WMStatusText
*
* Purpose:
* This function returns a textual representation of the status value - useful
* for reporting errors.
*
* Parameters:
* status status code.
*
* Returns: const char *
* Textual representation of error code.
----------------------------------------------------------------------------*/
const char *WMStatusText( WMSTATUS status );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __WMSTATUS_H__ */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -