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

📄 xtouchscreen.h

📁 基于powerPC405处理器的触摸显示屏驱动程序
💻 H
字号:
/*-----------------------------------------------------------------------------*     $Date: 2004/01/05 16:58:54 $*     $RCSfile: xtouchscreen.h,v $*----------------------------------------------------------------------------*//*******************************************************************************     XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"*     SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR*     XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION*     AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION*     OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS*     IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,*     AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE*     FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY*     WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE*     IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR*     REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF*     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS*     FOR A PARTICULAR PURPOSE.*     *     (c) Copyright 2004 Xilinx, Inc.*     All rights reserved.******************************************************************************//*****************************************************************************//**** @file xtouchscreen.h** This driver supports the following features:** - Polled mode* - Interrupt driven mode** <b>Interrupts</b>** In order to use interrupts, it is necessary for the user to connect the * driver interrupt handler, XTouchscreen_InterruptHandler(), to the interrupt * system of the application. This function does not save and restore the * processor context such that the user must provide it. A handler must be set* for the driver such that the handler is called when interrupt events occur. * The handler is called from interrupt context and is designed to allow * application specific processing to be performed.** @note** None.** <pre>* MODIFICATION HISTORY:** Ver   Who  Date     Changes* ----- ---- -------- -----------------------------------------------* 1.00a ch   08/15/02 First release* </pre>*******************************************************************************/#ifndef XTOUCHSCREEN_H /* prevent circular inclusions */#define XTOUCHSCREEN_H /* by using protection macros *//***************************** Include Files ********************************/#include "xbasic_types.h"#include "xstatus.h"#include "xtouchscreen_l.h"/************************** Constant Definitions ****************************//*  * These constants specify the handler events that are passed to * a handler from the driver. These constants are not bit masks suuch that  * only one will be passed at a time to the handler */#define XTOUCHSCREEN_EVENT_PEN_UP       1#define XTOUCHSCREEN_EVENT_PEN_DOWN     2/* * These constants are used to specify the current pen state. * They are only used internally. */#define XTOUCHSCREEN_STATE_PEN_UP       1#define XTOUCHSCREEN_STATE_PEN_DOWN     2/**************************** Type Definitions ******************************//* * This typedef contains configuration information for the device */typedef struct{     Xuint16 DeviceId;     Xuint32 BaseAddress;} XTouchscreen_Config;/* * This data type defines a handler which the application must define * when using interrupt mode.  The handler will be called from the driver in an * interrupt context to handle application specific processing. * * @param CallBackRef is a callback reference passed in by the upper layer *        when setting the handler, and is passed back to the upper layer when *        the handler is called. * @param Event contains one of the event constants indicating why the handler *        is being called. * @param EventData contains the number of bytes sent or received at the time *         of the call.*/typedef void (*XTouchscreen_Handler)(void *CallBackRef, Xuint32 Event,                                     unsigned int EventData);/* * The Touchscreen driver instance data. The user is required to allocate a * variable of this type for every touchscreen device in the system.      * A pointer to a variable of this type is then passed to the driver API * functions */typedef struct{     Xuint32 BaseAddress;     Xuint32 IsReady;     Xuint32 CurrentState;     XTouchscreen_Handler Handler;     void *CallBackRef;} XTouchscreen;/***************** Macros (Inline Functions) Definitions ********************//************************** Function Prototypes *****************************//* * required functions is xtouchscreen.c */XStatus XTouchscreen_Initialize(XTouchscreen *InstancePtr, Xuint16 DeviceId);XTouchscreen_Config *XTouchscreen_LookupConfig(Xuint16 DeviceId);void XTouchscreen_GetPosition_2D(XTouchscreen *InstancePtr, Xuint32 *x,                                 Xuint32 *y);void XTouchscreen_GetPosition_3D(XTouchscreen *InstancePtr, Xuint32 *x,                                 Xuint32 *y, Xuint32 *z);/* * interrupt functions in xtouchscreen_intr.c  */void XTouchscreen_SetHandler(XTouchscreen *InstancePtr,                              XTouchscreen_Handler FuncPtr, void *CallBackRef);void XTouchscreen_InterruptHandler(XTouchscreen *InstancePtr);#endif

⌨️ 快捷键说明

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