^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) .. _touch:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) Touch Devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) Touch devices are accessed through character device special files named
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) ``/dev/v4l-touch0`` to ``/dev/v4l-touch255`` with major number 81 and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) dynamically allocated minor numbers 0 to 255.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) Overview
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) Sensors may be Optical, or Projected Capacitive touch (PCT).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Processing is required to analyse the raw data and produce input events. In
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) some systems, this may be performed on the ASIC and the raw data is purely a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) side-channel for diagnostics or tuning. In other systems, the ASIC is a simple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) analogue front end device which delivers touch data at high rate, and any touch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) processing must be done on the host.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) For capacitive touch sensing, the touchscreen is composed of an array of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) horizontal and vertical conductors (alternatively called rows/columns, X/Y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) lines, or tx/rx). Mutual Capacitance measured is at the nodes where the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) conductors cross. Alternatively, Self Capacitance measures the signal from each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) column and row independently.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) A touch input may be determined by comparing the raw capacitance measurement to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) a no-touch reference (or "baseline") measurement:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Delta = Raw - Reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) The reference measurement takes account of variations in the capacitance across
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) the touch sensor matrix, for example manufacturing irregularities,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) environmental or edge effects.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) Querying Capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) =====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Devices supporting the touch interface set the ``V4L2_CAP_VIDEO_CAPTURE`` flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) and the ``V4L2_CAP_TOUCH`` flag in the ``capabilities`` field of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) :c:type:`v4l2_capability` returned by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) :ref:`VIDIOC_QUERYCAP` ioctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) At least one of the read/write or streaming I/O methods must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) The formats supported by touch devices are documented in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) :ref:`Touch Formats <tch-formats>`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) Data Format Negotiation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) A touch device may support any I/O method.