This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using Touch Screen lib

Hi !

 

I would like to use the touch screen lib from my EZSDK, but when i try this on my target:

/usr/bin/ts_calibrate

I have an error: ts_open: No such file or directory

 

So i looked everywhere on the internet, and i found how to download/install and use the lib when don't have it....but in my case, this lib is already configure for my target (or i hope so).

 

Following this link, i looked at my environment variable, and TSLIB_TSDEVICE value was: /dev/input/touchscreen0

 

On my target there is no existing /dev/input/touchscreen0 file, so i create one, which give me another error:

tslib: Selected device is not a Linux input event device

 

Well, i could loose a lot of time... so i wonder do you know how should i do to use the touch screen lib ?

 

Thank you for your help,

 

Bat

 

  • Bat,

    I'm not sure which device you are trying to use, but in general the way that this works is like you described, the default TSLIB_TSDEVICE is set to use /dev/input/touchscreen0.  This link is created by the udev rule in /etc/udev/rules.d/local.rules

    The rule looks like:

    SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"


    This rule basically says to look at the modalias files in sysfs event interfaces in the input subsystem and check if they follow the regular expression "input:*-e0*,3,*a0,1,*18,*"  If so then create the /dev/input/touchscreen0 link to the the proper event interface.  For example on the am335x this is

    /sys/devices/platform/tsc/input/input2/modalias

    If the regular expression does not match then the symlink will not be created and the /dev/input/touchscreen0 device will not exist.  In the past on the am335x for example, when the pressure attribute was not exported the regular expression did not match.  At that time we added a rule (since removed) to /etc/udev/rules.d/local.rules like:

    SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="platform:tsc", SYMLINK+="input/touchscreen0"

    and this would create the symlink.  You could also make the symlink yourself directly to the event for the touchscreen device.  A third option is to change the export of TSLIB_DEVICE to point to the proper event interface as well.

    I hope this helps.

    Chase

  • Hi Bat,

    If you are using DM8148 EVM and EZSDK 5.03 releases then following two commands that are mentioned in "DM814x_EZ_Software_Developers_Guide.pdf" will help for calibration of LCD.

    ln -s /dev/input/event0 /dev/input/touchscreen0

    ts_calibrate

    Cheers

    Vijayvithal

  • Thanks guys for your help.

    I try first Vijayvithal solution which is more simple, even if i am using DM816x EVM and EZSDK 05.02, and it works !!

     

    Bat