Touchscreen settings EDT - ETM07001ADH6

  • Hi, i have two problems with my touchscreen :


    - I want to get the x,y,z coordinates
    - I want to increase the threshold and gain of the touch


    During the initializations phase i get the folowing message:


    Code
    1. samsung-ts s3c2410-ts: driver attached, registering input device
    2. input: S3C24XX TouchScreen as /devices/virtual/input/input0
    3. input: ft5x0x_ts as /devices/virtual/input/input1
    4. ft5x0x_ts probed. (v0.2)


    With the command cat /dev/input/event1 i get binary data when i touch the screen so the device is mapped with the handler event1 and the driver seems to be the ft5x06_ts.c


    Is this correct?
    How can i do what i want?


    Thank you in advance

  • ok, i've edited the ft5x06 driver and when i touch the display i see the coordinates in the console


    in /sys/class/i2c-dev/i2c-0/device i have s3c2410-i2c


    into the folder 0-0038 i have gain , thold and offs files for change the gain threshold and offset parameters and it work fine


    i would to change these values programmatically and i've written a very simple program in C but it fails on i2c_smbus_read_word_data returning <0 value and i get the error "Failed to set slave address: Device or resource busy"


    Can anyone help me?




    #include "i2c-dev.h"
    #include <linux/types.h>
    #include <stdio.h>
    #include <fcntl.h>


    #define ADDRESS 0x38
    #define REGIST 0x30


    int main(int argc, char *argv[])
    {


    int adapter_nr = 0;

    snprintf(filename, 19, "/dev/i2c-%d", adapter_nr); /* The I2C adapter to use */
    file = open(filename, O_RDWR);
    if (file < 0) {
    printf("\nADAPTER ERROR\n");
    return -1;
    }
    if (ioctl(file, I2C_SLAVE, ADDRESS) < 0) {
    fprintf( stderr, "Failed to set slave address: %m\n" );
    return -1;
    }
    res = i2c_smbus_read_word_data(file, REGIST);
    if (res < 0) {
    printf("\nERROR SMBUS %d\n",res);
    return -1;
    } else {
    /* res contains the read word */
    }
    }

  • In this case, you are dealing with two different touch controllers. One is the 4-wire resistive touch controller on-board the PicoCOM4. This is the s3c2410_touch that uses /dev/input/event0 by default, because it is the first input device that is registered when the system starts. The other one is the capacitive touch controller included with the EDT display, which is a FT5x06 based device. This is connected via I2C to the PicoCOM4. It uses /dev/input/event1, because it is the second input device registered when the system starts. This is why you see both messages appearing in the boot log.


    You actually only use the external touch controller FT5X06. This is why you see the values only if you look into /dev/input/event1. So if you want to calibrate the touch or if you want to modify other parameters, you have to do this for the device on /dev/input/event1, i.e. the FT5X06 controller. For example if you want to start the calibration, you may have to set the environment variable TSLIB_TSDEVICE to the according input event.


    Code
    1. export TSLIB_TSDEVICE=/dev/input/event1
    2. ts_calibrate


    Each kind of touch controller has its own set of parameters to modify sensitivity and other settings. So the parameters are very different between these two devices. The internal touch uses completely different parameters than the external FT5X06. The FT5X06 only uses three parameters: gain, thold and offs. You can see these parameters in the /sys directory. And you can also modify them there, for example by echoing a value and redirecting the output to the "gain" file.


    How you can do this from your program depends on the device driver for the appropriate controller. If the driver implements some ioctl() functions to modify these values, then you can use these ioctls. However when looking at the ft5x06.c, I don't see any ioctl implementation. So the only way is to modify the values in the sysfs, too. So for example to modify the gain value, you have to find the correct sysfs directory path, open the "gain" file and write the new value to it. Something like the following should work.


    Code
    1. #define touchdev "/sys/class/input/event1/.../gain" /* fill in correct path here */
    2. FILE *f;
    3. ...
    4. f = fopen(touchdev, "w");
    5. fprintf(f, "%d", 123);
    6. fclose(f);
    7. ...

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.