⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wmtouch.h

📁 pxa270平台 windows mobile 5.2 wm9713 触摸屏+音频驱动
💻 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: WMTouch.h 1790 2005-06-09 13:33:35Z ib $
 *
 * This file contains platform-independent routines for controlling
 * touchscreen on Wolfson codecs.
 *
 * Warning:
 *  This driver is specifically written for Wolfson Codecs. It is not a 
 *  general CODEC device driver.
 *
 *---------------------------------------------------------------------------*/
#ifndef __WMTOUCH_H__
#define __WMTOUCH_H__

/*
 * Include files
 */
#include "WMTypes.h"
#include "WMConfig.h"
#include "WMAuxADC.h"
#include "WMPower.h"

/*
 * Definitions
 */

/*
 * Function prototypes
 */
#ifdef __cplusplus
extern "C" {
#endif

/*
 * Only provide these if we're doing Touch support.
 */
#if WM_TOUCH

/*-----------------------------------------------------------------------------
 * Function:    WMTouchInit
 *
 * Initialises the touch functionality.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     WMSTATUS
 *		See WMStatus.h.
 *---------------------------------------------------------------------------*/
WMSTATUS WMTouchInit( WM_DEVICE_HANDLE hDevice );

/*-----------------------------------------------------------------------------
 * Function:    WM97TouchInit
 *
 * Initialises the touch functionality.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     WMSTATUS
 *      See WMStatus.h.
 *---------------------------------------------------------------------------*/
WMSTATUS WM97TouchInit( WM_DEVICE_HANDLE hDevice );

/*-----------------------------------------------------------------------------
 * Function:    WMTouchShutdown
 *
 * Shuts down the touch functionality.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     void
 *---------------------------------------------------------------------------*/
void WMTouchShutdown( WM_DEVICE_HANDLE hDevice );

/*-----------------------------------------------------------------------------
 * Function:    WMTouchPowerUp
 *
 * Called to power up the touch-specific sections of the chip.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *      powerSections       The sections to power up.
 *
 * Returns:     WMSTATUS
 *		See WMStatus.h.
 *---------------------------------------------------------------------------*/
WMSTATUS WMTouchPowerUp( WM_DEVICE_HANDLE hDevice,
                         WM_POWERFLAG     powerSections
                       );

/*-----------------------------------------------------------------------------
 * Function:    WMTouchPowerDown
 *
 * Called to power down the touch-specific sections of the chip.  Note if the
 * sections are still in use by another driver they will not actually be
 * powered down.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *      powerSections       The sections to power down.
 *
 * Returns:     WMSTATUS
 *		See WMStatus.h.
 *---------------------------------------------------------------------------*/
#define WMTouchPowerDown( hDevice, powerSections )                      \
    WMPowerDown( hDevice, WM_DRIVER_TOUCH, powerSections )

/*-----------------------------------------------------------------------------
 * Function:    WMIsPenDown
 *
 * This function queries the Wolfdon device to determine whether the pen is 
 * currently down.
 *
 * Note this function is actually implemented in the WMAuxADC module.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     WM_BOOL
 *		TRUE if the pen is down.
 *---------------------------------------------------------------------------*/
WM_BOOL WMIsPenDown( WM_DEVICE_HANDLE hDevice );

/*-----------------------------------------------------------------------------
 * Function:    WMGetSmoothedTouchCoordinates
 *
 * Returns the next touch panel point, after doing smoothing and averaging.
 *
 * Parameters:
 *      hDevice     handle to the device (from WMOpenDevice)
 *      pXCoord     Variable to receive X coordinate
 *      pYCoord     Variable to receive Y coordinate
 *
 * Returns:     WMSTATUS
 *     See WMStatus.h.
 *---------------------------------------------------------------------------*/
WMSTATUS WMGetSmoothedTouchCoordinates( WM_DEVICE_HANDLE  hDevice,
                                        WM_REGVAL         *pXCoord,
                                        WM_REGVAL         *pYCoord
                                      );
                                  
/*-----------------------------------------------------------------------------
 * Function:    WMGetRawTouchCoordinates
 *
 * Returns the next touch panel point directly from the digitiser.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *      pXCoord             Variable to receive X coordinate
 *      pYCoord             Variable to receive Y coordinate
 *
 * Returns:     WMSTATUS
 *      See WMStatus.h.
 *---------------------------------------------------------------------------*/
WMSTATUS WMGetRawTouchCoordinates( WM_DEVICE_HANDLE   hDevice,
                                   WM_REGVAL          *pXCoord,
                                   WM_REGVAL          *pYCoord
                                 );
/*-----------------------------------------------------------------------------
 * Function:    WMTouchStartCapture
 *
 * Called when pen down is detected - clears stale points from the history
 * buffer and starts the timers.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     WMSTATUS
 *      See WMStatus.h.
 *---------------------------------------------------------------------------*/
WMSTATUS WMTouchStartCapture( WM_DEVICE_HANDLE hDevice );

/*-----------------------------------------------------------------------------
 * Function:    WMTouchEndCapture
 *
 * Called when pen up is detected - cancels any outstanding timers and resets
 * pen down interrupts if appropriate.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     void
 *---------------------------------------------------------------------------*/
void WMTouchEndCapture( WM_DEVICE_HANDLE hDevice );

#ifdef DEBUG
/*-----------------------------------------------------------------------------
 * Function:    WMTouchDebugState
 *
 * Returns some internal touch driver state to help with debugging drivers.
 *
 * Parameters:
 *      hDevice             handle to the device (from WMOpenDevice)
 *
 * Returns:     unsigned int
 *      See WM_TOUCH_DEBUG_* flags.
 *---------------------------------------------------------------------------*/
#define WM_TOUCH_DEBUG_PEN_DOWN         0x0001  /**< The codec reports pen down */
#define WM_TOUCH_DEBUG_PEN_DEBOUNCING   0x0002  /**< Pen up, but only just so debouncing */
#define WM_TOUCH_DEBUG_UNSUPPORTED      0x0003  /**< Pen Debug information cannot be obtained */

unsigned int WMTouchDebugState( WM_DEVICE_HANDLE hDevice );
#endif  /* DEBUG */

#else  /* WM_TOUCH */

#define WMTouchInit( _hDevice )							(WMS_UNSUPPORTED)
#define WM97TouchInit( _hDevice )                       (WMS_UNSUPPORTED)
#define WMTouchShutdown( _hDevice )                     (0)
#define WMTouchPowerUp( _hDevice, _powerSections )      (WMS_UNSUPPORTED)
#define WMTouchPowerDown( _hDevice, _powerSections )	(WMS_UNSUPPORTED)
#define WMIsPenDown( _hDevice )                         (FALSE)
#define WMGetSmoothedTouchCoordinates( _hDevice, _pXCoord, _pYCoord )	\
                                                        (WMS_UNSUPPORTED)
#define WMGetRawTouchCoordinates( _hDevice, _pXCoord, _pYCoord )		\
                                                        (WMS_UNSUPPORTED)
#ifdef DEBUG
#define WMTouchDebugState( _hDevice )                   (WM_TOUCH_DEBUG_UNSUPPORTED)
#endif  /* DEBUG */

#endif  /* WM_TOUCH */
#ifdef __cplusplus
}   /* extern "C" */
#endif

#endif	/* __WM97TOUCH_H__ */
/*------------------------------ END OF FILE ---------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -