Xenarc USB touchscreen for Beagleboard/OMAP3 EVM

From eLinux.org
Revision as of 02:40, 21 April 2009 by Pratheeshg (Talk | contribs)

Jump to: navigation, search

XENAARC is a 7" LCD touchscreen (https://www.xenarcdirect.com/product.php?productid=16194), which takes DVI for digital input and USB touchscreen interface. The below are the steps followed to make touchscreen work with OMAP3 EVM or Beagleboard running Angstrom distribution. There are lots of information in the web - this page kind of tries to consolidate the necessary steps.

(1) Enable EVDEV support in linux kernel

(2) Build the evtouch driver(http://www.conan.de/touchscreen/evtouch.html) for X.org – if you are using OE just create xf86-input-evtouch_0.8.8.bb file in openembedded\packages\xorg-driver folder as shown below and do a bitbake –b xf86-input-evtouch_0.8.8


require xorg-driver-input.inc DESCRIPTION = "X.Org X server -- evtouch input driver" PR = "r1" SRC_URI = "http://www.conan.de/touchscreen/xf86-input-evtouch-0.8.8.tar.bz2 \ "

(3) Copy the generated binary evdev_drv.so to /usr/lib/xorg/modules/input/ or install xf86-input-evtouch_0.8.8-r1.1_armv7a.ipk on your target

(4) Copy 69-touchscreen.rules to /etc/udev/rules.d/ folder, this will make sure that touchscreen is always mapped to /dev/input/evtouch_event and even if you detach USB cable during a session. This is important as we are going to hardcode this event in xorg.conf


KERNEL=="event*", SUBSYSTEM=="input", SYSFS{idVendor}=="0eef", SYSFS{idProduct}=="0001", SYMLINK+="input/evtouch_event"

(5) Time to calibrate. calibrator.c is patched version of (http://www.harbaum.org/till/cnc/cx-t100/calibrator.c). Some changes are needed because ABS_X and ABS_Y key values are different for our touchscreen. Build calibrator.c. Then do ./calibrator /dev/input/evtouch_event from Xterm and follow the instructions to click four points in the corners. This program will printout Max/Min X/Y values which we need to copy to xorg.conf. Please note that you need to disable evtouch driver from xorg.conf during calibration , comment touchscreen section from ServerLayout in xorg.conf (#InputDevice "touchscreen" "SendCoreEvents")

--- calibrator.c.orig 2009-04-21 15:58:21.000000000 +0530 +++ calibrator.c 2009-04-17 21:42:54.000000000 +0530 @@ -31,8 +31,11 @@ struct input_event {

#define EV_ABS			0x03

/* codes */

-#define ABS_X 0x00 -#define ABS_Y 0x01 +//#define ABS_X 0x00 +//#define ABS_Y 0x01 +#define ABS_X 0x02 +#define ABS_Y 0x03 +

#define SYN_REPORT		0
#define BTN_LEFT		0x110
#define BTN_RIGHT		0x111

@@ -40,7 +43,7 @@ struct input_event {

/* some constants */

-#define FONT_NAME "9x15" +#define FONT_NAME "6x13" //"9x15"

#define IDLETIMEOUT		15
#define BLINKPERD		0.16        

(5) Copy paste the Min/Max/X/Y values output by calibrator to xorg.conf, important sections in xorg.conf looks as shown below

Section "InputDevice"

           Identifier "touchscreen"
           Driver "evtouch"
           Option "Device" "/dev/input/evtouch_event"
           Option "DeviceName" "touchscreen"
           Option "MinX" "274"
           Option "MinY" "281"
           Option "MaxX" "3839"
           Option "MaxY" "3883"
           Option "ReportingMode" "Raw"
           Option "Emulate3Buttons"
           Option "Emulate3Timeout" "50"
           Option "SendCoreEvents" "On"
           Option "Rotate" "CCW"
           Option "SwapY" "1"


Section "ServerLayout"

       Identifier      "Builtin Default Layout"                                     
       Screen  "Builtin Default fbdev Screen 0" 
       InputDevice "touchscreen" "SendCoreEvents"       


(6) Restart X and that’s about it.