USB Touch screen driver

Development of device drivers and control applications
User avatar
Eugene Gorbunoff
Site Admin
Posts: 685
Joined: Sat Apr 09, 2005 11:18
Location: St.Petersburg, Russia

USB Touch screen driver

Postby Eugene Gorbunoff » Sun May 02, 2010 21:22

From: Wim Brul
Date: 20100414

I looked at linux source code but the available usb drivers are provided by the manufacturers as binary modules. However I found "eGalaxTouch Software Programming Guide Version 2.0" and "SmartSet Touchscreen Controller Family Technical Reference Manual Manual Version 1.0" which descibe the serial protocols in detail.

There is some linux glue source code but the exact mapping of the serial protocols to usb vendor control transfers for output and to usb interrupt transfers for input is still unclear.

I am now studying the Touch Display Device Driver in the Input/Output Device Driver Reference for OS/2 and the associated source code to find out how to interface to the mouse.sys device driver.




From: Wim Brul
Date: 20100411


I have looked into the matter and gathered some information on touch screens and digitizing tablets. There are two ways I think to support these touch screens. One way is to produce emulated mouse events into the mouse.sys device driver (see touch.txt attached). The other way is to provide finger touch locator and pressure information from another pendd.sys like driver and would support Pen for OS/2.

The custom usb protocols have of course to be determined and requires someone who owns such a touch screen to exercise SnoopyPro on windows.

touch.txt

Code: Select all

Requirement to support usb touch screen devices.
-----------------------------------------------

These devices fall into two different categories:

 1. standard hid class conforming touch screens.
 2. non standard vendor specific touch screens.

Support for 1. may be provided by writing a new device driver like USBMOUSE.SYS
which interfaces with USBHID.SYS and MOUSE.SYS and which translates touch events
into mouse events to be processed by PM applications.

Support for 2. may be provided by writing a new device driver like USBMOUSE.SYS
which interfaces with USBD.SYS and MOUSE.SYS and which translates touch events
into mouse events to be processed by PM applications.

Writing device drivers is however not sufficient. These touch devices need to
be calibrated and a calibration program needs to be provided as well. One might
be tempted to try to use the existing CALIBRAT.EXE program but then an extra
interface from the new device driver with TOUCH.SYS must be provided.

This extra interface to TOUCH.SYS would have the advantage that existing non PM
applications (using xPM and xWPM touch function calls) would be supported too.
The disadvantage of course is that this may result into a lot of problems too.


Current xPM and xWPM mouse function calls.
-----------------------------------------
MOUCALLS.DLL - 16 bit API (device independent)
There is a DOS INT 13 API from VMOUSE.SYS
There is no 32 bit API for mouse events

Current xPM and xWPM touch function calls.
-----------------------------------------
TDICALLS.DLL - 16 bit API (device independent)
TDDCALLS.DLL - 16 bit API (device dependent)
TOUCALLS.DLL - 16 bit API (device dependent)
There is a DOS INT 7F API from VTOUCH.SYS
There is no 32 bit API for touch events


User avatar
Eugene Gorbunoff
Site Admin
Posts: 685
Joined: Sat Apr 09, 2005 11:18
Location: St.Petersburg, Russia

Re: USB Touch screen driver

Postby Eugene Gorbunoff » Sun May 02, 2010 21:24

From: Wim Brul
Date: 2010/05/02

I have experimented on how to interface to the mouse.sys device driver and rejected the way that usbmouse.sys it does because it uses relative mouse movements and it was impossible to get accurate mouse pointer positions for pm and fullscreen applications.

The mouse.sys device driver does provide absolute pointer positioning through its idc interface with the Process_Absolute request and it is possible to get accurate mouse pointer positioning this way.

In the attached file mouse.txt I describe how to provide support for usb touch screens devices. Please have a look at it.

I will tidy up and describe the new xsmouse.sys device driver in more detail like I did for the usbecd.sys device driver so that others may easily use it in the future.

