-
Notifications
You must be signed in to change notification settings - Fork 2
Touchpanel
People with a github account can edit these pages.
Please help advancing the knowledge on this subject. Add your experience with a particular display under it's own heading.
Remember to add a link to the information source.
Update: ads7846_test is removed. ads7846_device is used instead together with ads7846
It has the same arguments, except for debug which is now verbose.
I will update this page later.
sudo modprobe ads7846
sudo modprobe ads7846_device (use the same arguments as in the examples, except for debug=>verbose)
inxput and evtest is not installed by default
sudo apt-get -y install xinput evtest
This panel uses the TSC2046 touch controller (supported by ads7846.c).
Using the SPI interface circuit, I have been able to hook up the Touch controller.
This is how I have done initial testing, trying all rotate values:
modprobe fbtft_device name=flexfb gpios=reset:25,dc:24,led:18
modprobe flexfb debug=3 rotate=0 width=240 height=320 regwidth=16 setaddrwin=1 init=-1,0x00E3,0x3008,-1,0x00E7,0x0012,-1,0x00EF,0x1231,-1,0x0001,0x0100,-1,0x0002,0x0700,-1,0x0003,0x1030,-1,0x0004,0x0000,-1,0x0008,0x0207,-1,0x0009,0x0000,-1,0x000A,0x0000,-1,0x000C,0x0000,-1,0x000D,0x0000,-1,0x000F,0x0000,-1,0x0010,0x0000,-1,0x0011,0x0007,-1,0x0012,0x0000,-1,0x0013,0x0000,-2,200,-1,0x0010,0x1690,-1,0x0011,0x0223,-2,50,-1,0x0012,0x000D,-2,50,-1,0x0013,0x1200,-1,0x0029,0x000A,-1,0x002B,0x000C,-2,50,-1,0x0020,0x0000,-1,0x0021,0x0000,-1,0x0030,0x0000,-1,0x0031,0x0506,-1,0x0032,0x0104,-1,0x0035,0x0207,-1,0x0036,0x000F,-1,0x0037,0x0306,-1,0x0038,0x0102,-1,0x0039,0x0707,-1,0x003C,0x0702,-1,0x003D,0x1604,-1,0x0050,0x0000,-1,0x0051,0x00EF,-1,0x0052,0x0000,-1,0x0053,0x013F,-1,0x0060,0xA700,-1,0x0061,0x0001,-1,0x006A,0x0000,-1,0x0080,0x0000,-1,0x0081,0x0000,-1,0x0082,0x0000,-1,0x0083,0x0000,-1,0x0084,0x0000,-1,0x0085,0x0000,-1,0x0090,0x0010,-1,0x0092,0x0600,-1,0x0007,0x0133,-3
modprobe ads7846_test debug=1 cs=1 speed=2000000 model=7846 x_min=230 x_max=3900 y_min=200 y_max=3700 x_plate_ohms=80 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
modprobe flexfb debug=3 rotate=1 width=320 height=240 regwidth=16 setaddrwin=1 init=-1,0x00E3,0x3008,-1,0x00E7,0x0012,-1,0x00EF,0x1231,-1,0x0001,0x0100,-1,0x0002,0x0700,-1,0x0003,0x1028,-1,0x0004,0x0000,-1,0x0008,0x0207,-1,0x0009,0x0000,-1,0x000A,0x0000,-1,0x000C,0x0000,-1,0x000D,0x0000,-1,0x000F,0x0000,-1,0x0010,0x0000,-1,0x0011,0x0007,-1,0x0012,0x0000,-1,0x0013,0x0000,-2,200,-1,0x0010,0x1690,-1,0x0011,0x0223,-2,50,-1,0x0012,0x000D,-2,50,-1,0x0013,0x1200,-1,0x0029,0x000A,-1,0x002B,0x000C,-2,50,-1,0x0020,0x0000,-1,0x0021,0x0000,-1,0x0030,0x0000,-1,0x0031,0x0506,-1,0x0032,0x0104,-1,0x0035,0x0207,-1,0x0036,0x000F,-1,0x0037,0x0306,-1,0x0038,0x0102,-1,0x0039,0x0707,-1,0x003C,0x0702,-1,0x003D,0x1604,-1,0x0050,0x0000,-1,0x0051,0x00EF,-1,0x0052,0x0000,-1,0x0053,0x013F,-1,0x0060,0xA700,-1,0x0061,0x0001,-1,0x006A,0x0000,-1,0x0080,0x0000,-1,0x0081,0x0000,-1,0x0082,0x0000,-1,0x0083,0x0000,-1,0x0084,0x0000,-1,0x0085,0x0000,-1,0x0090,0x0010,-1,0x0092,0x0600,-1,0x0007,0x0133,-3
modprobe ads7846_test swap_xy=1 debug=1 cs=1 speed=2000000 model=7846 x_min=230 x_max=3900 y_min=200 y_max=3700 x_plate_ohms=80 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
modprobe flexfb debug=3 rotate=2 width=240 height=320 regwidth=16 setaddrwin=1 init=-1,0x00E3,0x3008,-1,0x00E7,0x0012,-1,0x00EF,0x1231,-1,0x0001,0x0100,-1,0x0002,0x0700,-1,0x0003,0x1000,-1,0x0004,0x0000,-1,0x0008,0x0207,-1,0x0009,0x0000,-1,0x000A,0x0000,-1,0x000C,0x0000,-1,0x000D,0x0000,-1,0x000F,0x0000,-1,0x0010,0x0000,-1,0x0011,0x0007,-1,0x0012,0x0000,-1,0x0013,0x0000,-2,200,-1,0x0010,0x1690,-1,0x0011,0x0223,-2,50,-1,0x0012,0x000D,-2,50,-1,0x0013,0x1200,-1,0x0029,0x000A,-1,0x002B,0x000C,-2,50,-1,0x0020,0x0000,-1,0x0021,0x0000,-1,0x0030,0x0000,-1,0x0031,0x0506,-1,0x0032,0x0104,-1,0x0035,0x0207,-1,0x0036,0x000F,-1,0x0037,0x0306,-1,0x0038,0x0102,-1,0x0039,0x0707,-1,0x003C,0x0702,-1,0x003D,0x1604,-1,0x0050,0x0000,-1,0x0051,0x00EF,-1,0x0052,0x0000,-1,0x0053,0x013F,-1,0x0060,0xA700,-1,0x0061,0x0001,-1,0x006A,0x0000,-1,0x0080,0x0000,-1,0x0081,0x0000,-1,0x0082,0x0000,-1,0x0083,0x0000,-1,0x0084,0x0000,-1,0x0085,0x0000,-1,0x0090,0x0010,-1,0x0092,0x0600,-1,0x0007,0x0133,-3
modprobe ads7846_test debug=1 cs=1 speed=2000000 model=7846 x_min=230 x_max=3900 y_min=200 y_max=3700 x_plate_ohms=80 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 1
modprobe flexfb debug=3 rotate=3 width=320 height=240 regwidth=16 setaddrwin=1 init=-1,0x00E3,0x3008,-1,0x00E7,0x0012,-1,0x00EF,0x1231,-1,0x0001,0x0100,-1,0x0002,0x0700,-1,0x0003,0x1018,-1,0x0004,0x0000,-1,0x0008,0x0207,-1,0x0009,0x0000,-1,0x000A,0x0000,-1,0x000C,0x0000,-1,0x000D,0x0000,-1,0x000F,0x0000,-1,0x0010,0x0000,-1,0x0011,0x0007,-1,0x0012,0x0000,-1,0x0013,0x0000,-2,200,-1,0x0010,0x1690,-1,0x0011,0x0223,-2,50,-1,0x0012,0x000D,-2,50,-1,0x0013,0x1200,-1,0x0029,0x000A,-1,0x002B,0x000C,-2,50,-1,0x0020,0x0000,-1,0x0021,0x0000,-1,0x0030,0x0000,-1,0x0031,0x0506,-1,0x0032,0x0104,-1,0x0035,0x0207,-1,0x0036,0x000F,-1,0x0037,0x0306,-1,0x0038,0x0102,-1,0x0039,0x0707,-1,0x003C,0x0702,-1,0x003D,0x1604,-1,0x0050,0x0000,-1,0x0051,0x00EF,-1,0x0052,0x0000,-1,0x0053,0x013F,-1,0x0060,0xA700,-1,0x0061,0x0001,-1,0x006A,0x0000,-1,0x0080,0x0000,-1,0x0081,0x0000,-1,0x0082,0x0000,-1,0x0083,0x0000,-1,0x0084,0x0000,-1,0x0085,0x0000,-1,0x0090,0x0010,-1,0x0092,0x0600,-1,0x0007,0x0133,-3
modprobe ads7846_test swap_xy=1 debug=1 cs=1 speed=2000000 model=7846 x_min=230 x_max=3900 y_min=200 y_max=3700 x_plate_ohms=80 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 0
These x/y min/max values isn't working very well on my display. The x values changes a lot from top to bottom, as the stylus is moved up and down. The y values behaves more reasonable.
Edit this if you find good values or other info.
modprobe fbtft_device name=sainsmart32spifb
modprobe sainsmart32fb
modprobe ads7846_test debug=1 cs=1 speed=2000000 model=7846 x_min=300 x_max=3800 y_min=700 y_max=3400 x_plate_ohms=60 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
modprobe sainsmart32fb rotate=1
modprobe ads7846_test debug=1 cs=1 speed=2000000 model=7846 swap_xy=1 x_min=300 x_max=3800 y_min=700 y_max=3400 x_plate_ohms=60 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 1
modprobe sainsmart32fb rotate=2
modprobe ads7846_test debug=1 cs=1 speed=2000000 model=7846 x_min=300 x_max=3800 y_min=700 y_max=3400 x_plate_ohms=60 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 0
modprobe sainsmart32fb rotate=3
modprobe ads7846_test debug=1 cs=1 speed=2000000 model=7846 swap_xy=1 x_min=300 x_max=3800 y_min=700 y_max=3400 x_plate_ohms=60 pressure_max=255 gpio_pendown=23 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
The LCD speed has to be lowered to 16MHz for the display to work together with the touch controller. The same as lallafa discovered.
modprobe ili9341fb
modprobe fbtft_device name=ili9341fb gpios=reset:25,led:18 rotate=0 speed=16000000
modprobe ads7846_test cs=1 speed=2000000 model=7846 pressure_max=255 x_min=250 x_max=3780 y_min=160 y_max=3930 x_plate_ohms=60 gpio_pendown=17 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
modprobe fbtft_device name=ili9341fb gpios=reset:25,led:18 rotate=1 speed=16000000
modprobe ads7846_test cs=1 speed=2000000 model=7846 swap_xy=1 pressure_max=255 x_min=250 x_max=3780 y_min=160 y_max=3930 x_plate_ohms=60 gpio_pendown=17 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
modprobe fbtft_device name=ili9341fb gpios=reset:25,led:18 rotate=2 speed=16000000
modprobe ads7846_test cs=1 speed=2000000 model=7846 pressure_max=255 x_min=250 x_max=3780 y_min=160 y_max=3930 x_plate_ohms=60 gpio_pendown=17 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 1
modprobe fbtft_device name=ili9341fb gpios=reset:25,led:18 rotate=3 speed=16000000
modprobe ads7846_test cs=1 speed=2000000 model=7846 swap_xy=1 pressure_max=255 x_min=250 x_max=3780 y_min=160 y_max=3930 x_plate_ohms=60 gpio_pendown=17 keep_vref_on=1
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 0
# Normal
modprobe fbtft_device name=hy28afb rotate=0
modprobe hy28afb
modprobe ads7846_device pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=60
modprobe ads7846
FRAMEBUFFER=/dev/fb1 startx
# Rotate Clock Wise
modprobe fbtft_device name=hy28afb rotate=1
modprobe hy28afb
modprobe ads7846_device pressure_max=255 y_min=190 swap_xy=1 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=60
modprobe ads7846
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
# Rotate Upside Down
modprobe fbtft_device name=hy28afb rotate=2
modprobe hy28afb
modprobe ads7846_device pressure_max=255 y_min=190 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=60
modprobe ads7846
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 1
# Rotate Counter Clock WIse
modprobe fbtft_device name=hy28afb rotate=3
modprobe hy28afb
modprobe ads7846_device pressure_max=255 y_min=190 swap_xy=1 y_max=3850 gpio_pendown=17 x_max=3850 x_min=230 x_plate_ohms=60
modprobe ads7846
FRAMEBUFFER=/dev/fb1 startx
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 1 0
To make the axis inversion permanent, add it to /etc/X11/xinit/xinitrc
#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# Touchpanel: Invert Y axis
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
# invoke global X session script
. /etc/X11/Xsession
Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. It was created by Russell King, of arm.linux.org.uk. Examples of implemented filters include jitter smoothing and the calibration transform.
Tslib is generally used on embedded devices to provide a common user space interface to touchscreen functionality. It is supported by Kdrive (aka TinyX) and OPIE as well as being used on a number of commercial Linux devices including the Nokia 770.
Tslib downloads and source code are now being hosted at github.
Testing on the Raspberri Py
sudo apt-get install libts-bin
# Moving/Drawing test
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event3 ts_test
# 5 crosshairs calibration
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event3 ts_calibrate
xres = 240, yres = 320
Took 38 samples...
Top left : X = 993 Y = 783
Took 29 samples...
Top right : X = 3135 Y = 799
Took 36 samples...
Bot right : X = 3135 Y = 3207
Took 46 samples...
Bot left : X = 1024 Y = 3231
Took 42 samples...
Center : X = 2091 Y = 2015
-15.777374 0.065827 -0.000425
-22.170654 0.000161 0.090601
Calibration constants: -1033986 4314 -27 -1452976 10 5937 65536
For some reason it didn't work when I exported the TSLIB_FBDEVICE and TSLIB_TSDEVICE env. variables.
This seem to be coupling between tslib and pygame. Not tested.
export SDL_MOUSEDRV=TSLIB
export SDL_MOUSEDEV=$TSLIB_TSDEVICE
Use both finger and stylus when calibrating.
Pressure
x_plate_ohms controls pressure.
Load driver with x_plate_ohms=400.
Tip: Hook up a LED to IRQ to see when the controller detects something.
Monitor pressure events
evtest /dev/input/eventX | egrep ABS_PRESSURE
If no event is detected, lower the value by half and reload the driver until a satisfying value is found.
x_min, x_max, y_min, y_max
Load driver with the x_plate_ohm value, and without x_ and y_ values.
Monitor positioning events
evtest /dev/input/eventX | grep ABS_X
evtest /dev/input/eventX | grep ABS_Y
Press a stylus at the outher edges of the display to record the min/max x and y value.
swap_xy
Swaps the X and Y axis. Used in landscape mode.
- http://www.freedesktop.org/wiki/Software/xinput_calibrator
- http://www.thefanclub.co.za/how-to/how-ubuntu-1204-touchscreen-calibration
- https://www.alwaysinnovating.com/wiki/index.php/Touchscreen_calibration
- http://git.openembedded.org/openembedded/plain/recipes/linux/linux-omap-2.6.29/omap3-touchbook/touchscreen-ads7846-rotation-support.patch
- http://git.openembedded.org/openembedded/plain/recipes/linux/linux-omap-pm-2.6.29/omap3-touchbook/touchscreen-ads7846-rotation-fixed.patch
The latest image contains a modified version of ads7846. This version registers it's own device and provides arguments for all config values.
To show arguments: modinfo -p ads7846_test
What I'm unsure about is should I use the inversion patching used by dronus and valdodov. Is there a way around patching it?
Info about inverting and swapping:
- xinput can do axis inversion, but it only affects X.
apt-get y install xinput
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' x y
- evdev is a Linux driver
-
evdev is an Xorg input driver for Linux's generic event devices
Evdev Axis Inversion - Input Coordinate Transformation
-
Touch screen relative coordinates
Shows by example how to do it
Programs relaing only on /dev/input/eventX can't benefit from xinput Axis Inversion. They must handle this themselves. PyGame is one of those I guess. This could be a case for axis inversion in the driver.
There is resisitence to having pathced versions of drivers. It's maintenance headache. Pushing them upstream is the solution, but not always easy.
Is tslib somethig to consider here?
Many displays with a touchpanel uses an ADS784x touch controller.
It has a Linux driver: drivers/input/touchscreen/ads7846.c
It's not enabled in the kernel config by default (make menuconfig):
Device Drivers ---> Input device support --->[*] Touchscreens ---> ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens
Patched versions:
- dronus has made a patched version which can invert the x/y-axis:
https://github.com/dronus/linux/commit/24666a13e8dfac1dfeaf55fa3c6e413b64af1a42 - valdodov has done something similar:
http://www.raspberrypi.org/phpBB3/viewtopic.php?p=309437#p309437
Application notes:
Max SPI speed is: 125000 * (8+16+2) Hz = 125000 * 26 Hz = 3250 kHz
On the Raspberry Pi, we have two close values on this list: 1.9 MHz and 3.9 MHz
Asking for 2 MHz will rount down to neares value which i 1.935 MHz
The value 125000 probably comes from Datasheet - ELECTRICAL CHARACTERISTICS:
|-----------------------------------------------------------| | | ADS7846E | | | PARAMETER | CONDITIONS | MIN | TYP | MAX | UNITS | |-----------------------------------------------------------| | Throughput Rate | | | | 125 | kHz | |-----------------------------------------------------------|
Excerpt from ads7846.c
/* this driver doesn't aim at the peak continuous sample rate */
#define SAMPLE_BITS (8 /*cmd*/ + 16 /*sample*/ + 2 /* before, after */)
static int __devinit ads7846_probe(struct spi_device *spi)
/* don't exceed max specified sample rate */
if (spi->max_speed_hz > (125000 * SAMPLE_BITS)) {
dev_dbg(&spi->dev, "f(sample) %d KHz?\n",
(spi->max_speed_hz/SAMPLE_BITS)/1000);
return -EINVAL;
}
This an excerpt of linux/spi/ads7846.h
/* Touchscreen characteristics vary between boards and models. The
* platform_data for the device's "struct device" holds this information.
*
* It's OK if the min/max values are zero.
*/
struct ads7846_platform_data {
u16 model; /* 7843, 7845, 7846, 7873. */
u16 vref_delay_usecs; /* 0 for external vref; etc */
u16 vref_mv; /* external vref value, milliVolts
* ads7846: if 0, use internal vref */
bool keep_vref_on; /* set to keep vref on for differential
* measurements as well */
bool swap_xy; /* swap x and y axes */
/* Settling time of the analog signals; a function of Vcc and the
* capacitance on the X/Y drivers. If set to non-zero, two samples
* are taken with settle_delay us apart, and the second one is used.
* ~150 uSec with 0.01uF caps.
*/
u16 settle_delay_usecs;
/* If set to non-zero, after samples are taken this delay is applied
* and penirq is rechecked, to help avoid false events. This value
* is affected by the material used to build the touch layer.
*/
u16 penirq_recheck_delay_usecs;
u16 x_plate_ohms;
u16 y_plate_ohms;
u16 x_min, x_max;
u16 y_min, y_max;
u16 pressure_min, pressure_max;
u16 debounce_max; /* max number of additional readings
* per sample */
u16 debounce_tol; /* tolerance used for filtering */
u16 debounce_rep; /* additional consecutive good readings
* required after the first two */
int gpio_pendown; /* the GPIO used to decide the pendown
* state if get_pendown_state == NULL
*/
int (*get_pendown_state)(void);
int (*filter_init) (const struct ads7846_platform_data *pdata,
void **filter_data);
int (*filter) (void *filter_data, int data_idx, int *val);
void (*filter_cleanup)(void *filter_data);
void (*wait_for_sync)(void);
bool wakeup;
unsigned long irq_flags;
};
- model - 7843, 7845, 7846, 7873 (default: 7846)
-
vref_delay_usecs - 0 for external vref; etc
micro seconds to delay between SPI transfers (spi_transfer.delay_usecs) -
vref_mv - external vref value, milliVolts ads7846: if 0, use internal vref
used for hwmon sensor code -
keep_vref_on - set to keep vref on for differential measurements as well
used in ads7846_setup_spi_msg(). READ_X(vref) ==ADS_START | ADS_A2A1A0_d_ x | ADS_12_BIT | ADS_DFR | ADS_PD10_ADC_ON | (vref ? ADS_PD10_REF_ON : 0)
#define ADS_PD10_REF_ON (2 << 0) /* vREF on + penirq */
- swap_xy - swap x and y axes
-
settle_delay_usecs - Settling time of the analog signals; a function of Vcc and the capacitance on the X/Y drivers.
If set to non-zero, two samples are taken with settle_delay us apart, and the second one is used. ~150 uSec with 0.01uF caps.
micro seconds to delay between SPI transfers (spi_transfer.delay_usecs) -
penirq_recheck_delay_usecs - If set to non-zero, after samples are taken this delay is applied and penirq is rechecked,
to help avoid false events. This value is affected by the material used to build the touch layer.
used in ads7846_report_stateudelay(ts->penirq_recheck_delay_usecs);
-
x_plate_ohms - Used to calculate pressure in
ads7846_report_state()
(default: 400) - y_plate_ohms - Not used by driver
- x_min - Minimum value for x-axis (default: 0)
-
x_max - Maximum value for x-axis (default: MAX_12BIT == 0x0FFF == 4095)
input_set_abs_params(input_dev, ABS_X, pdata->x_min ? : 0, pdata->x_max ? : MAX_12BIT, 0, 0);
frominclude/uapi/linux/input.h
: Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in units per millimeter (units/mm) - y_min - Minimum value for y-axis (default: 0)
-
y_max - Maximum value for y-axis (default: MAX_12BIT == 0x0FFF == 4095)
input_set_abs_params(input_dev, ABS_Y, pdata->y_min ? : 0, pdata->y_max ? : MAX_12BIT, 0, 0);
-
pressure_min, pressure_max - (pressure_max default: ~0 == 0xFFFF)
input_set_abs_params(input_dev, ABS_PRESSURE, pdata->pressure_min, pdata->pressure_max, 0, 0);
-
debounce_max - max number of additional readings per sample (0,1,2)
if filter is not defined and debounce_max is non-zero, filter will beads7846_debounce_filter()
-
debounce_tol - tolerance used for filtering
used in ads7846_debounce_filter -
debounce_rep - additional consecutive good readings required after the first two
used in ads7846_debounce_filter - gpio_pendown - the GPIO used to decide the pendown state if get_pendown_state == NULL
- irq_flags - (default: IRQF_TRIGGER_FALLING)