Tslib Not Creating Device

can't get tslib to work with FT5x06

Tslib will require the setup of several files and/or environment variables to work out of the box. Here is a sample of some environment variables,

 TSLIB_CONSOLEDEVICE=none
TSLIB_FBDEVICE=/dev/fb0
TSLIB_TSDEVICE=/dev/input/touch
TSLIB_CALIBFILE=/etc/pointercal
TSLIB_CONFFILE=/etc/ts.conf

Many variables are not needed to run Qt with tslib. However, you will need the TSLIB_TSDEVICE, TSLIB_CALIBFILE, and TSLIB_CONFFILE to use with Qt. The binaries ts_calibrate will use the TSLIB_FBDEVICE device to display some text. This will then write a configuration to the TSLIB_CALIBFILE.

To determine the correct TSLIB_TSDEVICE to use, the files /sys/class/input/input*/name can be examined. The name should be something like FT5202 Touchscreen. I use this information at boot time to soft link /dev/input/inputX to /dev/input/touch in the example above. The inputX file may change as other input drivers are plugged into a system, such as a USB mouse, etc. These file locations may depend on the type of udev or mdev you use for the /dev directory population in user space.

The ts.conf file is a list of modules to load. Here is an example for the 'Focal Tech' device,

module_raw input
module linear

Tslib is structured with several modules (shared libraries) which are loaded dynamically at run time. Typically, these modules need to be loaded to /usr/lib/ts and your kernel and filesystem (libc) need to support shared libraries. Specifically, the linear module will use the output of the ts_calibrate program to map touch co-ordinates to screen co-ordinates. This was much more useful with resistive touch technology where x and y parameters may inter-mix, including sheering, etc.

Note: it is possible to avoid this calibration step, which is highly desirable if you are manufacturing large quantities.

The numbers in the /etc/pointercal are read into an array a[0] -> a[7]. The formula is like this,

x' = (a2 + a0 *x + a1 * y) / a6;
y' = (a5 + a3 *x + a4 * y) / a6;

For the capacitive case, there is no sheer. Moreover, the values for the FocalTech devices seem to be restricted so that screen position (0,0) is touch position (0,0) and all the devices give the same maximum (x,y) values. So the equations reduce to,

x' = (a1 * x) / a6;
y' = (a4 * y) / a6;

So the only purpose of the pointercal file is to map touch to screen co-ordinates AND the same for each device. So you can manual hex-edit a pointercal file when you back solve the equations for the maximum screen positions. You can get this information via the ts_print_raw binary.

Finally, the Qt Mouse Calibration class can be used to completely avoid tslib. You only need code with the fixed three constants that will transform the co-ordinates. You avoid the tslib package entirely.

Touchscreen and Driver Installed but tslib Cannot Calibrate

Try to add

input_dev = input_allocate_device();
[..]
set_bit(EV_ABS, input_dev->evbit);
set_bit(EV_KEY, input_dev->evbit);

So that the tslib sees the device as supporting both EV_ABS and EV_KEY events (even if it does not actually send both of those).

You know how to reach me if you have more questions... ;)

tslib tools don't draw anything on the screen

Turns out it was incorrectly configured framebuffer driver to blame, probably color depth or bit setup. So terminal console just drew itself black on black and ts-calibrate tool wasn't working. Also fbcon wasn't enabled in kernel options.
Strangely Qt app worked anyway though.

Visual Studio Code: 'tslib' cannot be found error in Angular project

Below is my package.json file using angular 8. Check to see if you have tslib install or not.

Also delete package-lock.json and delete node_modules folder then run npm i again

{
"name": "ngrx",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~8.0.0",
"@angular/common": "~8.0.0",
"@angular/compiler": "~8.0.0",
"@angular/core": "~8.0.0",
"@angular/forms": "~8.0.0",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.0",
"@angular/cli": "~8.0.0",
"@angular/compiler-cli": "~8.0.0",
"@angular/language-service": "~8.0.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
}
}


Related Topics



Leave a reply



Submit