LCD Technical Documentation
#9
(01-17-2017, 02:47 PM)Workaholic Wrote:
(01-17-2017, 11:16 AM)dkryder Wrote: yeah , that is rather interesting work on connector. so, i guess you got to experience the china express option on your package?

Actually, fine soldering isn't big deal for me, but I have no idea how to rotate LCD against TP in software.  Blush
Unfortunately GT911 has no registers to configure it, so I guess it can be done somewhere in Android only.
So, I'm going to experiment with rooted version.
Guys, who knows, please advise me right way. 

Andrey d;-)

You could try the following:

Android does rotate the Screen and Touch by software (in Java, this is slow and it is compensated by the fast HW blitting), you could modify the touch part only and rebuild the Android.

You cannot rotate screen as we usually do it in Intel but you could cheat the TSLIB in doing a rotation against the screen.

Capacitive touch are in absolute coordinate so there is no need for calibration (most of the times), but you could
compile and use TSLIB driver just like the old days (used for resistive touch), it works i usually use this driver for my capacitive touch experiments.

This is not going to be easy if you use Ubuntu, they dropped support long ago but you can grab the Debian version or use Debian for this but i cannot guarantee this will work as you expect but worth a try.

a) Grab the xf86-input-tslib source package (from Debian or the one you can find, if i recall correctly the last version was xf86-input-tslib 0.0.6 for X11)

b) Compile the driver, you will get tslib_drv.so (install it)

c) You will need this patch to make it work for the X11 version, if i recall correctly.

--- src/tslib.c 2013-06-30 15:20:14.939201439 +0400
+++ src/tslib.c 2013-06-26 18:19:16.000000000 +0400
@@ -196,9 +196,9 @@
                         x = samp.x;
                         y = samp.y;
 
-                        xf86XInputSetScreen(local, priv->screen_num,
-                                        samp.x,
-                                        samp.y);
+                        //xf86XInputSetScreen(local, priv->screen_num,
+                        //                samp.x,
+                        //                samp.y);
 
                         xf86PostMotionEvent (local->dev, TRUE, 0, 2,
                                         x, y);



c) study the ReadInput and change/force rotation for the touch part only.

static void ReadInput (InputInfoPtr local)
{
struct ts_priv *priv = (struct ts_priv *) (local->private);
struct ts_sample samp;
int ret;
int x,y;
ScrnInfoPtr pScrn = xf86Screens[priv->screen_num];
Rotation rotation = rrGetScrPriv (pScrn->pScreen) ? RRGetRotation(pScrn->pScreen) : RR_Rotate_0;
struct timeval now;

while((ret = ts_read(priv->ts, &samp, 1)) == 1) {
gettimeofday(&now, NULL);
struct timeval pressureTime = TimevalDiff(now,priv->button_down_start);

if(samp.pressure) {
int tmp_x = samp.x;

switch(priv->rotate) {
case TSLIB_ROTATE_CW: samp.x = samp.y;
samp.y = priv->width - tmp_x;
break;
case TSLIB_ROTATE_UD: samp.x = priv->width - samp.x;
samp.y = priv->height - samp.y;
break;
case TSLIB_ROTATE_CCW: samp.x = priv->height - samp.y;
samp.y = tmp_x;
break;
default: break;
}

tmp_x = samp.x;

switch(rotation) {
case RR_Rotate_90:
samp.x = (priv->height - samp.y - 1) * priv->width / priv->height;
samp.y = tmp_x * priv->height / priv->width;
break;
case RR_Rotate_180:
samp.x = priv->width - samp.x - 1;
samp.y = priv->height - samp.y - 1;
break;
case RR_Rotate_270:
samp.x = samp.y * priv->width / priv->height;
samp.y = (priv->width - tmp_x - 1) * priv->height / priv->width;
break;
}

priv->lastx = samp.x;
priv->lasty = samp.y;
x = samp.x;
y = samp.y;

xf86XInputSetScreen(local, priv->screen_num,
samp.x,
samp.y);

xf86PostMotionEvent (local->dev, TRUE, 0, 2,
x, y);

}

d) Change/add Xorg.conf to actually use the touch driver, see  "InputClass" section

# This is a minimal sample config file, which can be copied to
# /etc/X11/xorg.conf in order to make the Xorg server pick up
# and load xf86-video-fbturbo driver installed in the system.
#
# When troubleshooting, check /var/log/Xorg.0.log for the debugging
# output and error messages.
#
# Run "man fbturbo" to get additional information about the extra
# configuration options for tuning the driver.

Section "Device"
        Identifier      "A20 FBTURBO"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb0"
        Option          "SwapbuffersWait" "true"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection

Section "DRI"
Mode 0666
EndSection

Section "InputClass"
Identifier "Sunxi-Touchscreen"
MatchDevicePath "/dev/input/event*"
MatchProduct "sunxi-ts"
Driver "tslib"
EndSection

e) Reboot or re-start X11

e) Before you use the tslib driver we will need to calibrate it (yes, we know capacitive does not need calibration), the driver uses the file /etc/pointer and it need some calibration values.
This is done by the tslib-1.0. Grab the code and compile it.

For this you run ts_calibrate that will create /etc/pointer, but before you run ts_calibrate you have to identify which input is active for the touch, look in dmesg after you reboot.
After finding the correct input event used, export it to ts_calibrate get the events from the touch. 

export TSLIB_TSDEVICE=/dev/input/event4 (or you current input event number)
./ts_calibrate

Touch the points in screen, if everything is right you get /etc/pointer with some coordinates.
If ts_calibrate crashes you need to review the patch c) , if you touch the screen and you don't get anything, please check again the correct input event number.

I would advise you to make TSLIB driver works first as normal touch (not rotated) and then change the code to rotate against screen.

Hope this helps, good luck!

* Small update:

MatchProduct "gt911_DB" or "gt911_DBx" or "gt9xxf_ts"
  Reply


Messages In This Thread
LCD Technical Documentation - by pfeerick - 11-24-2016, 09:47 PM
RE: LCD Technical Documentation - by Workaholic - 12-16-2016, 04:58 AM
RE: LCD Technical Documentation - by Workaholic - 12-18-2016, 05:30 PM
RE: LCD Technical Documentation - by tllim - 12-18-2016, 11:15 PM
RE: LCD Technical Documentation - by Workaholic - 01-17-2017, 07:06 AM
RE: LCD Technical Documentation - by xalius - 01-17-2017, 07:14 AM
RE: LCD Technical Documentation - by dkryder - 01-17-2017, 11:16 AM
RE: LCD Technical Documentation - by Workaholic - 01-17-2017, 02:47 PM
RE: LCD Technical Documentation - by @lex - 01-17-2017, 06:29 PM
RE: LCD Technical Documentation - by Workaholic - 01-18-2017, 01:48 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)