📄 ads7843_ts.h
字号:
/******************************************************************************** File name : ads7843.h** ** Description :** ADS7843(Touch Screen Controller)** ** Compile environment and method of compile & link** gcc version 2.95.2 20000313 (Debian GNU/Linux)**** Usage :** Touch screen controller Device Driver header file for ** Hyper104 Expansion Board ** ** License : ** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License version 2 as** published by the Free Software Foundation**** Modification history :** Date Version Programmer & Tester Modify issue** 2002.5.1 0.1 Heo young Wook Create*********************************************************************************/#define TS_NAME "ads7843"#define TS_MAJOR 11#define BUFSIZE 128#define XLIMIT 160#define YLIMIT 160#define ADS7843_CLK ADS7843_DCLK#define ADS7843_CS ADS7843_C#define ADS7843_DIN ADS7843_DI#ifdef CONFIG_ARCH_XHYPER255B#define ADS7843_BUSY 1#define ADS7843_DOUT 4#define ADS7843_PENIRQ 5#elif defined(CONFIG_ARCH_XHYPER255A)#define ADS7843_BUSY 1#define ADS7843_DOUT 2#define ADS7843_PENIRQ 3#endif#define ADS7843_START_BIT (1<<0) #define ADS7843_A2 (1<<1) #define ADS7843_A1 (1<<2) #define ADS7843_A0 (1<<3) #define ADS7843_MODE (1<<4) #define ADS7843_SER_DFR (1<<5) #define ADS7843_PD1 (1<<6) #define ADS7843_PD0 (1<<7) /* Ask for X conversion enable PENIRQ */#define SPIMDATA_ASKX (ADS7843_START_BIT | \ ADS7843_A2 | \ ADS7843_A1 *0| \ ADS7843_A0 | \ ADS7843_MODE *0| \ ADS7843_SER_DFR *0| \ ADS7843_PD1 *0| \ ADS7843_PD0 *0) /* Ask for Y conversion enable PENIRQ */#define SPIMDATA_ASKY (ADS7843_START_BIT | \ ADS7843_A2 *0| \ ADS7843_A1 *0| \ ADS7843_A0 | \ ADS7843_MODE *0| \ ADS7843_SER_DFR *0| \ ADS7843_PD1 *0| \ ADS7843_PD0 *0)/* Enable PENIRQ */#define SPIMDATA_NOP (ADS7843_START_BIT | \ ADS7843_A2 *0| \ ADS7843_A1 *0| \ ADS7843_A0 *0| \ ADS7843_MODE *0| \ ADS7843_SER_DFR *0| \ ADS7843_PD1 *0| \ ADS7843_PD0 *0)#define ADS7843_CS_LOW XHYPER255_ClearBit(0, ADS7843_CS) #define ADS7843_CS_HIGH XHYPER255_SetBit(0, ADS7843_CS) typedef struct { short pressure; short x; short y; short millisecs;} TS_EVENT;static int raw_max_x, raw_max_y, res_x, res_y, raw_min_x, raw_min_y, xyswap;static int cal_ok, x_rev, y_rev;static char *dev_id = TS_NAME;static DECLARE_WAIT_QUEUE_HEAD(queue);static struct timer_list timer;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -