硬件平台: CPU iMX6 + TSC2007 + 电阻屏
操作系统: linux-3.0.35
驱动: tsc2007标准驱动
问题描述:
设备地址 0x48 (右移一位, A1 A0 = 00 )
在tsc2007_read_values中加入打印信息,
每次点击时打印
x=0 y=0 z1=0 z2=0
x=0 y=0 z1=0 z2=0
x=0 y=0 z1=0 z2=0
x=0 y=0 z1=0 z2=0
x=0 y=0 z1=0 z2=0
x=0 y=0 z1=0 z2=0
从示波器上看波形应该正确的。
S 90 D4 S 91 00 00 T [measure y]
S 90 C4 S 91 00 00 T [measure x]
S 90 E4 S 91 00 00 T [measure z1]
S 90 F4 S 91 00 00 T [measure z2]
S 90 00 S 91 00 00 T [powerdown enable irq]
static void tsc2007_read_values(struct tsc2007 *tsc, struct ts_event *tc)
{
/* y- still on; turn on only y+ (and ADC) */
tc->y = tsc2007_xfer(tsc, READ_Y);
/* turn y- off, x+ on, then leave in lowpower */
tc->x = tsc2007_xfer(tsc, READ_X);
/* turn y+ off, x- on; we'll use formula #1 */
tc->z1 = tsc2007_xfer(tsc, READ_Z1);
tc->z2 = tsc2007_xfer(tsc, READ_Z2);
/* Prepare for next touch reading - power down ADC, enable PENIRQ */
tsc2007_xfer(tsc, PWRDOWN);
printk("x=%d y=%d z1=%d z2=%d\n", tc->x, tc->y, tc->z1, tc->z2);
}
原理图:

