Multi-touch screen - capacitive screen driver

Explained above, the blog screen driver resistive touch screen, it is a single touch device. Most devices now support multi-touch, multi-touch of the benefits:

1) the use of two fingers can be enlarged or reduced image;

2) on a touch screen can be used by many people at the same time;

In both of the above simple example, a single touch can not be achieved. You must use multi-touch, multi-touch as the name suggests is at the same time, there may be multiple contacts, drivers only need to report this to the positions of the plurality of contacts application on it on the screen. As for how to deal with the application, it is a matter of the application.

Drive: reporting the location of the plurality of contacts

 Now look, single-point touch screen driver and multi-touch screen driver What difference?

 

Drivers What kind of data should be reported?

Single Point:

Press: BTN_TOUCH, 1 (expressed Press)

In the sliding process you need to report the position of the contacts:

for (; ;)

{

  ABS_X , x

  ABS_Y, y

  ABS_PRESSURE, 1 (expressed Press)

  BTN_TOUCH, 1 (this value is the sliding process has a)

}

Release: BTN_TOUCH, 0 (expressed release)

    ABS_PRESSURE, 0 (indicates release) UOD

Multi-point:

Multi-touch screen driver reported data is relatively simple, at the same time, the number of data points on how many points reported on it.

for(;;)

{

  a time t1: reporting location p1

      P2 location reporting

  time t2: reporting location p3

      P4 reporting location

  。。。。。。。。。。

  tn time: report pn Location

}

The question is, how to report the location of these contacts? Look at these contacts, What is the connection between them?

p1 and p3 belongs to the scratches on the same finger

p4 and p2 belong to scratches on the same finger

When reporting the location, the need to report the relationship between the contacts. Thus report data to be divided into two. type A and type B

type A: reports only contact position, do not care about the relationship between the contacts

As it can be seen from the above, except that the position of the contacts reported up, as to the relationship between the contacts do not deal with. Who'll handle it?

是由应用程序进行处理的。比如说p1和p3的位置比p1和p4的位置近,就认为p1和p3是一个手指滑动产生的,这仅仅是说明可能存在这种处理方式,在此不进行深究。

 在应用程序中需要计算,这种方式比较耗时。

typeB:上报触点位置,也上报触点之间的关系

 现在的多点触摸屏一般来说都有一个控制IC,直接访问控制IC就可以得到触点的位置,并且得到触点的关系。

比如说在t1时刻,去读控制IC,可以得到p1的位置,p2的位置。p1的ID,假设此ID为0。p2的ID,假设此ID为1

在t2时刻,去读控制IC,可以得到p3的位置,p4的位置。p3的ID,假设为此ID为0.(表示p1,p3属于同一条划痕)。p4的ID,假设此ID为1(表示p2,p4属于同一条划痕).

举个例子:

 

Guess you like

Origin www.cnblogs.com/-glb/p/11285737.html