ADC-LH7-Touchscreen 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. README on the ADC/Touchscreen Controller
  2. ========================================
  3. The LH79524 and LH7A404 include a built-in Analog to Digital
  4. controller (ADC) that is used to process input from a touchscreen.
  5. The driver only implements a four-wire touch panel protocol.
  6. The touchscreen driver is maintenance free except for the pen-down or
  7. touch threshold. Some resistive displays and board combinations may
  8. require tuning of this threshold. The driver exposes some of it's
  9. internal state in the sys filesystem. If the kernel is configured
  10. with it, CONFIG_SYSFS, and sysfs is mounted at /sys, there will be a
  11. directory
  12. /sys/devices/platform/adc-lh7.0
  13. containing these files.
  14. -r--r--r-- 1 root root 4096 Jan 1 00:00 samples
  15. -rw-r--r-- 1 root root 4096 Jan 1 00:00 threshold
  16. -r--r--r-- 1 root root 4096 Jan 1 00:00 threshold_range
  17. The threshold is the current touch threshold. It defaults to 750 on
  18. most targets.
  19. # cat threshold
  20. 750
  21. The threshold_range contains the range of valid values for the
  22. threshold. Values outside of this range will be silently ignored.
  23. # cat threshold_range
  24. 0 1023
  25. To change the threshold, write a value to the threshold file.
  26. # echo 500 > threshold
  27. # cat threshold
  28. 500
  29. The samples file contains the most recently sampled values from the
  30. ADC. There are 12. Below are typical of the last sampled values when
  31. the pen has been released. The first two and last two samples are for
  32. detecting whether or not the pen is down. The third through sixth are
  33. X coordinate samples. The seventh through tenth are Y coordinate
  34. samples.
  35. # cat samples
  36. 1023 1023 0 0 0 0 530 529 530 529 1023 1023
  37. To determine a reasonable threshold, press on the touch panel with an
  38. appropriate stylus and read the values from samples.
  39. # cat samples
  40. 1023 676 92 103 101 102 855 919 922 922 1023 679
  41. The first and eleventh samples are discarded. Thus, the important
  42. values are the second and twelfth which are used to determine if the
  43. pen is down. When both are below the threshold, the driver registers
  44. that the pen is down. When either is above the threshold, it
  45. registers then pen is up.