1 Copyright (C) 2002-2008 Sentelic Corporation.
2 Last update: Oct-31-2008
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|l|r|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 Vertical scrolling movement rightward.
63 Bit3 => the Vertical scrolling movement leftward.
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) data 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-A0.
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-A0
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 coordination 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 button (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 * FSP Enable/Disable packet
220 ==============================================================================
221 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
222 BYTE |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
223 1 |Y|X|0|0|1|M|R|L| 2 |0|1|0|1|1|0|1|E| 3 | | | | | | | | | 4 | | | | | | | | |
224 |---------------| |---------------| |---------------| |---------------|
226 FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
227 command. Host will receive the packet which Middle, Right, Left button will
228 be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
229 Ignore the other bytes of the packet.
231 Byte 1: Bit7 => 0, Y overflow
232 Bit6 => 0, X overflow
233 Bit5 => 0, Y sign bit
234 Bit4 => 0, X sign bit
236 Bit2 => 1, Middle Button
237 Bit1 => 1, Right Button
238 Bit0 => 1, Left Button
239 Byte 2: Bit7~1 => (0101101b)
243 Byte 4: Don't care (MOUSE ID 3, 4)
244 Byte 5~8: Don't care (Absolute packet)
246 ==============================================================================
248 ==============================================================================
250 FSP supports basic PS/2 commanding set and modes, refer to following URL for
251 details about PS/2 commands:
253 http://www.computer-engineering.org/index.php?title=PS/2_Mouse_Interface
255 ==============================================================================
256 * Programming Sequence for Determining Packet Parsing Flow
257 ==============================================================================
258 1. Identify FSP by reading device ID(0x00) and version(0x01) register
260 2. Determine number of buttons by reading status2 (0x0b) register
262 buttons = reg[0x0b] & 0x30
264 if buttons == 0x30 or buttons == 0x20:
266 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
267 section A for packet parsing detail(ignore byte 4, bit ~ 7)
268 elif buttons == 0x10:
270 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
271 section B for packet parsing detail
272 elif buttons == 0x00:
274 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
275 section A for packet parsing detail
277 ==============================================================================
278 * Programming Sequence for Register Reading/Writing
279 ==============================================================================
281 Register inversion requirement:
283 Following values needed to be inverted(the '~' operator in C) before being
286 0xe9, 0xee, 0xf2 and 0xff.
288 Register swapping requirement:
290 Following values needed to have their higher 4 bits and lower 4 bits being
291 swapped before being sent to FSP:
293 10, 20, 40, 60, 80, 100 and 200.
295 Register reading sequence:
297 1. send 0xf3 PS/2 command to FSP;
299 2. send 0x66 PS/2 command to FSP;
301 3. send 0x88 PS/2 command to FSP;
303 4. send 0xf3 PS/2 command to FSP;
305 5. if the register address being to read is not required to be
306 inverted(refer to the 'Register inversion requirement' section),
309 5a. send 0x68 PS/2 command to FSP;
311 5b. send the inverted register address to FSP and goto step 8;
313 6. if the register address being to read is not required to be
314 swapped(refer to the 'Register swapping requirement' section),
317 6a. send 0xcc PS/2 command to FSP;
319 6b. send the swapped register address to FSP and goto step 8;
321 7. send 0x66 PS/2 command to FSP;
323 7a. send the original register address to FSP and goto step 8;
325 8. send 0xe9(status request) PS/2 command to FSP;
327 9. the response read from FSP should be the requested register value.
329 Register writing sequence:
331 1. send 0xf3 PS/2 command to FSP;
333 2. if the register address being to write is not required to be
334 inverted(refer to the 'Register inversion requirement' section),
337 2a. send 0x74 PS/2 command to FSP;
339 2b. send the inverted register address to FSP and goto step 5;
341 3. if the register address being to write is not required to be
342 swapped(refer to the 'Register swapping requirement' section),
345 3a. send 0x77 PS/2 command to FSP;
347 3b. send the swapped register address to FSP and goto step 5;
349 4. send 0x55 PS/2 command to FSP;
351 4a. send the register address to FSP and goto step 5;
353 5. send 0xf3 PS/2 command to FSP;
355 6. if the register value being to write is not required to be
356 inverted(refer to the 'Register inversion requirement' section),
359 6a. send 0x47 PS/2 command to FSP;
361 6b. send the inverted register value to FSP and goto step 9;
363 7. if the register value being to write is not required to be
364 swapped(refer to the 'Register swapping requirement' section),
367 7a. send 0x44 PS/2 command to FSP;
369 7b. send the swapped register value to FSP and goto step 9;
371 8. send 0x33 PS/2 command to FSP;
373 8a. send the register value to FSP;
375 9. the register writing sequence is completed.
377 ==============================================================================
379 ==============================================================================
381 offset width default r/w name
382 0x00 bit7~bit0 0x01 RO device ID
384 0x01 bit7~bit0 0xc0 RW version ID
386 0x02 bit7~bit0 0x01 RO vendor ID
388 0x03 bit7~bit0 0x01 RO product ID
390 0x04 bit3~bit0 0x01 RW revision ID
392 0x0b RO test mode status 1
393 bit3 1 RO 0: rotate 180 degree, 1: no rotation
395 bit5~bit4 RO number of buttons
397 10 => 4, lbtn/rbtn/scru/scrd
398 01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr
399 00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
401 0x0f RW register file page control
402 bit0 0 RW 1 to enable page 1 register files
404 0x10 RW system control 1
405 bit0 1 RW Reserved, must be 1
406 bit1 0 RW Reserved, must be 0
407 bit4 1 RW Reserved, must be 0
408 bit5 0 RW register clock gating enable
409 0: read only, 1: read/write enable
410 (Note that following registers does not require clock gating being
411 enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
414 0x31 RW on-pad command detection
415 bit7 0 RW on-pad command left button down tag
417 0: disable, 1: enable
419 0x34 RW on-pad command control 5
420 bit4~bit0 0x05 RW XLO in 0s/4/1, so 03h = 0010.1b = 2.5
421 (Note that position unit is in 0.5 scanline)
423 bit7 0 RW on-pad tap zone enable
424 0: disable, 1: enable
426 0x35 RW on-pad command control 6
427 bit4~bit0 0x1d RW XHI in 0s/4/1, so 19h = 1100.1b = 12.5
428 (Note that position unit is in 0.5 scanline)
430 0x36 RW on-pad command control 7
431 bit4~bit0 0x04 RW YLO in 0s/4/1, so 03h = 0010.1b = 2.5
432 (Note that position unit is in 0.5 scanline)
434 0x37 RW on-pad command control 8
435 bit4~bit0 0x13 RW YHI in 0s/4/1, so 11h = 1000.1b = 8.5
436 (Note that position unit is in 0.5 scanline)
438 0x40 RW system control 5
439 bit1 0 RW FSP Intellimouse mode enable
440 0: disable, 1: enable
442 bit2 0 RW movement + abs. coordinate mode enable
443 0: disable, 1: enable
444 (Note that this function has the functionality of bit 1 even when
445 bit 1 is not set. However, the format is different from that of bit 1.
446 In addition, when bit 1 and bit 2 are set at the same time, bit 2 will
449 bit3 0 RW abs. coordinate only mode enable
450 0: disable, 1: enable
451 (Note that this function has the functionality of bit 1 even when
452 bit 1 is not set. However, the format is different from that of bit 1.
453 In addition, when bit 1, bit 2 and bit 3 are set at the same time,
454 bit 3 will override bit 1 and 2.)
456 bit5 0 RW auto switch enable
457 0: disable, 1: enable
459 bit6 0 RW G0 abs. + notify packet format enable
460 0: disable, 1: enable
461 (Note that the absolute/relative coordinate output still depends on
462 bit 2 and 3. That is, if any of those bit is 1, host will receive
463 absolute coordinates; otherwise, host only receives packets with
464 relative coordinate.)
466 0x43 RW on-pad control
467 bit0 0 RW on-pad control enable
468 0: disable, 1: enable
469 (Note that if this bit is cleared, bit 3/5 will be ineffective)
471 bit3 0 RW on-pad fix vertical scrolling enable
472 0: disable, 1: enable
474 bit5 0 RW on-pad fix horizontal scrolling enable
475 0: disable, 1: enable