sentelic.txt 33 KB

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