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

📄 sdk7a400_ts_driver.h

📁 Sharp LH7A400 BSP平台无关部分的代码,有很高的参考价值,尤其是系统架构设计上,设计成移植度很高的BSP.
💻 H
字号:
/***********************************************************************
 * $Workfile:   sdk7a400_ts_driver.h  $
 * $Revision:   1.1  $
 * $Author:   WellsK  $
 * $Date:   Dec 03 2003 13:46:50  $
 *
 * Project: SDK7A400 Touchscreen driver
 *
 * Description:
 *     This file contains driver support for the Touchscreen
 *     interface on the SDK7A400 EVB.
 *
 * Revision History:
 * $Log:   //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a400/bsps/sdk7a400/include/sdk7a400_ts_driver.h-arc  $
 * 
 *    Rev 1.1   Dec 03 2003 13:46:50   WellsK
 * Added interrupt enable/disable ioctl and made interrupt
 * handler function prototype visible.
 * 
 *    Rev 1.0   Oct 21 2003 14:31:46   WellsK
 * Initial revision.
 * 
 *
 ***********************************************************************
 * SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
 * OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
 * AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES, 
 * SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
 *
 * SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY 
 * FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A 
 * SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
 * FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
 *
 * COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
 *     CAMAS, WA
 **********************************************************************/

#ifndef SDK7A400_TS_DRIVER_H
#define SDK7A400_TS_DRIVER_H

#ifdef __cplusplus
extern "C" {
#endif

#include "abl_types.h"
#include "sdk7a400_board.h"

/***********************************************************************
 * SDK7A400 Touchscreen configuration commands (IOCTL commands and
 * arguments)
 **********************************************************************/

/* Touchscreen device commands (IOCTL commands) */
typedef enum {
    TS_ENABLE,       /* Enable or disable the touchscreen interface,
                        use arg = 0 to disable, use arg = 1 to enable */
    TS_FLUSH_QUEUE,  /* Flush the touchscreen data queue, use arg =
                        0 */
    TS_REQUEST_DATA, /* Gets the current touchscreen data, use
                        arg = 0, read the data with the ts_read_data
                        function*/
    TS_INSTALL_TSCB, /* Install a touchscreen callback function that is
                        called when the touchscreen coordinates have
                        been received, use arg as function address */
    TS_ENABLE_INT,   /* Enable or didsable the touchscreen interrupt,
                        use arg = 1 to enable, arg = 0 to disable */
    TS_GET_STATUS    /* Return touchscreen status, use arg as a value of
                        type TS_IOCTL_STS_T */
} TS_IOCTL_CMD_T;

/* Touchscreen device arguments for TS_GET_STATUS command (IOCTL
   arguments) */
typedef enum {
    TS_PEND_STATE    /* Returns 1 if a touchscreen pen down state is
                        detected, or if an interrupt is pending in
                        interrupt mode */
} TS_IOCTL_STS_T;

/* Structure that contains the read pendown state and X/Y coordinates
   of that touchscreen */
typedef struct
{
    BOOL_32 pendown; /* TRUE if a pendown event occurred */
    UNS_16  xraw;    /* Raw X coordinate value */
    UNS_16  yraw;    /* Raw Y coordinate value */
} TS_DATA_T;

/***********************************************************************
 * SDK7A400 Touchscreen API functions
 **********************************************************************/

/* Open the touchscreen interface */
INT_32 ts_open(void *ipbase,
               INT_32 arg);

/* Close the touchscreen device */
STATUS ts_close(INT_32 devid);

/* Touchscreen device configuration block */
STATUS ts_ioctl(INT_32 devid,
                INT_32 cmd,
                INT_32 arg);

/* Touchscreen device read function */
INT_32 ts_read(INT_32 devid,
               void *buffer,
               INT_32 max_bytes);

/* Touchscreen device write function */
INT_32 ts_write(INT_32 devid,
                void *buffer,
                INT_32 n_bytes);

/* Touchscreen Interrupt */
void ts_isr(void);

#ifdef __cplusplus
}
#endif

#endif /* SDK7A400_TS_DRIVER_H */

⌨️ 快捷键说明

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