On Wed, Feb 09, 2005 at 06:08:10PM +0000, Paulo Marques wrote:
[...]
Touchscreens are one class of devices where the serial attachment is not
dying.
[...]We could parse a definition "string", like this:
"SIZE:10,SYNC:0:8:85,SYNC:8:8:54,X:24:8:1,X:32:8:256,Y:40:8:1,Y:48:8:256,T:16:2:1"
This string defines the touch driver for elotouch, 10 bytes packet (I didn't include the pressure reading, for simplification).
I currently have 6 different "drivers" that would all fit into this model. The same goes for all 3 elotouch protocols that you implemented.
Does this sound like a good idea?
I don't think so. I don't think the saving of code is worth the
obfuscation, after all, 6 drivers is still not so much.
Also, direct code implementation can implement better synchronization
methods and faster resynchronization in case of lost bytes.
And then there are protocols like the Gunze one, which wouldn't be
covered by this.
[...]
We could have a library that would do that and link applications against
it. It could also handle things like tap-n-drag, etc, something we
certainly don't want in the kernel.
[...]I would say that a tool to recover the touch screen into a "usable" state, by talking directly to the serial port, and "calibrating" it to max possible / min possible values would be the best way to deal with this.
I agree with that. It could possibly even be put into the inputattach
init routine for the specific touchscreen.
Modern touchscreens just send the A/D data to the PC, and let the real processor do the math (it can even do more complex calculations, like compensate for rotation, etc.). IMHO calibration should be handled by software.
And this is something the kernel certainly won't do. Floating point math
is possible in the kernel with some jumping through hoops, but avoiding
it is usually the better option.