elantech.rst 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. Elantech Touchpad Driver
  2. ========================
  3. Copyright (C) 2007-2008 Arjan Opmeer <arjan@opmeer.net>
  4. Extra information for hardware version 1 found and
  5. provided by Steve Havelka
  6. Version 2 (EeePC) hardware support based on patches
  7. received from Woody at Xandros and forwarded to me
  8. by user StewieGriffin at the eeeuser.com forum
  9. .. Contents
  10. 1. Introduction
  11. 2. Extra knobs
  12. 3. Differentiating hardware versions
  13. 4. Hardware version 1
  14. 4.1 Registers
  15. 4.2 Native relative mode 4 byte packet format
  16. 4.3 Native absolute mode 4 byte packet format
  17. 5. Hardware version 2
  18. 5.1 Registers
  19. 5.2 Native absolute mode 6 byte packet format
  20. 5.2.1 Parity checking and packet re-synchronization
  21. 5.2.2 One/Three finger touch
  22. 5.2.3 Two finger touch
  23. 6. Hardware version 3
  24. 6.1 Registers
  25. 6.2 Native absolute mode 6 byte packet format
  26. 6.2.1 One/Three finger touch
  27. 6.2.2 Two finger touch
  28. 7. Hardware version 4
  29. 7.1 Registers
  30. 7.2 Native absolute mode 6 byte packet format
  31. 7.2.1 Status packet
  32. 7.2.2 Head packet
  33. 7.2.3 Motion packet
  34. 8. Trackpoint (for Hardware version 3 and 4)
  35. 8.1 Registers
  36. 8.2 Native relative mode 6 byte packet format
  37. 8.2.1 Status Packet
  38. Introduction
  39. ~~~~~~~~~~~~
  40. Currently the Linux Elantech touchpad driver is aware of four different
  41. hardware versions unimaginatively called version 1,version 2, version 3
  42. and version 4. Version 1 is found in "older" laptops and uses 4 bytes per
  43. packet. Version 2 seems to be introduced with the EeePC and uses 6 bytes
  44. per packet, and provides additional features such as position of two fingers,
  45. and width of the touch. Hardware version 3 uses 6 bytes per packet (and
  46. for 2 fingers the concatenation of two 6 bytes packets) and allows tracking
  47. of up to 3 fingers. Hardware version 4 uses 6 bytes per packet, and can
  48. combine a status packet with multiple head or motion packets. Hardware version
  49. 4 allows tracking up to 5 fingers.
  50. Some Hardware version 3 and version 4 also have a trackpoint which uses a
  51. separate packet format. It is also 6 bytes per packet.
  52. The driver tries to support both hardware versions and should be compatible
  53. with the Xorg Synaptics touchpad driver and its graphical configuration
  54. utilities.
  55. Note that a mouse button is also associated with either the touchpad or the
  56. trackpoint when a trackpoint is available. Disabling the Touchpad in xorg
  57. (TouchPadOff=0) will also disable the buttons associated with the touchpad.
  58. Additionally the operation of the touchpad can be altered by adjusting the
  59. contents of some of its internal registers. These registers are represented
  60. by the driver as sysfs entries under /sys/bus/serio/drivers/psmouse/serio?
  61. that can be read from and written to.
  62. Currently only the registers for hardware version 1 are somewhat understood.
  63. Hardware version 2 seems to use some of the same registers but it is not
  64. known whether the bits in the registers represent the same thing or might
  65. have changed their meaning.
  66. On top of that, some register settings have effect only when the touchpad is
  67. in relative mode and not in absolute mode. As the Linux Elantech touchpad
  68. driver always puts the hardware into absolute mode not all information
  69. mentioned below can be used immediately. But because there is no freely
  70. available Elantech documentation the information is provided here anyway for
  71. completeness sake.
  72. Extra knobs
  73. ~~~~~~~~~~~
  74. Currently the Linux Elantech touchpad driver provides three extra knobs under
  75. /sys/bus/serio/drivers/psmouse/serio? for the user.
  76. * debug
  77. Turn different levels of debugging ON or OFF.
  78. By echoing "0" to this file all debugging will be turned OFF.
  79. Currently a value of "1" will turn on some basic debugging and a value of
  80. "2" will turn on packet debugging. For hardware version 1 the default is
  81. OFF. For version 2 the default is "1".
  82. Turning packet debugging on will make the driver dump every packet
  83. received to the syslog before processing it. Be warned that this can
  84. generate quite a lot of data!
  85. * paritycheck
  86. Turns parity checking ON or OFF.
  87. By echoing "0" to this file parity checking will be turned OFF. Any
  88. non-zero value will turn it ON. For hardware version 1 the default is ON.
  89. For version 2 the default it is OFF.
  90. Hardware version 1 provides basic data integrity verification by
  91. calculating a parity bit for the last 3 bytes of each packet. The driver
  92. can check these bits and reject any packet that appears corrupted. Using
  93. this knob you can bypass that check.
  94. Hardware version 2 does not provide the same parity bits. Only some basic
  95. data consistency checking can be done. For now checking is disabled by
  96. default. Currently even turning it on will do nothing.
  97. * crc_enabled
  98. Sets crc_enabled to 0/1. The name "crc_enabled" is the official name of
  99. this integrity check, even though it is not an actual cyclic redundancy
  100. check.
  101. Depending on the state of crc_enabled, certain basic data integrity
  102. verification is done by the driver on hardware version 3 and 4. The
  103. driver will reject any packet that appears corrupted. Using this knob,
  104. The state of crc_enabled can be altered with this knob.
  105. Reading the crc_enabled value will show the active value. Echoing
  106. "0" or "1" to this file will set the state to "0" or "1".
  107. Differentiating hardware versions
  108. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. To detect the hardware version, read the version number as param[0].param[1].param[2]::
  110. 4 bytes version: (after the arrow is the name given in the Dell-provided driver)
  111. 02.00.22 => EF013
  112. 02.06.00 => EF019
  113. In the wild, there appear to be more versions, such as 00.01.64, 01.00.21,
  114. 02.00.00, 02.00.04, 02.00.06::
  115. 6 bytes:
  116. 02.00.30 => EF113
  117. 02.08.00 => EF023
  118. 02.08.XX => EF123
  119. 02.0B.00 => EF215
  120. 04.01.XX => Scroll_EF051
  121. 04.02.XX => EF051
  122. In the wild, there appear to be more versions, such as 04.03.01, 04.04.11. There
  123. appears to be almost no difference, except for EF113, which does not report
  124. pressure/width and has different data consistency checks.
  125. Probably all the versions with param[0] <= 01 can be considered as
  126. 4 bytes/firmware 1. The versions < 02.08.00, with the exception of 02.00.30, as
  127. 4 bytes/firmware 2. Everything >= 02.08.00 can be considered as 6 bytes.
  128. Hardware version 1
  129. ~~~~~~~~~~~~~~~~~~
  130. Registers
  131. ---------
  132. By echoing a hexadecimal value to a register it contents can be altered.
  133. For example::
  134. echo -n 0x16 > reg_10
  135. * reg_10::
  136. bit 7 6 5 4 3 2 1 0
  137. B C T D L A S E
  138. E: 1 = enable smart edges unconditionally
  139. S: 1 = enable smart edges only when dragging
  140. A: 1 = absolute mode (needs 4 byte packets, see reg_11)
  141. L: 1 = enable drag lock (see reg_22)
  142. D: 1 = disable dynamic resolution
  143. T: 1 = disable tapping
  144. C: 1 = enable corner tap
  145. B: 1 = swap left and right button
  146. * reg_11::
  147. bit 7 6 5 4 3 2 1 0
  148. 1 0 0 H V 1 F P
  149. P: 1 = enable parity checking for relative mode
  150. F: 1 = enable native 4 byte packet mode
  151. V: 1 = enable vertical scroll area
  152. H: 1 = enable horizontal scroll area
  153. * reg_20::
  154. single finger width?
  155. * reg_21::
  156. scroll area width (small: 0x40 ... wide: 0xff)
  157. * reg_22::
  158. drag lock time out (short: 0x14 ... long: 0xfe;
  159. 0xff = tap again to release)
  160. * reg_23::
  161. tap make timeout?
  162. * reg_24::
  163. tap release timeout?
  164. * reg_25::
  165. smart edge cursor speed (0x02 = slow, 0x03 = medium, 0x04 = fast)
  166. * reg_26::
  167. smart edge activation area width?
  168. Native relative mode 4 byte packet format
  169. -----------------------------------------
  170. byte 0::
  171. bit 7 6 5 4 3 2 1 0
  172. c c p2 p1 1 M R L
  173. L, R, M = 1 when Left, Right, Middle mouse button pressed
  174. some models have M as byte 3 odd parity bit
  175. when parity checking is enabled (reg_11, P = 1):
  176. p1..p2 = byte 1 and 2 odd parity bit
  177. c = 1 when corner tap detected
  178. byte 1::
  179. bit 7 6 5 4 3 2 1 0
  180. dx7 dx6 dx5 dx4 dx3 dx2 dx1 dx0
  181. dx7..dx0 = x movement; positive = right, negative = left
  182. byte 1 = 0xf0 when corner tap detected
  183. byte 2::
  184. bit 7 6 5 4 3 2 1 0
  185. dy7 dy6 dy5 dy4 dy3 dy2 dy1 dy0
  186. dy7..dy0 = y movement; positive = up, negative = down
  187. byte 3::
  188. parity checking enabled (reg_11, P = 1):
  189. bit 7 6 5 4 3 2 1 0
  190. w h n1 n0 ds3 ds2 ds1 ds0
  191. normally:
  192. ds3..ds0 = scroll wheel amount and direction
  193. positive = down or left
  194. negative = up or right
  195. when corner tap detected:
  196. ds0 = 1 when top right corner tapped
  197. ds1 = 1 when bottom right corner tapped
  198. ds2 = 1 when bottom left corner tapped
  199. ds3 = 1 when top left corner tapped
  200. n1..n0 = number of fingers on touchpad
  201. only models with firmware 2.x report this, models with
  202. firmware 1.x seem to map one, two and three finger taps
  203. directly to L, M and R mouse buttons
  204. h = 1 when horizontal scroll action
  205. w = 1 when wide finger touch?
  206. otherwise (reg_11, P = 0):
  207. bit 7 6 5 4 3 2 1 0
  208. ds7 ds6 ds5 ds4 ds3 ds2 ds1 ds0
  209. ds7..ds0 = vertical scroll amount and direction
  210. negative = up
  211. positive = down
  212. Native absolute mode 4 byte packet format
  213. -----------------------------------------
  214. EF013 and EF019 have a special behaviour (due to a bug in the firmware?), and
  215. when 1 finger is touching, the first 2 position reports must be discarded.
  216. This counting is reset whenever a different number of fingers is reported.
  217. byte 0::
  218. firmware version 1.x:
  219. bit 7 6 5 4 3 2 1 0
  220. D U p1 p2 1 p3 R L
  221. L, R = 1 when Left, Right mouse button pressed
  222. p1..p3 = byte 1..3 odd parity bit
  223. D, U = 1 when rocker switch pressed Up, Down
  224. firmware version 2.x:
  225. bit 7 6 5 4 3 2 1 0
  226. n1 n0 p2 p1 1 p3 R L
  227. L, R = 1 when Left, Right mouse button pressed
  228. p1..p3 = byte 1..3 odd parity bit
  229. n1..n0 = number of fingers on touchpad
  230. byte 1::
  231. firmware version 1.x:
  232. bit 7 6 5 4 3 2 1 0
  233. f 0 th tw x9 x8 y9 y8
  234. tw = 1 when two finger touch
  235. th = 1 when three finger touch
  236. f = 1 when finger touch
  237. firmware version 2.x:
  238. bit 7 6 5 4 3 2 1 0
  239. . . . . x9 x8 y9 y8
  240. byte 2::
  241. bit 7 6 5 4 3 2 1 0
  242. x7 x6 x5 x4 x3 x2 x1 x0
  243. x9..x0 = absolute x value (horizontal)
  244. byte 3::
  245. bit 7 6 5 4 3 2 1 0
  246. y7 y6 y5 y4 y3 y2 y1 y0
  247. y9..y0 = absolute y value (vertical)
  248. Hardware version 2
  249. ~~~~~~~~~~~~~~~~~~
  250. Registers
  251. ---------
  252. By echoing a hexadecimal value to a register it contents can be altered.
  253. For example::
  254. echo -n 0x56 > reg_10
  255. * reg_10::
  256. bit 7 6 5 4 3 2 1 0
  257. 0 1 0 1 0 1 D 0
  258. D: 1 = enable drag and drop
  259. * reg_11::
  260. bit 7 6 5 4 3 2 1 0
  261. 1 0 0 0 S 0 1 0
  262. S: 1 = enable vertical scroll
  263. * reg_21::
  264. unknown (0x00)
  265. * reg_22::
  266. drag and drop release time out (short: 0x70 ... long 0x7e;
  267. 0x7f = never i.e. tap again to release)
  268. Native absolute mode 6 byte packet format
  269. -----------------------------------------
  270. Parity checking and packet re-synchronization
  271. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  272. There is no parity checking, however some consistency checks can be performed.
  273. For instance for EF113::
  274. SA1= packet[0];
  275. A1 = packet[1];
  276. B1 = packet[2];
  277. SB1= packet[3];
  278. C1 = packet[4];
  279. D1 = packet[5];
  280. if( (((SA1 & 0x3C) != 0x3C) && ((SA1 & 0xC0) != 0x80)) || // check Byte 1
  281. (((SA1 & 0x0C) != 0x0C) && ((SA1 & 0xC0) == 0x80)) || // check Byte 1 (one finger pressed)
  282. (((SA1 & 0xC0) != 0x80) && (( A1 & 0xF0) != 0x00)) || // check Byte 2
  283. (((SB1 & 0x3E) != 0x38) && ((SA1 & 0xC0) != 0x80)) || // check Byte 4
  284. (((SB1 & 0x0E) != 0x08) && ((SA1 & 0xC0) == 0x80)) || // check Byte 4 (one finger pressed)
  285. (((SA1 & 0xC0) != 0x80) && (( C1 & 0xF0) != 0x00)) ) // check Byte 5
  286. // error detected
  287. For all the other ones, there are just a few constant bits::
  288. if( ((packet[0] & 0x0C) != 0x04) ||
  289. ((packet[3] & 0x0f) != 0x02) )
  290. // error detected
  291. In case an error is detected, all the packets are shifted by one (and packet[0] is discarded).
  292. One/Three finger touch
  293. ^^^^^^^^^^^^^^^^^^^^^^
  294. byte 0::
  295. bit 7 6 5 4 3 2 1 0
  296. n1 n0 w3 w2 . . R L
  297. L, R = 1 when Left, Right mouse button pressed
  298. n1..n0 = number of fingers on touchpad
  299. byte 1::
  300. bit 7 6 5 4 3 2 1 0
  301. p7 p6 p5 p4 x11 x10 x9 x8
  302. byte 2::
  303. bit 7 6 5 4 3 2 1 0
  304. x7 x6 x5 x4 x3 x2 x1 x0
  305. x11..x0 = absolute x value (horizontal)
  306. byte 3::
  307. bit 7 6 5 4 3 2 1 0
  308. n4 vf w1 w0 . . . b2
  309. n4 = set if more than 3 fingers (only in 3 fingers mode)
  310. vf = a kind of flag ? (only on EF123, 0 when finger is over one
  311. of the buttons, 1 otherwise)
  312. w3..w0 = width of the finger touch (not EF113)
  313. b2 (on EF113 only, 0 otherwise), b2.R.L indicates one button pressed:
  314. 0 = none
  315. 1 = Left
  316. 2 = Right
  317. 3 = Middle (Left and Right)
  318. 4 = Forward
  319. 5 = Back
  320. 6 = Another one
  321. 7 = Another one
  322. byte 4::
  323. bit 7 6 5 4 3 2 1 0
  324. p3 p1 p2 p0 y11 y10 y9 y8
  325. p7..p0 = pressure (not EF113)
  326. byte 5::
  327. bit 7 6 5 4 3 2 1 0
  328. y7 y6 y5 y4 y3 y2 y1 y0
  329. y11..y0 = absolute y value (vertical)
  330. Two finger touch
  331. ^^^^^^^^^^^^^^^^
  332. Note that the two pairs of coordinates are not exactly the coordinates of the
  333. two fingers, but only the pair of the lower-left and upper-right coordinates.
  334. So the actual fingers might be situated on the other diagonal of the square
  335. defined by these two points.
  336. byte 0::
  337. bit 7 6 5 4 3 2 1 0
  338. n1 n0 ay8 ax8 . . R L
  339. L, R = 1 when Left, Right mouse button pressed
  340. n1..n0 = number of fingers on touchpad
  341. byte 1::
  342. bit 7 6 5 4 3 2 1 0
  343. ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0
  344. ax8..ax0 = lower-left finger absolute x value
  345. byte 2::
  346. bit 7 6 5 4 3 2 1 0
  347. ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0
  348. ay8..ay0 = lower-left finger absolute y value
  349. byte 3::
  350. bit 7 6 5 4 3 2 1 0
  351. . . by8 bx8 . . . .
  352. byte 4::
  353. bit 7 6 5 4 3 2 1 0
  354. bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0
  355. bx8..bx0 = upper-right finger absolute x value
  356. byte 5::
  357. bit 7 6 5 4 3 2 1 0
  358. by7 by8 by5 by4 by3 by2 by1 by0
  359. by8..by0 = upper-right finger absolute y value
  360. Hardware version 3
  361. ~~~~~~~~~~~~~~~~~~
  362. Registers
  363. ---------
  364. * reg_10::
  365. bit 7 6 5 4 3 2 1 0
  366. 0 0 0 0 R F T A
  367. A: 1 = enable absolute tracking
  368. T: 1 = enable two finger mode auto correct
  369. F: 1 = disable ABS Position Filter
  370. R: 1 = enable real hardware resolution
  371. Native absolute mode 6 byte packet format
  372. -----------------------------------------
  373. 1 and 3 finger touch shares the same 6-byte packet format, except that
  374. 3 finger touch only reports the position of the center of all three fingers.
  375. Firmware would send 12 bytes of data for 2 finger touch.
  376. Note on debounce:
  377. In case the box has unstable power supply or other electricity issues, or
  378. when number of finger changes, F/W would send "debounce packet" to inform
  379. driver that the hardware is in debounce status.
  380. The debouce packet has the following signature::
  381. byte 0: 0xc4
  382. byte 1: 0xff
  383. byte 2: 0xff
  384. byte 3: 0x02
  385. byte 4: 0xff
  386. byte 5: 0xff
  387. When we encounter this kind of packet, we just ignore it.
  388. One/Three finger touch
  389. ^^^^^^^^^^^^^^^^^^^^^^
  390. byte 0::
  391. bit 7 6 5 4 3 2 1 0
  392. n1 n0 w3 w2 0 1 R L
  393. L, R = 1 when Left, Right mouse button pressed
  394. n1..n0 = number of fingers on touchpad
  395. byte 1::
  396. bit 7 6 5 4 3 2 1 0
  397. p7 p6 p5 p4 x11 x10 x9 x8
  398. byte 2::
  399. bit 7 6 5 4 3 2 1 0
  400. x7 x6 x5 x4 x3 x2 x1 x0
  401. x11..x0 = absolute x value (horizontal)
  402. byte 3::
  403. bit 7 6 5 4 3 2 1 0
  404. 0 0 w1 w0 0 0 1 0
  405. w3..w0 = width of the finger touch
  406. byte 4::
  407. bit 7 6 5 4 3 2 1 0
  408. p3 p1 p2 p0 y11 y10 y9 y8
  409. p7..p0 = pressure
  410. byte 5::
  411. bit 7 6 5 4 3 2 1 0
  412. y7 y6 y5 y4 y3 y2 y1 y0
  413. y11..y0 = absolute y value (vertical)
  414. Two finger touch
  415. ^^^^^^^^^^^^^^^^
  416. The packet format is exactly the same for two finger touch, except the hardware
  417. sends two 6 byte packets. The first packet contains data for the first finger,
  418. the second packet has data for the second finger. So for two finger touch a
  419. total of 12 bytes are sent.
  420. Hardware version 4
  421. ~~~~~~~~~~~~~~~~~~
  422. Registers
  423. ---------
  424. * reg_07::
  425. bit 7 6 5 4 3 2 1 0
  426. 0 0 0 0 0 0 0 A
  427. A: 1 = enable absolute tracking
  428. Native absolute mode 6 byte packet format
  429. -----------------------------------------
  430. v4 hardware is a true multitouch touchpad, capable of tracking up to 5 fingers.
  431. Unfortunately, due to PS/2's limited bandwidth, its packet format is rather
  432. complex.
  433. Whenever the numbers or identities of the fingers changes, the hardware sends a
  434. status packet to indicate how many and which fingers is on touchpad, followed by
  435. head packets or motion packets. A head packet contains data of finger id, finger
  436. position (absolute x, y values), width, and pressure. A motion packet contains
  437. two fingers' position delta.
  438. For example, when status packet tells there are 2 fingers on touchpad, then we
  439. can expect two following head packets. If the finger status doesn't change,
  440. the following packets would be motion packets, only sending delta of finger
  441. position, until we receive a status packet.
  442. One exception is one finger touch. when a status packet tells us there is only
  443. one finger, the hardware would just send head packets afterwards.
  444. Status packet
  445. ^^^^^^^^^^^^^
  446. byte 0::
  447. bit 7 6 5 4 3 2 1 0
  448. . . . . 0 1 R L
  449. L, R = 1 when Left, Right mouse button pressed
  450. byte 1::
  451. bit 7 6 5 4 3 2 1 0
  452. . . . ft4 ft3 ft2 ft1 ft0
  453. ft4 ft3 ft2 ft1 ft0 ftn = 1 when finger n is on touchpad
  454. byte 2::
  455. not used
  456. byte 3::
  457. bit 7 6 5 4 3 2 1 0
  458. . . . 1 0 0 0 0
  459. constant bits
  460. byte 4::
  461. bit 7 6 5 4 3 2 1 0
  462. p . . . . . . .
  463. p = 1 for palm
  464. byte 5::
  465. not used
  466. Head packet
  467. ^^^^^^^^^^^
  468. byte 0::
  469. bit 7 6 5 4 3 2 1 0
  470. w3 w2 w1 w0 0 1 R L
  471. L, R = 1 when Left, Right mouse button pressed
  472. w3..w0 = finger width (spans how many trace lines)
  473. byte 1::
  474. bit 7 6 5 4 3 2 1 0
  475. p7 p6 p5 p4 x11 x10 x9 x8
  476. byte 2::
  477. bit 7 6 5 4 3 2 1 0
  478. x7 x6 x5 x4 x3 x2 x1 x0
  479. x11..x0 = absolute x value (horizontal)
  480. byte 3::
  481. bit 7 6 5 4 3 2 1 0
  482. id2 id1 id0 1 0 0 0 1
  483. id2..id0 = finger id
  484. byte 4::
  485. bit 7 6 5 4 3 2 1 0
  486. p3 p1 p2 p0 y11 y10 y9 y8
  487. p7..p0 = pressure
  488. byte 5::
  489. bit 7 6 5 4 3 2 1 0
  490. y7 y6 y5 y4 y3 y2 y1 y0
  491. y11..y0 = absolute y value (vertical)
  492. Motion packet
  493. ^^^^^^^^^^^^^
  494. byte 0::
  495. bit 7 6 5 4 3 2 1 0
  496. id2 id1 id0 w 0 1 R L
  497. L, R = 1 when Left, Right mouse button pressed
  498. id2..id0 = finger id
  499. w = 1 when delta overflows (> 127 or < -128), in this case
  500. firmware sends us (delta x / 5) and (delta y / 5)
  501. byte 1::
  502. bit 7 6 5 4 3 2 1 0
  503. x7 x6 x5 x4 x3 x2 x1 x0
  504. x7..x0 = delta x (two's complement)
  505. byte 2::
  506. bit 7 6 5 4 3 2 1 0
  507. y7 y6 y5 y4 y3 y2 y1 y0
  508. y7..y0 = delta y (two's complement)
  509. byte 3::
  510. bit 7 6 5 4 3 2 1 0
  511. id2 id1 id0 1 0 0 1 0
  512. id2..id0 = finger id
  513. byte 4::
  514. bit 7 6 5 4 3 2 1 0
  515. x7 x6 x5 x4 x3 x2 x1 x0
  516. x7..x0 = delta x (two's complement)
  517. byte 5::
  518. bit 7 6 5 4 3 2 1 0
  519. y7 y6 y5 y4 y3 y2 y1 y0
  520. y7..y0 = delta y (two's complement)
  521. byte 0 ~ 2 for one finger
  522. byte 3 ~ 5 for another
  523. Trackpoint (for Hardware version 3 and 4)
  524. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  525. Registers
  526. ---------
  527. No special registers have been identified.
  528. Native relative mode 6 byte packet format
  529. -----------------------------------------
  530. Status Packet
  531. ^^^^^^^^^^^^^
  532. byte 0::
  533. bit 7 6 5 4 3 2 1 0
  534. 0 0 sx sy 0 M R L
  535. byte 1::
  536. bit 7 6 5 4 3 2 1 0
  537. ~sx 0 0 0 0 0 0 0
  538. byte 2::
  539. bit 7 6 5 4 3 2 1 0
  540. ~sy 0 0 0 0 0 0 0
  541. byte 3::
  542. bit 7 6 5 4 3 2 1 0
  543. 0 0 ~sy ~sx 0 1 1 0
  544. byte 4::
  545. bit 7 6 5 4 3 2 1 0
  546. x7 x6 x5 x4 x3 x2 x1 x0
  547. byte 5::
  548. bit 7 6 5 4 3 2 1 0
  549. y7 y6 y5 y4 y3 y2 y1 y0
  550. x and y are written in two's complement spread
  551. over 9 bits with sx/sy the relative top bit and
  552. x7..x0 and y7..y0 the lower bits.
  553. ~sx is the inverse of sx, ~sy is the inverse of sy.
  554. The sign of y is opposite to what the input driver
  555. expects for a relative movement