When you find a developer who owns a touch screen and who wants to support it and who is willing to do the prototyping and to develop the supporting program then I will assist that person on how to interface to these device drivers.


mouse.txt

Code: Select all


How to support usb touch screen devices.
---------------------------------------

The solution is to split the one device driver approach into three separate
components. This way development is easier and may be conducted independently
by various developers that own particular touch screens. Moreover prototyping
may be done using rexx and when the protocols have been determined and proven
to work the supporting programs may be written.

These three separate components are:

1. Existing usbecd.sys driver to access the usb touch screen.
2. Newly written device driver to pass emulated mouse events.
3. Supporting programs for each of the touch screen devices.

My own experiments have demonstrated this to be a viable concept as it does
provide accurate absolute mouse input to pm and full screen applications.


Existing usbecd.sys driver to access the usb touch screen.
---------------------------------------------------------

This one is easy since it exists already. The config.sys needs
to contain for instance one of the the following statements:

DEVICE=C:\OS2\BOOT\USBECD.SYS /D:0EEF:0001:0100 /N:EGALAX$ /V
DEVICE=C:\OS2\BOOT\USBECD.SYS /D:04E7:0007:0105 /N:E2500U$ /V


Newly written device driver to pass emulated mouse events.
---------------------------------------------------------

The approach that I have taken is to write a simple device driver that feeds
absolute mouse events into the mouse.sys device driver. The config.sys needs
to contain the following statements in that order:

DEVICE=C:\OS2\BOOT\XSMOUSE.SYS /N:XSMOUSE$
DEVICE=C:\OS2\BOOT\MOUSE.SYS STYPE=XSMOUSE$

The /N:XSMOUSE$ and the STYPE=XSMOUSE$ link these two device drivers together
and the supporting application uses the chosen XSMOUSE$ device driver name to
access the mouse emulation device driver.


Supporting programs for each of the touch screen devices.
--------------------------------------------------------

Prototyping by the various developers may be done using rexx and involves
setting up the touch screen using control transfers and obtaining touch data
through interrupt transfers and generating absolute mouse events.

ddNameI = 'EGALAX$'
/* example obtain interrupt transfer data */
oiBuffer = x2c(EC 00 00 00 81 03 08 00 EE EE EE EE EE EE EE EE)
rc = charout(ddNameI,oiBuffer)

ddNameO = 'XSMOUSE$'
/* example supply absolute mouse event */
oBuffer = x2c(01 00 00 08 00 08 00 10 00 10)
rc = charout(ddNameO,oBuffer)

The corresponding supporting programs use doswrite instead and need to run
with time critical priority during their touch to mouse processing loops.


wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Sun May 09, 2010 19:16

The new Emulate Mouse Driver description is now available at http://home.hccnet.nl/w.m.brul/emumouse/index.html

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Mon May 10, 2010 19:14

The new Emulate Mouse Driver is now available at http://home.hccnet.nl/w.m.brul/emumouse/index.html

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Tue Sep 14, 2010 18:33

The new Emulate Mouse Driver is now available at http://hobbes.nmsu.edu/h-search.php?key ... ton=Search

I have placed it there since Sigurd Fastenrath was so kind to test this device driver with his Lenovo X200T digitizer. This digitizer is not usb connected, but can be accessed through a serial port. Many thanks to Sigurd.

User avatar
Eugene Gorbunoff
Site Admin
Posts: 685
Joined: Sat Apr 09, 2005 11:18
Location: St.Petersburg, Russia

Re: USB Touch screen driver

Postby Eugene Gorbunoff » Tue Sep 14, 2010 21:43

wow! so your driver is working.

So, how to activate the stylus on the Thinkpad?

? The users should install:
USBECD.SYS + xsmouse driver

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Wed Sep 15, 2010 11:23

Eugene Gorbunoff wrote:So, how to activate the stylus on the Thinkpad?


The X200T stylus is activated by having the following statements in config.sys

