sentelic.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. Copyright (C) 2002-2008 Sentelic Corporation.
  2. Last update: Oct-31-2008
  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|l|r|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 Vertical scrolling movement rightward.
  56. Bit3 => the Vertical scrolling movement leftward.
  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) data 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-A0.
  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. Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
  128. When both fingers are up, the last two reports have zero valid
  129. bit.
  130. Bit4 => arc
  131. Bit3 => 1
  132. Bit2 => Left Button, 1 is pressed, 0 is released.
  133. Bit1 => 0
  134. Bit0 => 1
  135. Byte 2: X coordinate (xpos[9:2])
  136. Byte 3: Y coordinate (ypos[9:2])
  137. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  138. Bit3~Bit2 => X coordinate (ypos[1:0])
  139. Bit5~Bit4 => y1_g
  140. Bit7~Bit6 => x1_g
  141. Packet 2 (ABSOLUTE POSITION)
  142. 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
  143. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  144. 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|
  145. |---------------| |---------------| |---------------| |---------------|
  146. Byte 1: Bit7~Bit6 => 00, Normal data packet
  147. => 01, Absolute coordinates packet
  148. => 10, Notify packet
  149. Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
  150. When both fingers are up, the last two reports have zero valid
  151. bit.
  152. Bit4 => arc
  153. Bit3 => 1
  154. Bit2 => Right Button, 1 is pressed, 0 is released.
  155. Bit1 => 1
  156. Bit0 => 0
  157. Byte 2: X coordinate (xpos[9:2])
  158. Byte 3: Y coordinate (ypos[9:2])
  159. Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
  160. Bit3~Bit2 => X coordinate (ypos[1:0])
  161. Bit5~Bit4 => y2_g
  162. Bit7~Bit6 => x2_g
  163. Notify Packet for STL3888-A0
  164. 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
  165. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  166. 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|
  167. |---------------| |---------------| |---------------| |---------------|
  168. Byte 1: Bit7~Bit6 => 00, Normal data packet
  169. => 01, Absolute coordination packet
  170. => 10, Notify packet
  171. Bit5 => 1
  172. Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
  173. 0: left button is generated by the on-pad command
  174. 1: left button is generated by the external button
  175. Bit3 => 1
  176. Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
  177. Bit1 => Right Button, 1 is pressed, 0 is not pressed.
  178. Bit0 => Left Button, 1 is pressed, 0 is not pressed.
  179. Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
  180. Byte 3: Bit7~Bit6 => Don't care
  181. Bit5~Bit4 => Number of fingers
  182. Bit3~Bit1 => Reserved
  183. Bit0 => 1: enter gesture mode; 0: leaving gesture mode
  184. Byte 4: Bit7 => scroll right button
  185. Bit6 => scroll left button
  186. Bit5 => scroll down button
  187. Bit4 => scroll up button
  188. * Note that if gesture and additional button (Bit4~Bit7)
  189. happen at the same time, the button information will not
  190. be sent.
  191. Bit3~Bit0 => Reserved
  192. Sample sequence of Multi-finger, Multi-coordinate mode:
  193. notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
  194. abs pkt 2, ..., notify packet(valid bit == 0)
  195. ==============================================================================
  196. * FSP Enable/Disable packet
  197. ==============================================================================
  198. 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
  199. BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  200. 1 |Y|X|0|0|1|M|R|L| 2 |0|1|0|1|1|0|1|E| 3 | | | | | | | | | 4 | | | | | | | | |
  201. |---------------| |---------------| |---------------| |---------------|
  202. FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
  203. command. Host will receive the packet which Middle, Right, Left button will
  204. be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
  205. Ignore the other bytes of the packet.
  206. Byte 1: Bit7 => 0, Y overflow
  207. Bit6 => 0, X overflow
  208. Bit5 => 0, Y sign bit
  209. Bit4 => 0, X sign bit
  210. Bit3 => 1
  211. Bit2 => 1, Middle Button
  212. Bit1 => 1, Right Button
  213. Bit0 => 1, Left Button
  214. Byte 2: Bit7~1 => (0101101b)
  215. Bit0 => 1 = Enable
  216. 0 = Disable
  217. Byte 3: Don't care
  218. Byte 4: Don't care (MOUSE ID 3, 4)
  219. Byte 5~8: Don't care (Absolute packet)
  220. ==============================================================================
  221. * PS/2 Command Set
  222. ==============================================================================
  223. FSP supports basic PS/2 commanding set and modes, refer to following URL for
  224. details about PS/2 commands:
  225. http://www.computer-engineering.org/index.php?title=PS/2_Mouse_Interface
  226. ==============================================================================
  227. * Programming Sequence for Determining Packet Parsing Flow
  228. ==============================================================================
  229. 1. Identify FSP by reading device ID(0x00) and version(0x01) register
  230. 2. Determine number of buttons by reading status2 (0x0b) register
  231. buttons = reg[0x0b] & 0x30
  232. if buttons == 0x30 or buttons == 0x20:
  233. # two/four buttons
  234. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  235. section A for packet parsing detail(ignore byte 4, bit ~ 7)
  236. elif buttons == 0x10:
  237. # 6 buttons
  238. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  239. section B for packet parsing detail
  240. elif buttons == 0x00:
  241. # 6 buttons
  242. Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
  243. section A for packet parsing detail
  244. ==============================================================================
  245. * Programming Sequence for Register Reading/Writing
  246. ==============================================================================
  247. Register inversion requirement:
  248. Following values needed to be inverted(the '~' operator in C) before being
  249. sent to FSP:
  250. 0xe9, 0xee, 0xf2 and 0xff.
  251. Register swapping requirement:
  252. Following values needed to have their higher 4 bits and lower 4 bits being
  253. swapped before being sent to FSP:
  254. 10, 20, 40, 60, 80, 100 and 200.
  255. Register reading sequence:
  256. 1. send 0xf3 PS/2 command to FSP;
  257. 2. send 0x66 PS/2 command to FSP;
  258. 3. send 0x88 PS/2 command to FSP;
  259. 4. send 0xf3 PS/2 command to FSP;
  260. 5. if the register address being to read is not required to be
  261. inverted(refer to the 'Register inversion requirement' section),
  262. goto step 6
  263. 5a. send 0x68 PS/2 command to FSP;
  264. 5b. send the inverted register address to FSP and goto step 8;
  265. 6. if the register address being to read is not required to be
  266. swapped(refer to the 'Register swapping requirement' section),
  267. goto step 7
  268. 6a. send 0xcc PS/2 command to FSP;
  269. 6b. send the swapped register address to FSP and goto step 8;
  270. 7. send 0x66 PS/2 command to FSP;
  271. 7a. send the original register address to FSP and goto step 8;
  272. 8. send 0xe9(status request) PS/2 command to FSP;
  273. 9. the response read from FSP should be the requested register value.
  274. Register writing sequence:
  275. 1. send 0xf3 PS/2 command to FSP;
  276. 2. if the register address being to write is not required to be
  277. inverted(refer to the 'Register inversion requirement' section),
  278. goto step 3
  279. 2a. send 0x74 PS/2 command to FSP;
  280. 2b. send the inverted register address to FSP and goto step 5;
  281. 3. if the register address being to write is not required to be
  282. swapped(refer to the 'Register swapping requirement' section),
  283. goto step 4
  284. 3a. send 0x77 PS/2 command to FSP;
  285. 3b. send the swapped register address to FSP and goto step 5;
  286. 4. send 0x55 PS/2 command to FSP;
  287. 4a. send the register address to FSP and goto step 5;
  288. 5. send 0xf3 PS/2 command to FSP;
  289. 6. if the register value being to write is not required to be
  290. inverted(refer to the 'Register inversion requirement' section),
  291. goto step 7
  292. 6a. send 0x47 PS/2 command to FSP;
  293. 6b. send the inverted register value to FSP and goto step 9;
  294. 7. if the register value being to write is not required to be
  295. swapped(refer to the 'Register swapping requirement' section),
  296. goto step 8
  297. 7a. send 0x44 PS/2 command to FSP;
  298. 7b. send the swapped register value to FSP and goto step 9;
  299. 8. send 0x33 PS/2 command to FSP;
  300. 8a. send the register value to FSP;
  301. 9. the register writing sequence is completed.
  302. ==============================================================================
  303. * Register Listing
  304. ==============================================================================
  305. offset width default r/w name
  306. 0x00 bit7~bit0 0x01 RO device ID
  307. 0x01 bit7~bit0 0xc0 RW version ID
  308. 0x02 bit7~bit0 0x01 RO vendor ID
  309. 0x03 bit7~bit0 0x01 RO product ID
  310. 0x04 bit3~bit0 0x01 RW revision ID
  311. 0x0b RO test mode status 1
  312. bit3 1 RO 0: rotate 180 degree, 1: no rotation
  313. bit5~bit4 RO number of buttons
  314. 11 => 2, lbtn/rbtn
  315. 10 => 4, lbtn/rbtn/scru/scrd
  316. 01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr
  317. 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
  318. 0x0f RW register file page control
  319. bit0 0 RW 1 to enable page 1 register files
  320. 0x10 RW system control 1
  321. bit0 1 RW Reserved, must be 1
  322. bit1 0 RW Reserved, must be 0
  323. bit4 1 RW Reserved, must be 0
  324. bit5 0 RW register clock gating enable
  325. 0: read only, 1: read/write enable
  326. (Note that following registers does not require clock gating being
  327. enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
  328. 40 41 42 43.)
  329. 0x31 RW on-pad command detection
  330. bit7 0 RW on-pad command left button down tag
  331. enable
  332. 0: disable, 1: enable
  333. 0x34 RW on-pad command control 5
  334. bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5
  335. (Note that position unit is in 0.5 scanline)
  336. bit7 0 RW on-pad tap zone enable
  337. 0: disable, 1: enable
  338. 0x35 RW on-pad command control 6
  339. bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5
  340. (Note that position unit is in 0.5 scanline)
  341. 0x36 RW on-pad command control 7
  342. bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5
  343. (Note that position unit is in 0.5 scanline)
  344. 0x37 RW on-pad command control 8
  345. bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5
  346. (Note that position unit is in 0.5 scanline)
  347. 0x40 RW system control 5
  348. bit1 0 RW FSP Intellimouse mode enable
  349. 0: disable, 1: enable
  350. bit2 0 RW movement + abs. coordinate mode enable
  351. 0: disable, 1: enable
  352. (Note that this function has the functionality of bit 1 even when
  353. bit 1 is not set. However, the format is different from that of bit 1.
  354. In addition, when bit 1 and bit 2 are set at the same time, bit 2 will
  355. override bit 1.)
  356. bit3 0 RW abs. coordinate only mode enable
  357. 0: disable, 1: enable
  358. (Note that this function has the functionality of bit 1 even when
  359. bit 1 is not set. However, the format is different from that of bit 1.
  360. In addition, when bit 1, bit 2 and bit 3 are set at the same time,
  361. bit 3 will override bit 1 and 2.)
  362. bit5 0 RW auto switch enable
  363. 0: disable, 1: enable
  364. bit6 0 RW G0 abs. + notify packet format enable
  365. 0: disable, 1: enable
  366. (Note that the absolute/relative coordinate output still depends on
  367. bit 2 and 3. That is, if any of those bit is 1, host will receive
  368. absolute coordinates; otherwise, host only receives packets with
  369. relative coordinate.)
  370. 0x43 RW on-pad control
  371. bit0 0 RW on-pad control enable
  372. 0: disable, 1: enable
  373. (Note that if this bit is cleared, bit 3/5 will be ineffective)
  374. bit3 0 RW on-pad fix vertical scrolling enable
  375. 0: disable, 1: enable
  376. bit5 0 RW on-pad fix horizontal scrolling enable
  377. 0: disable, 1: enable