1 Copyright (C) 2002-2010 Sentelic Corporation.
2 Last update: Jan-13-2010
4 ==============================================================================
5 * Finger Sensing Pad Intellimouse Mode(scrolling wheel, 4th and 5th buttons)
6 ==============================================================================
7 A) MSID 4: Scrolling wheel mode plus Forward page(4th button) and Backward
9 @1. Set sample rate to 200;
10 @2. Set sample rate to 200;
11 @3. Set sample rate to 80;
12 @4. Issuing the "Get device ID" command (0xF2) and waits for the response;
13 @5. FSP will respond 0x04.
16 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
17 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
18 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|
19 |---------------| |---------------| |---------------| |---------------|
21 Byte 1: Bit7 => Y overflow
26 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
27 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
28 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
29 Byte 2: X Movement(9-bit 2's complement integers)
30 Byte 3: Y Movement(9-bit 2's complement integers)
31 Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report.
33 Bit4 => 1 = 4th mouse button is pressed, Forward one page.
34 0 = 4th mouse button is not pressed.
35 Bit5 => 1 = 5th mouse button is pressed, Backward one page.
36 0 = 5th mouse button is not pressed.
38 B) MSID 6: Horizontal and Vertical scrolling.
39 @ Set bit 1 in register 0x40 to 1
41 # FSP replaces scrolling wheel's movement as 4 bits to show horizontal and
45 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
46 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
47 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|
48 |---------------| |---------------| |---------------| |---------------|
50 Byte 1: Bit7 => Y overflow
55 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
56 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
57 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
58 Byte 2: X Movement(9-bit 2's complement integers)
59 Byte 3: Y Movement(9-bit 2's complement integers)
60 Byte 4: Bit0 => the Vertical scrolling movement downward.
61 Bit1 => the Vertical scrolling movement upward.
62 Bit2 => the Horizontal scrolling movement leftward.
63 Bit3 => the Horizontal scrolling movement rightward.
64 Bit4 => 1 = 4th mouse button is pressed, Forward one page.
65 0 = 4th mouse button is not pressed.
66 Bit5 => 1 = 5th mouse button is pressed, Backward one page.
67 0 = 5th mouse button is not pressed.
70 # FSP uses 2 packets (8 Bytes) to represent Absolute Position.
71 so we have PACKET NUMBER to identify packets.
72 If PACKET NUMBER is 0, the packet is Packet 1.
73 If PACKET NUMBER is 1, the packet is Packet 2.
74 Please count this number in program.
76 # MSID6 special packet will be enable at the same time when enable MSID 7.
78 ==============================================================================
79 * Absolute position for STL3886-G0.
80 ==============================================================================
81 @ Set bit 2 or 3 in register 0x40 to 1
82 @ Set bit 6 in register 0x40 to 1
84 Packet 1 (ABSOLUTE POSITION)
85 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
86 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
87 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|
88 |---------------| |---------------| |---------------| |---------------|
90 Byte 1: Bit7~Bit6 => 00, Normal data packet
91 => 01, Absolute coordination packet
96 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
97 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
98 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
99 Byte 2: X coordinate (xpos[9:2])
100 Byte 3: Y coordinate (ypos[9:2])
101 Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
102 Bit3~Bit2 => X coordinate (ypos[1:0])
109 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
110 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
111 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|
112 |---------------| |---------------| |---------------| |---------------|
114 Byte 1: Bit7~Bit6 => 00, Normal data packet
115 => 01, Absolute coordination packet
120 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
121 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
122 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
123 Byte 2: Message Type => 0x5A (Enable/Disable status packet)
124 Mode Type => 0xA5 (Normal/Icon mode status)
125 Byte 3: Message Type => 0x00 (Disabled)
127 Mode Type => 0x00 (Normal)
129 Byte 4: Bit7~Bit0 => Don't Care
131 ==============================================================================
132 * Absolute position for STL3888-Ax.
133 ==============================================================================
134 Packet 1 (ABSOLUTE POSITION)
135 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
136 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
137 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|
138 |---------------| |---------------| |---------------| |---------------|
140 Byte 1: Bit7~Bit6 => 00, Normal data packet
141 => 01, Absolute coordination packet
143 Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
144 When both fingers are up, the last two reports have zero valid
148 Bit2 => Left Button, 1 is pressed, 0 is released.
151 Byte 2: X coordinate (xpos[9:2])
152 Byte 3: Y coordinate (ypos[9:2])
153 Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
154 Bit3~Bit2 => X coordinate (ypos[1:0])
158 Packet 2 (ABSOLUTE POSITION)
159 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
160 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
161 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|
162 |---------------| |---------------| |---------------| |---------------|
164 Byte 1: Bit7~Bit6 => 00, Normal data packet
165 => 01, Absolute coordinates packet
167 Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
168 When both fingers are up, the last two reports have zero valid
172 Bit2 => Right Button, 1 is pressed, 0 is released.
175 Byte 2: X coordinate (xpos[9:2])
176 Byte 3: Y coordinate (ypos[9:2])
177 Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
178 Bit3~Bit2 => X coordinate (ypos[1:0])
182 Notify Packet for STL3888-Ax
183 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
184 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
185 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|
186 |---------------| |---------------| |---------------| |---------------|
188 Byte 1: Bit7~Bit6 => 00, Normal data packet
189 => 01, Absolute coordinates packet
192 Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
193 0: left button is generated by the on-pad command
194 1: left button is generated by the external button
196 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
197 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
198 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
199 Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
200 Byte 3: Bit7~Bit6 => Don't care
201 Bit5~Bit4 => Number of fingers
202 Bit3~Bit1 => Reserved
203 Bit0 => 1: enter gesture mode; 0: leaving gesture mode
204 Byte 4: Bit7 => scroll right button
205 Bit6 => scroll left button
206 Bit5 => scroll down button
207 Bit4 => scroll up button
208 * Note that if gesture and additional buttoni (Bit4~Bit7)
209 happen at the same time, the button information will not
211 Bit3~Bit0 => Reserved
213 Sample sequence of Multi-finger, Multi-coordinate mode:
215 notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
216 abs pkt 2, ..., notify packet (valid bit == 0)
218 ==============================================================================
219 * Absolute position for STL3888-B0.
220 ==============================================================================
221 Packet 1(ABSOLUTE POSITION)
222 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
223 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
224 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|
225 |---------------| |---------------| |---------------| |---------------|
227 Byte 1: Bit7~Bit6 => 00, Normal data packet
228 => 01, Absolute coordinates packet
230 Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
231 When both fingers are up, the last two reports have zero valid
233 Bit4 => finger up/down information. 1: finger down, 0: finger up.
235 Bit2 => finger index, 0 is the first finger, 1 is the second finger.
236 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
237 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
238 Byte 2: X coordinate (xpos[9:2])
239 Byte 3: Y coordinate (ypos[9:2])
240 Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
241 Bit3~Bit2 => X coordinate (ypos[1:0])
242 Bit4 => scroll down button
243 Bit5 => scroll up button
244 Bit6 => scroll left button
245 Bit7 => scroll right button
247 Packet 2 (ABSOLUTE POSITION)
248 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
249 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
250 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|
251 |---------------| |---------------| |---------------| |---------------|
253 Byte 1: Bit7~Bit6 => 00, Normal data packet
254 => 01, Absolute coordination packet
256 Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
257 When both fingers are up, the last two reports have zero valid
259 Bit4 => finger up/down information. 1: finger down, 0: finger up.
261 Bit2 => finger index, 0 is the first finger, 1 is the second finger.
262 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
263 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
264 Byte 2: X coordinate (xpos[9:2])
265 Byte 3: Y coordinate (ypos[9:2])
266 Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
267 Bit3~Bit2 => X coordinate (ypos[1:0])
268 Bit4 => scroll down button
269 Bit5 => scroll up button
270 Bit6 => scroll left button
271 Bit7 => scroll right button
273 Notify Packet for STL3888-B0
274 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
275 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
276 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|
277 |---------------| |---------------| |---------------| |---------------|
279 Byte 1: Bit7~Bit6 => 00, Normal data packet
280 => 01, Absolute coordination packet
283 Bit4 => when in absolute coordinate mode (valid when EN_PKT_GO is 1):
284 0: left button is generated by the on-pad command
285 1: left button is generated by the external button
287 Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
288 Bit1 => Right Button, 1 is pressed, 0 is not pressed.
289 Bit0 => Left Button, 1 is pressed, 0 is not pressed.
290 Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
291 Byte 3: Bit7~Bit6 => Don't care
292 Bit5~Bit4 => Number of fingers
293 Bit3~Bit1 => Reserved
294 Bit0 => 1: enter gesture mode; 0: leaving gesture mode
295 Byte 4: Bit7 => scroll right button
296 Bit6 => scroll left button
297 Bit5 => scroll up button
298 Bit4 => scroll down button
299 * Note that if gesture and additional button(Bit4~Bit7)
300 happen at the same time, the button information will not
302 Bit3~Bit0 => Reserved
304 Sample sequence of Multi-finger, Multi-coordinate mode:
306 notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
307 abs pkt 2, ..., notify packet (valid bit == 0)
309 ==============================================================================
310 * FSP Enable/Disable packet
311 ==============================================================================
312 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
313 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
314 1 |Y|X|0|0|1|M|R|L| 2 |0|1|0|1|1|0|1|E| 3 | | | | | | | | | 4 | | | | | | | | |
315 |---------------| |---------------| |---------------| |---------------|
317 FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
318 command. Host will receive the packet which Middle, Right, Left button will
319 be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
320 Ignore the other bytes of the packet.
322 Byte 1: Bit7 => 0, Y overflow
323 Bit6 => 0, X overflow
324 Bit5 => 0, Y sign bit
325 Bit4 => 0, X sign bit
327 Bit2 => 1, Middle Button
328 Bit1 => 1, Right Button
329 Bit0 => 1, Left Button
330 Byte 2: Bit7~1 => (0101101b)
334 Byte 4: Don't care (MOUSE ID 3, 4)
335 Byte 5~8: Don't care (Absolute packet)
337 ==============================================================================
339 ==============================================================================
341 FSP supports basic PS/2 commanding set and modes, refer to following URL for
342 details about PS/2 commands:
344 http://www.computer-engineering.org/index.php?title=PS/2_Mouse_Interface
346 ==============================================================================
347 * Programming Sequence for Determining Packet Parsing Flow
348 ==============================================================================
349 1. Identify FSP by reading device ID(0x00) and version(0x01) register
351 2. Determine number of buttons by reading status2 (0x0b) register
353 buttons = reg[0x0b] & 0x30
355 if buttons == 0x30 or buttons == 0x20:
357 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
358 section A for packet parsing detail(ignore byte 4, bit ~ 7)
359 elif buttons == 0x10:
361 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
362 section B for packet parsing detail
363 elif buttons == 0x00:
365 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
366 section A for packet parsing detail
368 ==============================================================================
369 * Programming Sequence for Register Reading/Writing
370 ==============================================================================
372 Register inversion requirement:
374 Following values needed to be inverted(the '~' operator in C) before being
377 0xe9, 0xee, 0xf2 and 0xff.
379 Register swapping requirement:
381 Following values needed to have their higher 4 bits and lower 4 bits being
382 swapped before being sent to FSP:
384 10, 20, 40, 60, 80, 100 and 200.
386 Register reading sequence:
388 1. send 0xf3 PS/2 command to FSP;
390 2. send 0x66 PS/2 command to FSP;
392 3. send 0x88 PS/2 command to FSP;
394 4. send 0xf3 PS/2 command to FSP;
396 5. if the register address being to read is not required to be
397 inverted(refer to the 'Register inversion requirement' section),
400 5a. send 0x68 PS/2 command to FSP;
402 5b. send the inverted register address to FSP and goto step 8;
404 6. if the register address being to read is not required to be
405 swapped(refer to the 'Register swapping requirement' section),
408 6a. send 0xcc PS/2 command to FSP;
410 6b. send the swapped register address to FSP and goto step 8;
412 7. send 0x66 PS/2 command to FSP;
414 7a. send the original register address to FSP and goto step 8;
416 8. send 0xe9(status request) PS/2 command to FSP;
418 9. the response read from FSP should be the requested register value.
420 Register writing sequence:
422 1. send 0xf3 PS/2 command to FSP;
424 2. if the register address being to write is not required to be
425 inverted(refer to the 'Register inversion requirement' section),
428 2a. send 0x74 PS/2 command to FSP;
430 2b. send the inverted register address to FSP and goto step 5;
432 3. if the register address being to write is not required to be
433 swapped(refer to the 'Register swapping requirement' section),
436 3a. send 0x77 PS/2 command to FSP;
438 3b. send the swapped register address to FSP and goto step 5;
440 4. send 0x55 PS/2 command to FSP;
442 4a. send the register address to FSP and goto step 5;
444 5. send 0xf3 PS/2 command to FSP;
446 6. if the register value being to write is not required to be
447 inverted(refer to the 'Register inversion requirement' section),
450 6a. send 0x47 PS/2 command to FSP;
452 6b. send the inverted register value to FSP and goto step 9;
454 7. if the register value being to write is not required to be
455 swapped(refer to the 'Register swapping requirement' section),
458 7a. send 0x44 PS/2 command to FSP;
460 7b. send the swapped register value to FSP and goto step 9;
462 8. send 0x33 PS/2 command to FSP;
464 8a. send the register value to FSP;
466 9. the register writing sequence is completed.
468 ==============================================================================
470 ==============================================================================
472 offset width default r/w name
473 0x00 bit7~bit0 0x01 RO device ID
475 0x01 bit7~bit0 0xc0 RW version ID
477 0x02 bit7~bit0 0x01 RO vendor ID
479 0x03 bit7~bit0 0x01 RO product ID
481 0x04 bit3~bit0 0x01 RW revision ID
483 0x0b RO test mode status 1
484 bit3 1 RO 0: rotate 180 degree, 1: no rotation
486 bit5~bit4 RO number of buttons
488 10 => 4, lbtn/rbtn/scru/scrd
489 01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr
490 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
492 0x0f RW register file page control
493 bit0 0 RW 1 to enable page 1 register files
495 0x10 RW system control 1
496 bit0 1 RW Reserved, must be 1
497 bit1 0 RW Reserved, must be 0
498 bit4 1 RW Reserved, must be 0
499 bit5 0 RW register clock gating enable
500 0: read only, 1: read/write enable
501 (Note that following registers does not require clock gating being
502 enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
503 40 41 42 43. In addition to that, this bit must be 1 when gesture
506 0x31 RW on-pad command detection
507 bit7 0 RW on-pad command left button down tag
509 0: disable, 1: enable
511 0x34 RW on-pad command control 5
512 bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5
513 (Note that position unit is in 0.5 scanline)
515 bit7 0 RW on-pad tap zone enable
516 0: disable, 1: enable
518 0x35 RW on-pad command control 6
519 bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5
520 (Note that position unit is in 0.5 scanline)
522 0x36 RW on-pad command control 7
523 bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5
524 (Note that position unit is in 0.5 scanline)
526 0x37 RW on-pad command control 8
527 bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5
528 (Note that position unit is in 0.5 scanline)
530 0x40 RW system control 5
531 bit1 0 RW FSP Intellimouse mode enable
532 0: disable, 1: enable
534 bit2 0 RW movement + abs. coordinate mode enable
535 0: disable, 1: enable
536 (Note that this function has the functionality of bit 1 even when
537 bit 1 is not set. However, the format is different from that of bit 1.
538 In addition, when bit 1 and bit 2 are set at the same time, bit 2 will
541 bit3 0 RW abs. coordinate only mode enable
542 0: disable, 1: enable
543 (Note that this function has the functionality of bit 1 even when
544 bit 1 is not set. However, the format is different from that of bit 1.
545 In addition, when bit 1, bit 2 and bit 3 are set at the same time,
546 bit 3 will override bit 1 and 2.)
548 bit5 0 RW auto switch enable
549 0: disable, 1: enable
551 bit6 0 RW G0 abs. + notify packet format enable
552 0: disable, 1: enable
553 (Note that the absolute/relative coordinate output still depends on
554 bit 2 and 3. That is, if any of those bit is 1, host will receive
555 absolute coordinates; otherwise, host only receives packets with
556 relative coordinate.)
558 bit7 0 RW EN_PS2_F2: PS/2 gesture mode 2nd
560 0: disable, 1: enable
562 0x43 RW on-pad control
563 bit0 0 RW on-pad control enable
564 0: disable, 1: enable
565 (Note that if this bit is cleared, bit 3/5 will be ineffective)
567 bit3 0 RW on-pad fix vertical scrolling enable
568 0: disable, 1: enable
570 bit5 0 RW on-pad fix horizontal scrolling enable
571 0: disable, 1: enable