DEVICE=C:\OS2\BOOT\COM.SYS (1,200,4,I)
DEVICE=C:\OS2\BOOT\XSMOUSE.SYS
DEVICE=C:\OS2\BOOT\AMOUSE.SYS STYPE=XSMOUSE$

And running a rexx procedure to obtain raw events from the stylus and sending emulated mouse events into the operating system. Sigurd and I are currently working on a readme. Our intention is to put these on Hobbes as well.

Eugene Gorbunoff wrote:? The users should install: USBECD.SYS + xsmouse driver


No the stylus is accessed through the COM1 port as it is serially connected. Not USB connected.
Either AMOUSE.SYS STYPE=XSMOUSE$ or MOUSE.SYS STYPE=XSMOUSE$ may be used.

User avatar
Eugene Gorbunoff
Site Admin
Posts: 685
Joined: Sat Apr 09, 2005 11:18
Location: St.Petersburg, Russia

Re: USB Touch screen driver

Postby Eugene Gorbunoff » Wed Sep 15, 2010 13:07

OK,

I have only one suggestion:

it's necessary publish small guide: how to detect which kind of digitizer is installed in the computer?

Step 1: USB or Serial Port? Other type? So, main question: how to detect is it attached to COM-port or not?

Step 2:
List of supported USB devices: ..

List of supported COM port devices: ..
* What is the name of Sigurd's touch device?

Step 3:
How to collect information before contacting you?

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Thu Sep 16, 2010 09:54

Good suggestion. Not much info available yet.

We looked into the acpitree output to find the com port of the digitizer.

+*DTR_ T:[Device] HID:[WACF004] STA:[0xd] SxD State:[0xff:ff:ff:ff]
Current state:
> IO:[1 0x200 - 0x200 Al:1 Len:8]
>Trigger by Edge, Polarity High IRQ-4
> ENDTAG

We don't know the name of Sigurds digitizer. Only that it is in a Lenovo X200T.

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Sat Sep 18, 2010 12:08

The incomplete new Digitizer Support Guide is now available at http://home.hccnet.nl/w.m.brul/penguide/index.html

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Fri Jun 03, 2011 13:05

Boris Stefanov has tested the Lenovo Thinkpad X200 with finger and stylus input at 38400 baud and now it works!

The updated Digitizer Support Guide is available at http://home.hccnet.nl/w.m.brul/penguide/index.html

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Sat Dec 17, 2011 18:48

Peter Brede has tested the eGalax TouchController and it works. Sigurd Fastenrath has tested the Asus Eee Slate model EP121 and it works without having to calibrate. Joop Nijenhuis has tested the Wacom Bamboo CTH-461 and CTL-460 and Wim Brul has tested the Wacom Bamboo CTH-460 and these work too. These are all USB devices.

The online penguide and pentools have been updated accordingly.

wimpie
Posts: 27
Joined: Sat Feb 06, 2010 21:57
Contact:

Re: USB Touch screen driver

Postby wimpie » Mon Jul 30, 2012 19:58

Trevor Clarke has tested the HP TC4200 and its stylus works. Access is through the com port.
The online penguide and pentools have been updated accordingly.

User avatar
Eugene Gorbunoff
Site Admin
Posts: 685
Joined: Sat Apr 09, 2005 11:18
Location: St.Petersburg, Russia

Re: USB Touch screen driver

Postby Eugene Gorbunoff » Mon Jul 30, 2012 22:18

This laptops (should) are supported with your drivers:

IBM / Lenovo
Thinkpad X61 Tablet
Thinkpad X60
Thinkpad X41 Tablet
Thinkpad X200 Tablet (X200, X201, X201s, and X220)

Fujitsu Fujitsu LifeBook T4310 T4410 T5010 Tablet PC

ASUS ASUS Tablet EP121

HP HP TC440 TC4200 2710p 2730p 2740p 2760p Tablet


Return to “USB development”

Who is online

Users browsing this forum: No registered users and 2 guests

cron