📄 lh7a400_lcd_evb_touchscreen_driver.h
字号:
/**********************************************************************
* $Workfile: lh7a400_lcd_evb_touchscreen_driver.h $
* $Revision: 1.1 $
* $Author: KovitzP $
* $Date: Nov 20 2001 17:01:56 $
*
* Project: LH7A400
*
* Description:
* see LH7A400_LCD_EVB_touscreen_driver.c
*
* Revision History:
* $Log: P:/PVCS6_6/archives/LH7A400 (Aruba)/SSP/lh7a400_lcd_evb_touchscreen_driver.h-arc $
*
* Rev 1.1 Nov 20 2001 17:01:56 KovitzP
* reformatted header file to make it easier to configure the
* driver for a given system.
*
* Rev 1.0 Nov 19 2001 10:26:06 KovitzP
* Initial revision.
*
*
* COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
*********************************************************************/
#ifndef LH7A400_LCD_EVB_TOUCHSCREEN_DRIVER_H
#define LH7A400_LCD_EVB_TOUCHSCREEN_DRIVER_H
#include "LH7A400_ssp_driver.h"
#include "LH7A400_gpio_driver.h"
#include "LH7A400_evb_ssp_frame_driver.h"
#include "LH7A400_int_driver.h"
#include "LH7A400_timer_driver.h"
/*
choose the timer you want to use; must be TIMER1, TIMER2, or TIMER3
*/
#define LCD_TOUCHSCREEN_TIMER TIMER2
/*
Interrupt priority configuration. Higher numbers are higher priority.
TOUCHSCREEN_TIMER_PRIORITY must not equal TOUCHSCREEN_SSP_PRIORITY.
*/
/* choose the priority for the pen down interrupt FIQ (0-3) */
#define TOUCHSCREEN_PEN_INT_PRIORITY (0)
/* choose the priority for the timer interrupt (0-23) */
#define TOUCHSCREEN_TIMER_PRIORITY (0)
/* choose the priority for the SSP interrupt (0-23) */
#define TOUCHSCREEN_SSP_PRIORITY (1)
/* manifest constants */
#define LH7A400_EVB_TOUCHSCREEN_INT_BIT 0
/* control byte */
#define LCD_TS_START _BIT(7)
#define LCD_TS_SINGLE_END _BIT(2)
#define LCD_TS_DIFFERENTIAL 0
#define LCD_TS_MEASURE_X _SBF(4,1)
#define LCD_TS_MEASURE_Y _SBF(4,5)
#define LCD_TS_MEASURE_IN3 _SBF(4,2)
#define LCD_TS_MEASURE_IN4 _SBF(4,6)
#define LCD_TS_POWER_DOWN_PEN_IRQ 0
#define LCD_TS_POWER_DOWN 1
#define LCD_TS_POWER_RESERVED 2
#define LCD_TS_POWER_ON 3
/*
serial port parameters. Note that LCD_TS_BPS (clock frequency of
the SSPCLK pin for accessing the touchscreen controller) influences
the sampling interval. Slower clocks yield higher accuracy (with
diminishing returns. Faster clocks shorten the measurement
interval and consume less power.
*/
#define LCD_TS_WORDSIZE 13
#define LCD_TS_BPS 100000
/*
screen noise rejection parameters; may require tweaking for a given
noise environment. Higher numbers give higher noise rejection but
lower measurement resolution.
*/
#define TS_DELTA_X_TOLERANCE 50
#define TS_DELTA_Y_TOLERANCE 50
/*
TOUCHSCREEN_SAMPLE_PERIOD_US is how often the serial port gets sampled.
This influences touchscreen repsonisveness
*/
#define TOUCHSCREEN_SAMPLE_PERIOD_US 100000
#define TOUCHSCREEN_ILLEGAL_COORDINATE -1
#define TOUCHSCREEN_PEN_UP 0
#define TOUCHSCREEN_PEN_DOWN 1
/*
TS_Q_LENGTH is the number of measurements that can be stored in the
touchscreen driver queue minus 1.
*/
#define TS_Q_LENGTH 10
/* LCD_TS_STATE is a structure type that stores touch information */
typedef struct
{
INT_32 pen_down; /* =1 if pen is down, 0 if pen is up */
INT_32 x;
INT_32 y;
} LCD_TS_STATE;
/* pen irq */
extern void lcd_touchscreen_pen_down_handler(void);
/* control */
void lcd_touchscreen_init(void);
void lcd_touchscreen_controller_disable(void);
/* touch data queue */
LCD_TS_STATE lcd_touchscreen_q_accept(void);
INT_32 lcd_touchscreen_q_empty(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -