elantech.txt 22 KB

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