Touchpanel data spread

Hi !
I write input driver with WM9712L (Wolfson Microelectronics) chip as ADC and 4-wire touch panel with label 4K25D_DMC.25 . It works with Photon manager. I wrote combination device/protocol module and also used standard ABS filter. I give data from ADC chip, fill packet structure and send to higher level, how i understand it’s ABS filter. Before working i do calibration with calib utility. And this is the result string from it:
[color=green]# cat /etc/system/trap/calib.phycore-pxa270
0x0:639x479:3945 130 237 3900 0
Then I put the pen down I give 2 or more pen detection events [color=red]with different coordinates ! I thought that ABS filter do the job of interpretation and smoothing coordinates, but it’s not. As a result, I get nostable but workable single click and not working double click.
Please advise me how it’s usualy doing?

Near here I post example of debug work of my driver with comments:

[color=brown]/// What we include

./devi-wm9712 -l

Uart Dec 13 2006 D
Fd Dec 13 2006 D
Abs Dec 13 2006 F
Rel Dec 13 2006 F
keyboard Dec 13 2006 F
phytouch Dec 29 2006 PD
[color=indigo]//// Some about…

use ./devi-wm9712

devi-wm9712 : PhyCORE-PXA270 Input Manager for Photon

General opts:
-v increment verbosity (default 0)
-l list List the internal modules. Modules are listed in
the following format:
module name | date last compiled | revision | class
where: class is comprised of (D)evice and/or
(P)rotocol and/or (F)ilter
Usage

%C phytouch [phytouch options] abs [abs options]

device & protocol module and his options:

phytouch device and protocol module for Wolfson 9712 chip under phyCORE-PXA270

-there are no dev&prot mudule options for now.

filter module and his options:

abs Transform and compresses absolute coordinate “touch” events

-b Touching the screen is a right mouse button (default left)
-c Calibrate mode - don’t transform coordinates
-f filename Calibration file name
-o x,y Origin of display region (default, origin of graphics region
)
-s x,y Coordinates of lower right corner of display region
(default, width and height of graphics region)
[color=blue]/// In run time

./devi-wm9712 -vvv phytouch abs

Looking up phytouch in module table
wm9712-init
Looking up abs in module table
Adding filter module: abs
Resetting module phytouch
wm9712-reset
mapping in 40500000
audio controller regs mmaped OK //wm9712 is audio codec too
cken space mmaped OK!
gpio setup done
Primary Codec ready
Test codec read at reg 0 - 6174
Resetting module abs
wm9712-dectl. event #A0…DEVCTL_GETDEVFLAGS
wm9712-dectl. event #F0…DEVCTL_XZ
wm9712-dectl. event #E0…DEVCTL_GETPTRCOORD
wm9712-dectl. event #1D0…DEVCTL_XZ
Input: star# t Photon interface
interrogate bus, returning abs
interrogate bus, returning abs
Error: found graphics region with no capabilities data
wm9712-dectl. event #1D0…DEVCTL_XZ

// Do single click 1
<< Pulse # 1 >> first pen down ignore X=590 Y=1324
<< Pulse # 2 >> X=571 Y=1261 deltaX=571 deltaY=1261
<< Pulse # 3 >> X=592 Y=1262 deltaX=21 deltaY=1
<< Pulse # 4 >> X=599 Y=1259 deltaX=7 deltaY=-3
<< Pulse # 5 >> X=598 Y=1246 deltaX=-1 deltaY=-13
<< Pulse # 6 >> X=583 Y=1258 deltaX=-15 deltaY=12
POINTERGETCTRL
// Single click 2
<< Pulse # 7 >> first pen down ignore X=1762 Y=3018
<< Pulse # 8 >> X=1761 Y=3041 deltaX=1761 deltaY=3041
<< Pulse # 9 >> X=1768 Y=3105 deltaX=7 deltaY=64
<< Pulse # 10 >> X=1760 Y=3032 deltaX=-8 deltaY=-73
<< Pulse # 11 >> X=1767 Y=3036 deltaX=7 deltaY=4

// Single click 3
<< Pulse # 12 >> first pen down ignore X=668 Y=529
<< Pulse # 13 >> X=668 Y=495 deltaX=668 deltaY=495
<< Pulse # 14 >> X=672 Y=576 deltaX=4 deltaY=81
<< Pulse # 15 >> X=677 Y=503 deltaX=5 deltaY=-73
<< Pulse # 16 >> X=663 Y=501 deltaX=-14 deltaY=-2

//Single click 4
<< Pulse # 17 >> first pen down ignore X=533 Y=667
<< Pulse # 18 >> X=545 Y=680 deltaX=545 deltaY=680
<< Pulse # 19 >> X=533 Y=716 deltaX=-12 deltaY=36
<< Pulse # 20 >> X=551 Y=692 deltaX=18 deltaY=-24
<< Pulse # 21 >> X=533 Y=692 deltaX=-18 deltaY=0

// Double click 1
//////Sub click 1
<< Pulse # 22 >> first pen down ignore X=2403 Y=1971
<< Pulse # 23 >> X=2389 Y=1965 deltaX=2389 deltaY=1965
<< Pulse # 24 >> X=2420 Y=1957 deltaX=31 deltaY=-8
//////Sub click 2
<< Pulse # 25 >> first pen down ignore X=2397 Y=1954
<< Pulse # 26 >> X=2426 Y=1960 deltaX=2426 deltaY=1960
<< Pulse # 27 >> X=2397 Y=1964 deltaX=-29 deltaY=4
<< Pulse # 28 >> X=2395 Y=1851 deltaX=-2 deltaY=-113

// Double click 2
//////Sub click 1
<< Pulse # 29 >> first pen down ignore X=2571 Y=1907
<< Pulse # 30 >> X=2573 Y=1945 deltaX=2573 deltaY=1945
<< Pulse # 31 >> X=2559 Y=1916 deltaX=-14 deltaY=-29
//////Sub click 2
<< Pulse # 32 >> first pen down ignore X=2536 Y=1900
<< Pulse # 33 >> X=2560 Y=1912 deltaX=2560 deltaY=1912
<< Pulse # 34 >> X=2564 Y=1907 deltaX=4 deltaY=-5
------------------->>>>>>>>>>>>>>>>>>--------------------

Thanks, that you read to thi place :slight_smile: . As you see I ignore the first coordinate of each click because it’s realy not in theme. After that driver works on single click more better and double click not work anyway.

If you had some else or know how to do in this situatian please tell me.
Thanks before!

So, any idea?
For now I see only the way to devide touchpanel surface in square regions and analyze pen down events for each square…
If you have ANY comments about touch spread data and methods for them, please post it !

Here is the algorithm by me.
// 1. In my case the first event have bad data,
// so i ignore
// 2. This algorithm may be in pulse function
// 3. For 1 click there are multiple coords generated

home:
//get data from hardware
if( first event )
{
//skip this
}
else if( second event )
{
//use this as default coord
}
else if( any else event )
{
//for x
if( abs( cur event coord - default event coord ) > deltaX )
{
//from now use cur coord as default coord
}
// for y ------> the same
// …
}

//give default coords to high level

go home;