Next Previous Contents

3. XFree86 driver

I took the elo touch screen driver and modified it to serve my needs. Thanks to those who developed it.

3.1 Download

Source

Here is the XFree86 driver source:

xf86B112-0.9.tar.gz

xf86B112-0.9-1.src.rpm


$ tar xzf xf86B112-0.9.tar.gz
$ cd xf86B112-0.9
$ make

Binary

Here is a binary version compiled for XFree86 3.3.5.

xf86B112.so

xf86B112-0.9-1.i386.rpm

3.2 XF86Config

Here you see the relevant sections of the XF86Config


Section "module" 
        Load "xf86B112.so" 
EndSection 
       
Section "Xinput" 
    Subsection "B112" 
        Port "/dev/psaux" 
        DeviceName "touchscreen" 
        MinimumXPosition 44 
        MinimumYPosition 62 
        MiddleXPosition 507 
        MiddleYPosition 466 
        MaximumXPosition 980 
        MaximumYPosition 894 
        DebugLevel 0 
        Emulate3Buttons
        Emulate3Timeout 50
#       DebugLevel 100 
        AlwaysCore 
    EndSubSection 
EndSection 

Section "Pointer" 
   Protocol        "Microsoft" 
   Device          "/dev/ttyS0" 
   Emulate3Timeout 50 
   Resolution      100 
#   Buttons         2 
   Buttons         3 
   Emulate3Buttons 
EndSection

3.3 B112 Parameters special parameters

Port "/dev/psaux"

not to change ....

DeviceName "touchscreen"

whatever you want

MinimumXPosition 44

Calibration value: bottom left point

MinimumYPosition 62

Calibration value: bottom left point

MiddleXPosition 507

Calibration value: middle of the screen (400/300)

MiddleYPosition 466

Calibration value: middle of the screen (400/300)

MaximumXPosition 980

Calibration value: top right point

MaximumYPosition 894

Calibration value: top right point

DebugLevel 0

Set this to a higher number for coordinate reporting

AlwaysCore

Let it be the main XInput device

3.4 Calibration Parameters

You should change the 'Position' calibration parameters either using the DebugLevel Parameter and change the console to view the debugging info after you touched the screen, or you can use the following small programs:

tdump

dumps the raw bytes. I used it to figure out, how to initialize the panel.

tcoord

dumps the coordinates you can use for the 'Positions'.

For the MiddlePosition you can use the initial cursor position when X starts. Just try to hit the cursor, then switch to the debugging console and write down the positions. The converted result should be 400,300 on a 800x600 display. Remember: the bottom left is 0,0!

3.5 APM and suspend

To turn absolute coordinate mode on after suspension I use the following /etc/apmd_proxy script:


#!/bin/sh

case $1 in
   start)
      ;;
   change)
      case $2 in
         power)
            ;;
         battery)
            ;;
      esac;;
   resume)
      hwclock --hctosys
      touch /var/tmp/resetB112
      ;;  
esac

The Xserver removes /var/tmp/resetB112 and turns the touchscreen in absolute mode.
Next Previous Contents