📄 wmgpiotests.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: WMGPIOTests.h 2011 2005-08-09 13:49:53Z ian $
*
* Tests for the WMGPIO code.
*
*
* Warning:
* This driver is specifically written for Wolfson Codecs. It is not a
* general CODEC device driver.
*
* ---------------------------------------------------------------------------*/
#ifndef __WMGPIOTESTS_H__
#define __WMGPIOTESTS_H__
/*
* Include files
*/
#include "WMConfig.h"
/*
* Only build this if we are asked to.
*/
#if WM_TESTING && WM_GPIO_CONTROL && WM_AUTOTEST_GPIO_CONTROL_BASIC
/*
* Global definitions
*/
/*
* Private data
*/
/*
* Function prototypes
*/
#ifdef __cplusplus
extern "C" {
#endif
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOBasic
*
* Test the basic GPIO functionality.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if they passed, FALSE if any failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOBasic( WM_DEVICE_HANDLE hDevice );
#if WM_AUTOTEST_GPIO_CONTROL_ADVANCED
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOAdvanced
*
* Test the advanced GPIO functionality.
* NOTE: To pass these test succesfully, GPIO_TEST_1 & GPIO_TEST_2 which
* are defined in WMConfig.h must be connected together.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if they passed, FALSE if any failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOAdvanced( WM_DEVICE_HANDLE hDevice );
#endif /* WM_AUTOTEST_GPIO_CONTROL_ADVANCED */
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOConfig
*
* Test WMGPIOConfig function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOConfig( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOPolarity
*
* Test WMGPIOSetInputPolarity function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOPolarity( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOEnableSticky
*
* Test WMGPIOEnableSticky function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOEnableSticky( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOWakeUp
*
* Test WMGPIOEnableWakeUp function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOWakeUp( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOHasAltFunc
*
* Test WMGPIOHasAltFunc function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOHasAltFunc( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOHasVirtualGPIO
*
* Test WMGPIOHasVirtualGPIO function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOHasVirtualGPIO( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOEnableAlternateFunction
*
* Test WMGPIOEnableAlternateFunction function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOEnableAlternateFunction( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOInvertIRQ
*
* Test WMGPIOInvertIRQ function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOInvertIRQ( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOEnableGlobalWake
*
* Test WMGPIOEnableGlobalWake function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOEnableGlobalWake( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOSetOutputLevel
*
* Test WMGPIOSetOutputLevel function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOSetOutputLevel( WM_DEVICE_HANDLE hDevice );
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOGetOutputLevel
*
* Test WMGPIOGetOutputLevel function.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOGetOutputLevel( WM_DEVICE_HANDLE hDevice );
#if WM_AUTOTEST_GPIO_CONTROL_ADVANCED
/*-----------------------------------------------------------------------------
* Function: WMTestGPIOStatus
*
* Test WMGPIOIsSignalled and WMGPIOClearInput functions.
*
* Parameters:
* hDevice handle to the device (from WMOpenDevice)
* outputGPIO the GPIO to be tested as an output
* inputGPIO the GPIO to be tested as an input
*
* Returns: WM_BOOL
* TRUE if it passed, FALSE if it failed.
*---------------------------------------------------------------------------*/
WM_BOOL WMTestGPIOStatus( WM_DEVICE_HANDLE hDevice,
WM_GPIO_PIN outputGPIO,
WM_GPIO_PIN inputGPIO
);
#endif /* WM_AUTOTEST_GPIO_CONTROL_ADVANCED */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* WM_TESTING && WM_GPIO_CONTROL && WM_AUTOTEST_GPIO_CONTROL_BASIC */
#endif /* __WMGPIOTESTS_H__ */
/*------------------------------ END OF FILE ---------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -