sentelic.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. .. include:: <isonum.txt>
  2. =================
  3. Sentelic Touchpad
  4. =================
  5. :Copyright: |copy| 2002-2011 Sentelic Corporation.
  6. :Last update: Dec-07-2011
  7. Finger Sensing Pad Intellimouse Mode (scrolling wheel, 4th and 5th buttons)
  8. ============================================================================
  9. A) MSID 4: Scrolling wheel mode plus Forward page(4th button) and Backward
  10. page (5th button)
  11. 1. Set sample rate to 200;
  12. 2. Set sample rate to 200;
  13. 3. Set sample rate to 80;
  14. 4. Issuing the "Get device ID" command (0xF2) and waits for the response;
  15. 5. FSP will respond 0x04.
  16. ::
  17. Packet 1
  18. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  19. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  20. 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|W|W|W|W|
  21. |---------------| |---------------| |---------------| |---------------|
  22. Byte 1: Bit7 => Y overflow
  23. Bit6 => X overflow
  24. Bit5 => Y sign bit
  25. Bit4 => X sign bit
  26. Bit3 => 1
  27. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  28. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  29. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  30. Byte 2: X Movement(9-bit 2's complement integers)
  31. Byte 3: Y Movement(9-bit 2's complement integers)
  32. Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report.
  33. valid values, -8 ~ +7
  34. Bit4 => 1 = 4th mouse button is pressed, Forward one page.
  35. 0 = 4th mouse button is not pressed.
  36. Bit5 => 1 = 5th mouse button is pressed, Backward one page.
  37. 0 = 5th mouse button is not pressed.
  38. B) MSID 6: Horizontal and Vertical scrolling
  39. - Set bit 1 in register 0x40 to 1
  40. FSP replaces scrolling wheel's movement as 4 bits to show horizontal and
  41. vertical scrolling.
  42. ::
  43. Packet 1
  44. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  45. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  46. 1 |Y|X|y|x|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 | | |B|F|r|l|u|d|
  47. |---------------| |---------------| |---------------| |---------------|
  48. Byte 1: Bit7 => Y overflow
  49. Bit6 => X overflow
  50. Bit5 => Y sign bit
  51. Bit4 => X sign bit
  52. Bit3 => 1
  53. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  54. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  55. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  56. Byte 2: X Movement(9-bit 2's complement integers)
  57. Byte 3: Y Movement(9-bit 2's complement integers)
  58. Byte 4: Bit0 => the Vertical scrolling movement downward.
  59. Bit1 => the Vertical scrolling movement upward.
  60. Bit2 => the Horizontal scrolling movement leftward.
  61. Bit3 => the Horizontal scrolling movement rightward.
  62. Bit4 => 1 = 4th mouse button is pressed, Forward one page.
  63. 0 = 4th mouse button is not pressed.
  64. Bit5 => 1 = 5th mouse button is pressed, Backward one page.
  65. 0 = 5th mouse button is not pressed.
  66. C) MSID 7
  67. FSP uses 2 packets (8 Bytes) to represent Absolute Position.
  68. so we have PACKET NUMBER to identify packets.
  69. If PACKET NUMBER is 0, the packet is Packet 1.
  70. If PACKET NUMBER is 1, the packet is Packet 2.
  71. Please count this number in program.
  72. MSID6 special packet will be enable at the same time when enable MSID 7.
  73. Absolute position for STL3886-G0
  74. ================================
  75. 1. Set bit 2 or 3 in register 0x40 to 1
  76. 2. Set bit 6 in register 0x40 to 1
  77. ::
  78. Packet 1 (ABSOLUTE POSITION)
  79. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  80. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  81. 1 |0|1|V|1|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|d|u|X|X|Y|Y|
  82. |---------------| |---------------| |---------------| |---------------|
  83. Byte 1: Bit7~Bit6 => 00, Normal data packet
  84. => 01, Absolute coordination packet
  85. => 10, Notify packet
  86. Bit5 => valid bit
  87. Bit4 => 1
  88. Bit3 => 1
  89. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  90. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  91. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  92. Byte 2: X coordinate (xpos[9:2])
  93. Byte 3: Y coordinate (ypos[9:2])
  94. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  95. Bit3~Bit2 => X coordinate (ypos[1:0])
  96. Bit4 => scroll up
  97. Bit5 => scroll down
  98. Bit6 => scroll left
  99. Bit7 => scroll right
  100. Notify Packet for G0
  101. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  102. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  103. 1 |1|0|0|1|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |M|M|M|M|M|M|M|M| 4 |0|0|0|0|0|0|0|0|
  104. |---------------| |---------------| |---------------| |---------------|
  105. Byte 1: Bit7~Bit6 => 00, Normal data packet
  106. => 01, Absolute coordination packet
  107. => 10, Notify packet
  108. Bit5 => 0
  109. Bit4 => 1
  110. Bit3 => 1
  111. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  112. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  113. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  114. Byte 2: Message Type => 0x5A (Enable/Disable status packet)
  115. Mode Type => 0xA5 (Normal/Icon mode status)
  116. Byte 3: Message Type => 0x00 (Disabled)
  117. => 0x01 (Enabled)
  118. Mode Type => 0x00 (Normal)
  119. => 0x01 (Icon)
  120. Byte 4: Bit7~Bit0 => Don't Care
  121. Absolute position for STL3888-Ax
  122. ================================
  123. ::
  124. Packet 1 (ABSOLUTE POSITION)
  125. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  126. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  127. 1 |0|1|V|A|1|L|0|1| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |x|x|y|y|X|X|Y|Y|
  128. |---------------| |---------------| |---------------| |---------------|
  129. Byte 1: Bit7~Bit6 => 00, Normal data packet
  130. => 01, Absolute coordination packet
  131. => 10, Notify packet
  132. => 11, Normal data packet with on-pad click
  133. Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
  134. When both fingers are up, the last two reports have zero valid
  135. bit.
  136. Bit4 => arc
  137. Bit3 => 1
  138. Bit2 => Left Button, 1 is pressed, 0 is released.
  139. Bit1 => 0
  140. Bit0 => 1
  141. Byte 2: X coordinate (xpos[9:2])
  142. Byte 3: Y coordinate (ypos[9:2])
  143. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  144. Bit3~Bit2 => X coordinate (ypos[1:0])
  145. Bit5~Bit4 => y1_g
  146. Bit7~Bit6 => x1_g
  147. Packet 2 (ABSOLUTE POSITION)
  148. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  149. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  150. 1 |0|1|V|A|1|R|1|0| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |x|x|y|y|X|X|Y|Y|
  151. |---------------| |---------------| |---------------| |---------------|
  152. Byte 1: Bit7~Bit6 => 00, Normal data packet
  153. => 01, Absolute coordinates packet
  154. => 10, Notify packet
  155. => 11, Normal data packet with on-pad click
  156. Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
  157. When both fingers are up, the last two reports have zero valid
  158. bit.
  159. Bit4 => arc
  160. Bit3 => 1
  161. Bit2 => Right Button, 1 is pressed, 0 is released.
  162. Bit1 => 1
  163. Bit0 => 0
  164. Byte 2: X coordinate (xpos[9:2])
  165. Byte 3: Y coordinate (ypos[9:2])
  166. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  167. Bit3~Bit2 => X coordinate (ypos[1:0])
  168. Bit5~Bit4 => y2_g
  169. Bit7~Bit6 => x2_g
  170. Notify Packet for STL3888-Ax
  171. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  172. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  173. 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|d|u|0|0|0|0|
  174. |---------------| |---------------| |---------------| |---------------|
  175. Byte 1: Bit7~Bit6 => 00, Normal data packet
  176. => 01, Absolute coordinates packet
  177. => 10, Notify packet
  178. => 11, Normal data packet with on-pad click
  179. Bit5 => 1
  180. Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
  181. 0: left button is generated by the on-pad command
  182. 1: left button is generated by the external button
  183. Bit3 => 1
  184. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  185. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  186. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  187. Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
  188. Byte 3: Bit7~Bit6 => Don't care
  189. Bit5~Bit4 => Number of fingers
  190. Bit3~Bit1 => Reserved
  191. Bit0 => 1: enter gesture mode; 0: leaving gesture mode
  192. Byte 4: Bit7 => scroll right button
  193. Bit6 => scroll left button
  194. Bit5 => scroll down button
  195. Bit4 => scroll up button
  196. * Note that if gesture and additional button (Bit4~Bit7)
  197. happen at the same time, the button information will not
  198. be sent.
  199. Bit3~Bit0 => Reserved
  200. Sample sequence of Multi-finger, Multi-coordinate mode:
  201. notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
  202. abs pkt 2, ..., notify packet (valid bit == 0)
  203. Absolute position for STL3888-B0
  204. ================================
  205. ::
  206. Packet 1(ABSOLUTE POSITION)
  207. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  208. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  209. 1 |0|1|V|F|1|0|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y|
  210. |---------------| |---------------| |---------------| |---------------|
  211. Byte 1: Bit7~Bit6 => 00, Normal data packet
  212. => 01, Absolute coordinates packet
  213. => 10, Notify packet
  214. => 11, Normal data packet with on-pad click
  215. Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
  216. When both fingers are up, the last two reports have zero valid
  217. bit.
  218. Bit4 => finger up/down information. 1: finger down, 0: finger up.
  219. Bit3 => 1
  220. Bit2 => finger index, 0 is the first finger, 1 is the second finger.
  221. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  222. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  223. Byte 2: X coordinate (xpos[9:2])
  224. Byte 3: Y coordinate (ypos[9:2])
  225. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  226. Bit3~Bit2 => X coordinate (ypos[1:0])
  227. Bit4 => scroll down button
  228. Bit5 => scroll up button
  229. Bit6 => scroll left button
  230. Bit7 => scroll right button
  231. Packet 2 (ABSOLUTE POSITION)
  232. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  233. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  234. 1 |0|1|V|F|1|1|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|u|d|X|X|Y|Y|
  235. |---------------| |---------------| |---------------| |---------------|
  236. Byte 1: Bit7~Bit6 => 00, Normal data packet
  237. => 01, Absolute coordination packet
  238. => 10, Notify packet
  239. => 11, Normal data packet with on-pad click
  240. Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
  241. When both fingers are up, the last two reports have zero valid
  242. bit.
  243. Bit4 => finger up/down information. 1: finger down, 0: finger up.
  244. Bit3 => 1
  245. Bit2 => finger index, 0 is the first finger, 1 is the second finger.
  246. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  247. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  248. Byte 2: X coordinate (xpos[9:2])
  249. Byte 3: Y coordinate (ypos[9:2])
  250. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  251. Bit3~Bit2 => X coordinate (ypos[1:0])
  252. Bit4 => scroll down button
  253. Bit5 => scroll up button
  254. Bit6 => scroll left button
  255. Bit7 => scroll right button
  256. Notify Packet for STL3888-B0::
  257. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  258. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  259. 1 |1|0|1|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0|
  260. |---------------| |---------------| |---------------| |---------------|
  261. Byte 1: Bit7~Bit6 => 00, Normal data packet
  262. => 01, Absolute coordination packet
  263. => 10, Notify packet
  264. => 11, Normal data packet with on-pad click
  265. Bit5 => 1
  266. Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
  267. 0: left button is generated by the on-pad command
  268. 1: left button is generated by the external button
  269. Bit3 => 1
  270. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  271. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  272. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  273. Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
  274. Byte 3: Bit7~Bit6 => Don't care
  275. Bit5~Bit4 => Number of fingers
  276. Bit3~Bit1 => Reserved
  277. Bit0 => 1: enter gesture mode; 0: leaving gesture mode
  278. Byte 4: Bit7 => scroll right button
  279. Bit6 => scroll left button
  280. Bit5 => scroll up button
  281. Bit4 => scroll down button
  282. * Note that if gesture and additional button(Bit4~Bit7)
  283. happen at the same time, the button information will not
  284. be sent.
  285. Bit3~Bit0 => Reserved
  286. Sample sequence of Multi-finger, Multi-coordinate mode:
  287. notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
  288. abs pkt 2, ..., notify packet (valid bit == 0)
  289. Absolute position for STL3888-Cx and STL3888-Dx
  290. ===============================================
  291. ::
  292. Single Finger, Absolute Coordinate Mode (SFAC)
  293. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  294. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  295. 1 |0|1|0|P|1|M|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y|
  296. |---------------| |---------------| |---------------| |---------------|
  297. Byte 1: Bit7~Bit6 => 00, Normal data packet
  298. => 01, Absolute coordinates packet
  299. => 10, Notify packet
  300. Bit5 => Coordinate mode(always 0 in SFAC mode):
  301. 0: single-finger absolute coordinates (SFAC) mode
  302. 1: multi-finger, multiple coordinates (MFMC) mode
  303. Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
  304. 1: The LEFT button is generated by external button
  305. Default is 1 even if the LEFT button is not pressed.
  306. Bit3 => Always 1, as specified by PS/2 protocol.
  307. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  308. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  309. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  310. Byte 2: X coordinate (xpos[9:2])
  311. Byte 3: Y coordinate (ypos[9:2])
  312. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  313. Bit3~Bit2 => X coordinate (ypos[1:0])
  314. Bit4 => 4th mouse button(forward one page)
  315. Bit5 => 5th mouse button(backward one page)
  316. Bit6 => scroll left button
  317. Bit7 => scroll right button
  318. Multi Finger, Multiple Coordinates Mode (MFMC):
  319. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  320. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  321. 1 |0|1|1|P|1|F|R|L| 2 |X|X|X|X|X|X|X|X| 3 |Y|Y|Y|Y|Y|Y|Y|Y| 4 |r|l|B|F|X|X|Y|Y|
  322. |---------------| |---------------| |---------------| |---------------|
  323. Byte 1: Bit7~Bit6 => 00, Normal data packet
  324. => 01, Absolute coordination packet
  325. => 10, Notify packet
  326. Bit5 => Coordinate mode (always 1 in MFMC mode):
  327. 0: single-finger absolute coordinates (SFAC) mode
  328. 1: multi-finger, multiple coordinates (MFMC) mode
  329. Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
  330. 1: The LEFT button is generated by external button
  331. Default is 1 even if the LEFT button is not pressed.
  332. Bit3 => Always 1, as specified by PS/2 protocol.
  333. Bit2 => Finger index, 0 is the first finger, 1 is the second finger.
  334. If bit 1 and 0 are all 1 and bit 4 is 0, the middle external
  335. button is pressed.
  336. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  337. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  338. Byte 2: X coordinate (xpos[9:2])
  339. Byte 3: Y coordinate (ypos[9:2])
  340. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  341. Bit3~Bit2 => X coordinate (ypos[1:0])
  342. Bit4 => 4th mouse button(forward one page)
  343. Bit5 => 5th mouse button(backward one page)
  344. Bit6 => scroll left button
  345. Bit7 => scroll right button
  346. When one of the two fingers is up, the device will output four consecutive
  347. MFMC#0 report packets with zero X and Y to represent 1st finger is up or
  348. four consecutive MFMC#1 report packets with zero X and Y to represent that
  349. the 2nd finger is up. On the other hand, if both fingers are up, the device
  350. will output four consecutive single-finger, absolute coordinate(SFAC) packets
  351. with zero X and Y.
  352. Notify Packet for STL3888-Cx/Dx::
  353. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  354. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  355. 1 |1|0|0|P|1|M|R|L| 2 |C|C|C|C|C|C|C|C| 3 |0|0|F|F|0|0|0|i| 4 |r|l|u|d|0|0|0|0|
  356. |---------------| |---------------| |---------------| |---------------|
  357. Byte 1: Bit7~Bit6 => 00, Normal data packet
  358. => 01, Absolute coordinates packet
  359. => 10, Notify packet
  360. Bit5 => Always 0
  361. Bit4 => 0: The LEFT button is generated by on-pad command(OPC)
  362. 1: The LEFT button is generated by external button
  363. Default is 1 even if the LEFT button is not pressed.
  364. Bit3 => 1
  365. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  366. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  367. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  368. Byte 2: Message type:
  369. 0xba => gesture information
  370. 0xc0 => one finger hold-rotating gesture
  371. Byte 3: The first parameter for the received message:
  372. 0xba => gesture ID (refer to the 'Gesture ID' section)
  373. 0xc0 => region ID
  374. Byte 4: The second parameter for the received message:
  375. 0xba => N/A
  376. 0xc0 => finger up/down information
  377. Sample sequence of Multi-finger, Multi-coordinates mode:
  378. notify packet (valid bit == 1), MFMC packet 1 (byte 1, bit 2 == 0),
  379. MFMC packet 2 (byte 1, bit 2 == 1), MFMC packet 1, MFMC packet 2,
  380. ..., notify packet (valid bit == 0)
  381. That is, when the device is in MFMC mode, the host will receive
  382. interleaved absolute coordinate packets for each finger.
  383. FSP Enable/Disable packet
  384. =========================
  385. ::
  386. Bit 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
  387. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  388. 1 |Y|X|0|0|1|M|R|L| 2 |0|1|0|1|1|0|1|E| 3 | | | | | | | | | 4 | | | | | | | | |
  389. |---------------| |---------------| |---------------| |---------------|
  390. FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
  391. command. Host will receive the packet which Middle, Right, Left button will
  392. be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
  393. Ignore the other bytes of the packet.
  394. Byte 1: Bit7 => 0, Y overflow
  395. Bit6 => 0, X overflow
  396. Bit5 => 0, Y sign bit
  397. Bit4 => 0, X sign bit
  398. Bit3 => 1
  399. Bit2 => 1, Middle Button
  400. Bit1 => 1, Right Button
  401. Bit0 => 1, Left Button
  402. Byte 2: Bit7~1 => (0101101b)
  403. Bit0 => 1 = Enable
  404. 0 = Disable
  405. Byte 3: Don't care
  406. Byte 4: Don't care (MOUSE ID 3, 4)
  407. Byte 5~8: Don't care (Absolute packet)
  408. PS/2 Command Set
  409. ================
  410. FSP supports basic PS/2 commanding set and modes, refer to following URL for
  411. details about PS/2 commands:
  412. http://www.computer-engineering.org/ps2mouse/
  413. Programming Sequence for Determining Packet Parsing Flow
  414. ========================================================
  415. 1. Identify FSP by reading device ID(0x00) and version(0x01) register
  416. 2. For FSP version < STL3888 Cx, determine number of buttons by reading
  417. the 'test mode status' (0x20) register::
  418. buttons = reg[0x20] & 0x30
  419. if buttons == 0x30 or buttons == 0x20:
  420. # two/four buttons
  421. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  422. section A for packet parsing detail(ignore byte 4, bit ~ 7)
  423. elif buttons == 0x10:
  424. # 6 buttons
  425. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  426. section B for packet parsing detail
  427. elif buttons == 0x00:
  428. # 6 buttons
  429. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  430. section A for packet parsing detail
  431. 3. For FSP version >= STL3888 Cx:
  432. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  433. section A for packet parsing detail (ignore byte 4, bit ~ 7)
  434. Programming Sequence for Register Reading/Writing
  435. =================================================
  436. Register inversion requirement:
  437. Following values needed to be inverted(the '~' operator in C) before being
  438. sent to FSP::
  439. 0xe8, 0xe9, 0xee, 0xf2, 0xf3 and 0xff.
  440. Register swapping requirement:
  441. Following values needed to have their higher 4 bits and lower 4 bits being
  442. swapped before being sent to FSP::
  443. 10, 20, 40, 60, 80, 100 and 200.
  444. Register reading sequence:
  445. 1. send 0xf3 PS/2 command to FSP;
  446. 2. send 0x66 PS/2 command to FSP;
  447. 3. send 0x88 PS/2 command to FSP;
  448. 4. send 0xf3 PS/2 command to FSP;
  449. 5. if the register address being to read is not required to be
  450. inverted(refer to the 'Register inversion requirement' section),
  451. goto step 6
  452. a. send 0x68 PS/2 command to FSP;
  453. b. send the inverted register address to FSP and goto step 8;
  454. 6. if the register address being to read is not required to be
  455. swapped(refer to the 'Register swapping requirement' section),
  456. goto step 7
  457. a. send 0xcc PS/2 command to FSP;
  458. b. send the swapped register address to FSP and goto step 8;
  459. 7. send 0x66 PS/2 command to FSP;
  460. a. send the original register address to FSP and goto step 8;
  461. 8. send 0xe9(status request) PS/2 command to FSP;
  462. 9. the 4th byte of the response read from FSP should be the
  463. requested register value(?? indicates don't care byte)::
  464. host: 0xe9
  465. 3888: 0xfa (??) (??) (val)
  466. * Note that since the Cx release, the hardware will return 1's
  467. complement of the register value at the 3rd byte of status request
  468. result::
  469. host: 0xe9
  470. 3888: 0xfa (??) (~val) (val)
  471. Register writing sequence:
  472. 1. send 0xf3 PS/2 command to FSP;
  473. 2. if the register address being to write is not required to be
  474. inverted(refer to the 'Register inversion requirement' section),
  475. goto step 3
  476. a. send 0x74 PS/2 command to FSP;
  477. b. send the inverted register address to FSP and goto step 5;
  478. 3. if the register address being to write is not required to be
  479. swapped(refer to the 'Register swapping requirement' section),
  480. goto step 4
  481. a. send 0x77 PS/2 command to FSP;
  482. b. send the swapped register address to FSP and goto step 5;
  483. 4. send 0x55 PS/2 command to FSP;
  484. a. send the register address to FSP and goto step 5;
  485. 5. send 0xf3 PS/2 command to FSP;
  486. 6. if the register value being to write is not required to be
  487. inverted(refer to the 'Register inversion requirement' section),
  488. goto step 7
  489. a. send 0x47 PS/2 command to FSP;
  490. b. send the inverted register value to FSP and goto step 9;
  491. 7. if the register value being to write is not required to be
  492. swapped(refer to the 'Register swapping requirement' section),
  493. goto step 8
  494. a. send 0x44 PS/2 command to FSP;
  495. b. send the swapped register value to FSP and goto step 9;
  496. 8. send 0x33 PS/2 command to FSP;
  497. a. send the register value to FSP;
  498. 9. the register writing sequence is completed.
  499. * Since the Cx release, the hardware will return 1's
  500. complement of the register value at the 3rd byte of status request
  501. result. Host can optionally send another 0xe9 (status request) PS/2
  502. command to FSP at the end of register writing to verify that the
  503. register writing operation is successful (?? indicates don't care
  504. byte)::
  505. host: 0xe9
  506. 3888: 0xfa (??) (~val) (val)
  507. Programming Sequence for Page Register Reading/Writing
  508. ======================================================
  509. In order to overcome the limitation of maximum number of registers
  510. supported, the hardware separates register into different groups called
  511. 'pages.' Each page is able to include up to 255 registers.
  512. The default page after power up is 0x82; therefore, if one has to get
  513. access to register 0x8301, one has to use following sequence to switch
  514. to page 0x83, then start reading/writing from/to offset 0x01 by using
  515. the register read/write sequence described in previous section.
  516. Page register reading sequence:
  517. 1. send 0xf3 PS/2 command to FSP;
  518. 2. send 0x66 PS/2 command to FSP;
  519. 3. send 0x88 PS/2 command to FSP;
  520. 4. send 0xf3 PS/2 command to FSP;
  521. 5. send 0x83 PS/2 command to FSP;
  522. 6. send 0x88 PS/2 command to FSP;
  523. 7. send 0xe9(status request) PS/2 command to FSP;
  524. 8. the response read from FSP should be the requested page value.
  525. Page register writing sequence:
  526. 1. send 0xf3 PS/2 command to FSP;
  527. 2. send 0x38 PS/2 command to FSP;
  528. 3. send 0x88 PS/2 command to FSP;
  529. 4. send 0xf3 PS/2 command to FSP;
  530. 5. if the page address being written is not required to be
  531. inverted(refer to the 'Register inversion requirement' section),
  532. goto step 6
  533. a. send 0x47 PS/2 command to FSP;
  534. b. send the inverted page address to FSP and goto step 9;
  535. 6. if the page address being written is not required to be
  536. swapped(refer to the 'Register swapping requirement' section),
  537. goto step 7
  538. a. send 0x44 PS/2 command to FSP;
  539. b. send the swapped page address to FSP and goto step 9;
  540. 7. send 0x33 PS/2 command to FSP;
  541. 8. send the page address to FSP;
  542. 9. the page register writing sequence is completed.
  543. Gesture ID
  544. ==========
  545. Unlike other devices which sends multiple fingers' coordinates to host,
  546. FSP processes multiple fingers' coordinates internally and convert them
  547. into a 8 bits integer, namely 'Gesture ID.' Following is a list of
  548. supported gesture IDs:
  549. ======= ==================================
  550. ID Description
  551. ======= ==================================
  552. 0x86 2 finger straight up
  553. 0x82 2 finger straight down
  554. 0x80 2 finger straight right
  555. 0x84 2 finger straight left
  556. 0x8f 2 finger zoom in
  557. 0x8b 2 finger zoom out
  558. 0xc0 2 finger curve, counter clockwise
  559. 0xc4 2 finger curve, clockwise
  560. 0x2e 3 finger straight up
  561. 0x2a 3 finger straight down
  562. 0x28 3 finger straight right
  563. 0x2c 3 finger straight left
  564. 0x38 palm
  565. ======= ==================================
  566. Register Listing
  567. ================
  568. Registers are represented in 16 bits values. The higher 8 bits represent
  569. the page address and the lower 8 bits represent the relative offset within
  570. that particular page. Refer to the 'Programming Sequence for Page Register
  571. Reading/Writing' section for instructions on how to change current page
  572. address::
  573. offset width default r/w name
  574. 0x8200 bit7~bit0 0x01 RO device ID
  575. 0x8201 bit7~bit0 RW version ID
  576. 0xc1: STL3888 Ax
  577. 0xd0 ~ 0xd2: STL3888 Bx
  578. 0xe0 ~ 0xe1: STL3888 Cx
  579. 0xe2 ~ 0xe3: STL3888 Dx
  580. 0x8202 bit7~bit0 0x01 RO vendor ID
  581. 0x8203 bit7~bit0 0x01 RO product ID
  582. 0x8204 bit3~bit0 0x01 RW revision ID
  583. 0x820b test mode status 1
  584. bit3 1 RO 0: rotate 180 degree
  585. 1: no rotation
  586. *only supported by H/W prior to Cx
  587. 0x820f register file page control
  588. bit2 0 RW 1: rotate 180 degree
  589. 0: no rotation
  590. *supported since Cx
  591. bit0 0 RW 1 to enable page 1 register files
  592. *only supported by H/W prior to Cx
  593. 0x8210 RW system control 1
  594. bit0 1 RW Reserved, must be 1
  595. bit1 0 RW Reserved, must be 0
  596. bit4 0 RW Reserved, must be 0
  597. bit5 1 RW register clock gating enable
  598. 0: read only, 1: read/write enable
  599. (Note that following registers does not require clock gating being
  600. enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
  601. 40 41 42 43. In addition to that, this bit must be 1 when gesture
  602. mode is enabled)
  603. 0x8220 test mode status
  604. bit5~bit4 RO number of buttons
  605. 11 => 2, lbtn/rbtn
  606. 10 => 4, lbtn/rbtn/scru/scrd
  607. 01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr
  608. 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
  609. *only supported by H/W prior to Cx
  610. 0x8231 RW on-pad command detection
  611. bit7 0 RW on-pad command left button down tag
  612. enable
  613. 0: disable, 1: enable
  614. *only supported by H/W prior to Cx
  615. 0x8234 RW on-pad command control 5
  616. bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5
  617. (Note that position unit is in 0.5 scanline)
  618. *only supported by H/W prior to Cx
  619. bit7 0 RW on-pad tap zone enable
  620. 0: disable, 1: enable
  621. *only supported by H/W prior to Cx
  622. 0x8235 RW on-pad command control 6
  623. bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5
  624. (Note that position unit is in 0.5 scanline)
  625. *only supported by H/W prior to Cx
  626. 0x8236 RW on-pad command control 7
  627. bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5
  628. (Note that position unit is in 0.5 scanline)
  629. *only supported by H/W prior to Cx
  630. 0x8237 RW on-pad command control 8
  631. bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5
  632. (Note that position unit is in 0.5 scanline)
  633. *only supported by H/W prior to Cx
  634. 0x8240 RW system control 5
  635. bit1 0 RW FSP Intellimouse mode enable
  636. 0: disable, 1: enable
  637. *only supported by H/W prior to Cx
  638. bit2 0 RW movement + abs. coordinate mode enable
  639. 0: disable, 1: enable
  640. (Note that this function has the functionality of bit 1 even when
  641. bit 1 is not set. However, the format is different from that of bit 1.
  642. In addition, when bit 1 and bit 2 are set at the same time, bit 2 will
  643. override bit 1.)
  644. *only supported by H/W prior to Cx
  645. bit3 0 RW abs. coordinate only mode enable
  646. 0: disable, 1: enable
  647. (Note that this function has the functionality of bit 1 even when
  648. bit 1 is not set. However, the format is different from that of bit 1.
  649. In addition, when bit 1, bit 2 and bit 3 are set at the same time,
  650. bit 3 will override bit 1 and 2.)
  651. *only supported by H/W prior to Cx
  652. bit5 0 RW auto switch enable
  653. 0: disable, 1: enable
  654. *only supported by H/W prior to Cx
  655. bit6 0 RW G0 abs. + notify packet format enable
  656. 0: disable, 1: enable
  657. (Note that the absolute/relative coordinate output still depends on
  658. bit 2 and 3. That is, if any of those bit is 1, host will receive
  659. absolute coordinates; otherwise, host only receives packets with
  660. relative coordinate.)
  661. *only supported by H/W prior to Cx
  662. bit7 0 RW EN_PS2_F2: PS/2 gesture mode 2nd
  663. finger packet enable
  664. 0: disable, 1: enable
  665. *only supported by H/W prior to Cx
  666. 0x8243 RW on-pad control
  667. bit0 0 RW on-pad control enable
  668. 0: disable, 1: enable
  669. (Note that if this bit is cleared, bit 3/5 will be ineffective)
  670. *only supported by H/W prior to Cx
  671. bit3 0 RW on-pad fix vertical scrolling enable
  672. 0: disable, 1: enable
  673. *only supported by H/W prior to Cx
  674. bit5 0 RW on-pad fix horizontal scrolling enable
  675. 0: disable, 1: enable
  676. *only supported by H/W prior to Cx
  677. 0x8290 RW software control register 1
  678. bit0 0 RW absolute coordination mode
  679. 0: disable, 1: enable
  680. *supported since Cx
  681. bit1 0 RW gesture ID output
  682. 0: disable, 1: enable
  683. *supported since Cx
  684. bit2 0 RW two fingers' coordinates output
  685. 0: disable, 1: enable
  686. *supported since Cx
  687. bit3 0 RW finger up one packet output
  688. 0: disable, 1: enable
  689. *supported since Cx
  690. bit4 0 RW absolute coordination continuous mode
  691. 0: disable, 1: enable
  692. *supported since Cx
  693. bit6~bit5 00 RW gesture group selection
  694. 00: basic
  695. 01: suite
  696. 10: suite pro
  697. 11: advanced
  698. *supported since Cx
  699. bit7 0 RW Bx packet output compatible mode
  700. 0: disable, 1: enable
  701. *supported since Cx
  702. *supported since Cx
  703. 0x833d RW on-pad command control 1
  704. bit7 1 RW on-pad command detection enable
  705. 0: disable, 1: enable
  706. *supported since Cx
  707. 0x833e RW on-pad command detection
  708. bit7 0 RW on-pad command left button down tag
  709. enable. Works only in H/W based PS/2
  710. data packet mode.
  711. 0: disable, 1: enable
  712. *supported since Cx