Back to home page

OSCL-LXR

 
 

    


0001 .. include:: <isonum.txt>
0002 
0003 =================
0004 Sentelic Touchpad
0005 =================
0006 
0007 
0008 :Copyright: |copy| 2002-2011 Sentelic Corporation.
0009 
0010 :Last update: Dec-07-2011
0011 
0012 Finger Sensing Pad Intellimouse Mode (scrolling wheel, 4th and 5th buttons)
0013 ============================================================================
0014 
0015 A) MSID 4: Scrolling wheel mode plus Forward page(4th button) and Backward
0016    page (5th button)
0017 
0018 1. Set sample rate to 200;
0019 2. Set sample rate to 200;
0020 3. Set sample rate to 80;
0021 4. Issuing the "Get device ID" command (0xF2) and waits for the response;
0022 5. FSP will respond 0x04.
0023 
0024 ::
0025 
0026     Packet 1
0027     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
0028     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0029       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|
0030           |---------------|     |---------------|    |---------------|    |---------------|
0031 
0032     Byte 1: Bit7 => Y overflow
0033             Bit6 => X overflow
0034             Bit5 => Y sign bit
0035             Bit4 => X sign bit
0036             Bit3 => 1
0037             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0038             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0039             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0040     Byte 2: X Movement(9-bit 2's complement integers)
0041     Byte 3: Y Movement(9-bit 2's complement integers)
0042     Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report.
0043                         valid values, -8 ~ +7
0044             Bit4 => 1 = 4th mouse button is pressed, Forward one page.
0045                     0 = 4th mouse button is not pressed.
0046             Bit5 => 1 = 5th mouse button is pressed, Backward one page.
0047                     0 = 5th mouse button is not pressed.
0048 
0049 B) MSID 6: Horizontal and Vertical scrolling
0050 
0051 - Set bit 1 in register 0x40 to 1
0052 
0053 FSP replaces scrolling wheel's movement as 4 bits to show horizontal and
0054 vertical scrolling.
0055 
0056 ::
0057 
0058     Packet 1
0059     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
0060     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0061       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|
0062           |---------------|     |---------------|    |---------------|    |---------------|
0063 
0064     Byte 1: Bit7 => Y overflow
0065             Bit6 => X overflow
0066             Bit5 => Y sign bit
0067             Bit4 => X sign bit
0068             Bit3 => 1
0069             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0070             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0071             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0072     Byte 2: X Movement(9-bit 2's complement integers)
0073     Byte 3: Y Movement(9-bit 2's complement integers)
0074     Byte 4: Bit0 => the Vertical scrolling movement downward.
0075             Bit1 => the Vertical scrolling movement upward.
0076             Bit2 => the Horizontal scrolling movement leftward.
0077             Bit3 => the Horizontal scrolling movement rightward.
0078             Bit4 => 1 = 4th mouse button is pressed, Forward one page.
0079                     0 = 4th mouse button is not pressed.
0080             Bit5 => 1 = 5th mouse button is pressed, Backward one page.
0081                     0 = 5th mouse button is not pressed.
0082 
0083 C) MSID 7
0084 
0085 FSP uses 2 packets (8 Bytes) to represent Absolute Position.
0086 so we have PACKET NUMBER to identify packets.
0087 
0088   If PACKET NUMBER is 0, the packet is Packet 1.
0089   If PACKET NUMBER is 1, the packet is Packet 2.
0090   Please count this number in program.
0091 
0092 MSID6 special packet will be enable at the same time when enable MSID 7.
0093 
0094 Absolute position for STL3886-G0
0095 ================================
0096 
0097 1. Set bit 2 or 3 in register 0x40 to 1
0098 2. Set bit 6 in register 0x40 to 1
0099 
0100 ::
0101 
0102     Packet 1 (ABSOLUTE POSITION)
0103     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
0104     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0105       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|
0106           |---------------|     |---------------|    |---------------|    |---------------|
0107 
0108     Byte 1: Bit7~Bit6 => 00, Normal data packet
0109                     => 01, Absolute coordination packet
0110                     => 10, Notify packet
0111             Bit5 => valid bit
0112             Bit4 => 1
0113             Bit3 => 1
0114             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0115             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0116             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0117     Byte 2: X coordinate (xpos[9:2])
0118     Byte 3: Y coordinate (ypos[9:2])
0119     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0120             Bit3~Bit2 => X coordinate (ypos[1:0])
0121             Bit4 => scroll up
0122             Bit5 => scroll down
0123             Bit6 => scroll left
0124             Bit7 => scroll right
0125 
0126     Notify Packet for G0
0127     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
0128     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0129       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|
0130           |---------------|     |---------------|    |---------------|    |---------------|
0131 
0132     Byte 1: Bit7~Bit6 => 00, Normal data packet
0133                     => 01, Absolute coordination packet
0134                     => 10, Notify packet
0135             Bit5 => 0
0136             Bit4 => 1
0137             Bit3 => 1
0138             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0139             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0140             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0141     Byte 2: Message Type => 0x5A (Enable/Disable status packet)
0142             Mode Type => 0xA5 (Normal/Icon mode status)
0143     Byte 3: Message Type => 0x00 (Disabled)
0144                         => 0x01 (Enabled)
0145             Mode Type    => 0x00 (Normal)
0146                         => 0x01 (Icon)
0147     Byte 4: Bit7~Bit0 => Don't Care
0148 
0149 Absolute position for STL3888-Ax
0150 ================================
0151 
0152 ::
0153 
0154     Packet 1 (ABSOLUTE POSITION)
0155     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
0156     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0157       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|
0158           |---------------|     |---------------|    |---------------|    |---------------|
0159 
0160     Byte 1: Bit7~Bit6 => 00, Normal data packet
0161                     => 01, Absolute coordination packet
0162                     => 10, Notify packet
0163                     => 11, Normal data packet with on-pad click
0164             Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
0165                     When both fingers are up, the last two reports have zero valid
0166                     bit.
0167             Bit4 => arc
0168             Bit3 => 1
0169             Bit2 => Left Button, 1 is pressed, 0 is released.
0170             Bit1 => 0
0171             Bit0 => 1
0172     Byte 2: X coordinate (xpos[9:2])
0173     Byte 3: Y coordinate (ypos[9:2])
0174     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0175             Bit3~Bit2 => X coordinate (ypos[1:0])
0176             Bit5~Bit4 => y1_g
0177             Bit7~Bit6 => x1_g
0178 
0179     Packet 2 (ABSOLUTE POSITION)
0180     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
0181     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0182       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|
0183           |---------------|     |---------------|    |---------------|    |---------------|
0184 
0185     Byte 1: Bit7~Bit6 => 00, Normal data packet
0186                     => 01, Absolute coordinates packet
0187                     => 10, Notify packet
0188                     => 11, Normal data packet with on-pad click
0189             Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
0190                     When both fingers are up, the last two reports have zero valid
0191                     bit.
0192             Bit4 => arc
0193             Bit3 => 1
0194             Bit2 => Right Button, 1 is pressed, 0 is released.
0195             Bit1 => 1
0196             Bit0 => 0
0197     Byte 2: X coordinate (xpos[9:2])
0198     Byte 3: Y coordinate (ypos[9:2])
0199     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0200             Bit3~Bit2 => X coordinate (ypos[1:0])
0201             Bit5~Bit4 => y2_g
0202             Bit7~Bit6 => x2_g
0203 
0204     Notify Packet for STL3888-Ax
0205     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
0206     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0207       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|
0208           |---------------|     |---------------|    |---------------|    |---------------|
0209 
0210     Byte 1: Bit7~Bit6 => 00, Normal data packet
0211                     => 01, Absolute coordinates packet
0212                     => 10, Notify packet
0213                     => 11, Normal data packet with on-pad click
0214             Bit5 => 1
0215             Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
0216                     0: left button is generated by the on-pad command
0217                     1: left button is generated by the external button
0218             Bit3 => 1
0219             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0220             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0221             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0222     Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
0223     Byte 3: Bit7~Bit6 => Don't care
0224             Bit5~Bit4 => Number of fingers
0225             Bit3~Bit1 => Reserved
0226             Bit0 => 1: enter gesture mode; 0: leaving gesture mode
0227     Byte 4: Bit7 => scroll right button
0228             Bit6 => scroll left button
0229             Bit5 => scroll down button
0230             Bit4 => scroll up button
0231                 * Note that if gesture and additional button (Bit4~Bit7)
0232                 happen at the same time, the button information will not
0233                 be sent.
0234             Bit3~Bit0 => Reserved
0235 
0236 Sample sequence of Multi-finger, Multi-coordinate mode:
0237 
0238         notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
0239         abs pkt 2, ..., notify packet (valid bit == 0)
0240 
0241 Absolute position for STL3888-B0
0242 ================================
0243 
0244 ::
0245 
0246     Packet 1(ABSOLUTE POSITION)
0247     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
0248     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0249       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|
0250           |---------------|     |---------------|    |---------------|    |---------------|
0251 
0252     Byte 1: Bit7~Bit6 => 00, Normal data packet
0253                     => 01, Absolute coordinates packet
0254                     => 10, Notify packet
0255                     => 11, Normal data packet with on-pad click
0256             Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
0257                     When both fingers are up, the last two reports have zero valid
0258                     bit.
0259             Bit4 => finger up/down information. 1: finger down, 0: finger up.
0260             Bit3 => 1
0261             Bit2 => finger index, 0 is the first finger, 1 is the second finger.
0262             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0263             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0264     Byte 2: X coordinate (xpos[9:2])
0265     Byte 3: Y coordinate (ypos[9:2])
0266     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0267             Bit3~Bit2 => X coordinate (ypos[1:0])
0268             Bit4 => scroll down button
0269             Bit5 => scroll up button
0270             Bit6 => scroll left button
0271             Bit7 => scroll right button
0272 
0273     Packet 2 (ABSOLUTE POSITION)
0274     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
0275     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0276       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|
0277           |---------------|     |---------------|    |---------------|    |---------------|
0278 
0279     Byte 1: Bit7~Bit6 => 00, Normal data packet
0280                     => 01, Absolute coordination packet
0281                     => 10, Notify packet
0282                     => 11, Normal data packet with on-pad click
0283             Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
0284                     When both fingers are up, the last two reports have zero valid
0285                     bit.
0286             Bit4 => finger up/down information. 1: finger down, 0: finger up.
0287             Bit3 => 1
0288             Bit2 => finger index, 0 is the first finger, 1 is the second finger.
0289             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0290             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0291     Byte 2: X coordinate (xpos[9:2])
0292     Byte 3: Y coordinate (ypos[9:2])
0293     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0294             Bit3~Bit2 => X coordinate (ypos[1:0])
0295             Bit4 => scroll down button
0296             Bit5 => scroll up button
0297             Bit6 => scroll left button
0298             Bit7 => scroll right button
0299 
0300 Notify Packet for STL3888-B0::
0301 
0302     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
0303     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0304       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|
0305           |---------------|     |---------------|    |---------------|    |---------------|
0306 
0307     Byte 1: Bit7~Bit6 => 00, Normal data packet
0308                     => 01, Absolute coordination packet
0309                     => 10, Notify packet
0310                     => 11, Normal data packet with on-pad click
0311             Bit5 => 1
0312             Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
0313                     0: left button is generated by the on-pad command
0314                     1: left button is generated by the external button
0315             Bit3 => 1
0316             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0317             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0318             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0319     Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
0320     Byte 3: Bit7~Bit6 => Don't care
0321             Bit5~Bit4 => Number of fingers
0322             Bit3~Bit1 => Reserved
0323             Bit0 => 1: enter gesture mode; 0: leaving gesture mode
0324     Byte 4: Bit7 => scroll right button
0325             Bit6 => scroll left button
0326             Bit5 => scroll up button
0327             Bit4 => scroll down button
0328                 * Note that if gesture and additional button(Bit4~Bit7)
0329                 happen at the same time, the button information will not
0330                 be sent.
0331             Bit3~Bit0 => Reserved
0332 
0333 Sample sequence of Multi-finger, Multi-coordinate mode:
0334 
0335         notify packet (valid bit == 1), abs pkt 1, abs pkt 2, abs pkt 1,
0336         abs pkt 2, ..., notify packet (valid bit == 0)
0337 
0338 Absolute position for STL3888-Cx and STL3888-Dx
0339 ===============================================
0340 
0341 ::
0342 
0343     Single Finger, Absolute Coordinate Mode (SFAC)
0344     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
0345     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0346       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|
0347           |---------------|     |---------------|    |---------------|    |---------------|
0348 
0349     Byte 1: Bit7~Bit6 => 00, Normal data packet
0350                     => 01, Absolute coordinates packet
0351                     => 10, Notify packet
0352             Bit5 => Coordinate mode(always 0 in SFAC mode):
0353                     0: single-finger absolute coordinates (SFAC) mode
0354                     1: multi-finger, multiple coordinates (MFMC) mode
0355             Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
0356                     1: The LEFT button is generated by external button
0357                     Default is 1 even if the LEFT button is not pressed.
0358             Bit3 => Always 1, as specified by PS/2 protocol.
0359             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0360             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0361             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0362     Byte 2: X coordinate (xpos[9:2])
0363     Byte 3: Y coordinate (ypos[9:2])
0364     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0365             Bit3~Bit2 => X coordinate (ypos[1:0])
0366             Bit4 => 4th mouse button(forward one page)
0367             Bit5 => 5th mouse button(backward one page)
0368             Bit6 => scroll left button
0369             Bit7 => scroll right button
0370 
0371     Multi Finger, Multiple Coordinates Mode (MFMC):
0372     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
0373     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0374       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|
0375           |---------------|     |---------------|    |---------------|    |---------------|
0376 
0377     Byte 1: Bit7~Bit6 => 00, Normal data packet
0378                     => 01, Absolute coordination packet
0379                     => 10, Notify packet
0380             Bit5 => Coordinate mode (always 1 in MFMC mode):
0381                     0: single-finger absolute coordinates (SFAC) mode
0382                     1: multi-finger, multiple coordinates (MFMC) mode
0383             Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
0384                     1: The LEFT button is generated by external button
0385                     Default is 1 even if the LEFT button is not pressed.
0386             Bit3 => Always 1, as specified by PS/2 protocol.
0387             Bit2 => Finger index, 0 is the first finger, 1 is the second finger.
0388                     If bit 1 and 0 are all 1 and bit 4 is 0, the middle external
0389                     button is pressed.
0390             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0391             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0392     Byte 2: X coordinate (xpos[9:2])
0393     Byte 3: Y coordinate (ypos[9:2])
0394     Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
0395             Bit3~Bit2 => X coordinate (ypos[1:0])
0396             Bit4 => 4th mouse button(forward one page)
0397             Bit5 => 5th mouse button(backward one page)
0398             Bit6 => scroll left button
0399             Bit7 => scroll right button
0400 
0401 When one of the two fingers is up, the device will output four consecutive
0402 MFMC#0 report packets with zero X and Y to represent 1st finger is up or
0403 four consecutive MFMC#1 report packets with zero X and Y to represent that
0404 the 2nd finger is up.  On the other hand, if both fingers are up, the device
0405 will output four consecutive single-finger, absolute coordinate(SFAC) packets
0406 with zero X and Y.
0407 
0408 Notify Packet for STL3888-Cx/Dx::
0409 
0410     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
0411     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0412       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|
0413           |---------------|     |---------------|    |---------------|    |---------------|
0414 
0415     Byte 1: Bit7~Bit6 => 00, Normal data packet
0416                     => 01, Absolute coordinates packet
0417                     => 10, Notify packet
0418             Bit5 => Always 0
0419             Bit4 => 0: The LEFT button is generated by on-pad command(OPC)
0420                     1: The LEFT button is generated by external button
0421                     Default is 1 even if the LEFT button is not pressed.
0422             Bit3 => 1
0423             Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
0424             Bit1 => Right Button, 1 is pressed, 0 is not pressed.
0425             Bit0 => Left Button, 1 is pressed, 0 is not pressed.
0426     Byte 2: Message type:
0427             0xba => gesture information
0428             0xc0 => one finger hold-rotating gesture
0429     Byte 3: The first parameter for the received message:
0430             0xba => gesture ID (refer to the 'Gesture ID' section)
0431             0xc0 => region ID
0432     Byte 4: The second parameter for the received message:
0433             0xba => N/A
0434             0xc0 => finger up/down information
0435 
0436 Sample sequence of Multi-finger, Multi-coordinates mode:
0437 
0438         notify packet (valid bit == 1), MFMC packet 1 (byte 1, bit 2 == 0),
0439         MFMC packet 2 (byte 1, bit 2 == 1), MFMC packet 1, MFMC packet 2,
0440         ..., notify packet (valid bit == 0)
0441 
0442         That is, when the device is in MFMC mode, the host will receive
0443         interleaved absolute coordinate packets for each finger.
0444 
0445 FSP Enable/Disable packet
0446 =========================
0447 
0448 ::
0449 
0450     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
0451     BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
0452       1   |Y|X|0|0|1|M|R|L|  2  |0|1|0|1|1|0|1|E|  3 | | | | | | | | |  4 | | | | | | | | |
0453           |---------------|     |---------------|    |---------------|    |---------------|
0454 
0455     FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
0456     command. Host will receive the packet which Middle, Right, Left button will
0457     be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
0458     Ignore the other bytes of the packet.
0459 
0460     Byte 1: Bit7 => 0, Y overflow
0461             Bit6 => 0, X overflow
0462             Bit5 => 0, Y sign bit
0463             Bit4 => 0, X sign bit
0464             Bit3 => 1
0465             Bit2 => 1, Middle Button
0466             Bit1 => 1, Right Button
0467             Bit0 => 1, Left Button
0468     Byte 2: Bit7~1 => (0101101b)
0469             Bit0 => 1 = Enable
0470                     0 = Disable
0471     Byte 3: Don't care
0472     Byte 4: Don't care (MOUSE ID 3, 4)
0473     Byte 5~8: Don't care (Absolute packet)
0474 
0475 PS/2 Command Set
0476 ================
0477 
0478 FSP supports basic PS/2 commanding set and modes, refer to following URL for
0479 details about PS/2 commands:
0480 
0481 http://www.computer-engineering.org/ps2mouse/
0482 
0483 Programming Sequence for Determining Packet Parsing Flow
0484 ========================================================
0485 
0486 1. Identify FSP by reading device ID(0x00) and version(0x01) register
0487 
0488 2. For FSP version < STL3888 Cx, determine number of buttons by reading
0489    the 'test mode status' (0x20) register::
0490 
0491         buttons = reg[0x20] & 0x30
0492 
0493         if buttons == 0x30 or buttons == 0x20:
0494                 # two/four buttons
0495                 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
0496                 section A for packet parsing detail(ignore byte 4, bit ~ 7)
0497         elif buttons == 0x10:
0498                 # 6 buttons
0499                 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
0500                 section B for packet parsing detail
0501         elif buttons == 0x00:
0502                 # 6 buttons
0503                 Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
0504                 section A for packet parsing detail
0505 
0506 3. For FSP version >= STL3888 Cx:
0507         Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
0508         section A for packet parsing detail (ignore byte 4, bit ~ 7)
0509 
0510 Programming Sequence for Register Reading/Writing
0511 =================================================
0512 
0513 Register inversion requirement:
0514 
0515 Following values needed to be inverted(the '~' operator in C) before being
0516 sent to FSP::
0517 
0518         0xe8, 0xe9, 0xee, 0xf2, 0xf3 and 0xff.
0519 
0520 Register swapping requirement:
0521 
0522 Following values needed to have their higher 4 bits and lower 4 bits being
0523 swapped before being sent to FSP::
0524 
0525         10, 20, 40, 60, 80, 100 and 200.
0526 
0527 Register reading sequence:
0528 
0529         1. send 0xf3 PS/2 command to FSP;
0530 
0531         2. send 0x66 PS/2 command to FSP;
0532 
0533         3. send 0x88 PS/2 command to FSP;
0534 
0535         4. send 0xf3 PS/2 command to FSP;
0536 
0537         5. if the register address being to read is not required to be
0538         inverted(refer to the 'Register inversion requirement' section),
0539         goto step 6
0540 
0541           a. send 0x68 PS/2 command to FSP;
0542 
0543           b. send the inverted register address to FSP and goto step 8;
0544 
0545         6. if the register address being to read is not required to be
0546         swapped(refer to the 'Register swapping requirement' section),
0547         goto step 7
0548 
0549           a. send 0xcc PS/2 command to FSP;
0550 
0551           b. send the swapped register address to FSP and goto step 8;
0552 
0553         7. send 0x66 PS/2 command to FSP;
0554 
0555           a. send the original register address to FSP and goto step 8;
0556 
0557         8. send 0xe9(status request) PS/2 command to FSP;
0558 
0559         9. the 4th byte of the response read from FSP should be the
0560         requested register value(?? indicates don't care byte)::
0561 
0562                 host: 0xe9
0563                 3888: 0xfa (??) (??) (val)
0564 
0565         * Note that since the Cx release, the hardware will return 1's
0566           complement of the register value at the 3rd byte of status request
0567           result::
0568 
0569                 host: 0xe9
0570                 3888: 0xfa (??) (~val) (val)
0571 
0572 Register writing sequence:
0573 
0574         1. send 0xf3 PS/2 command to FSP;
0575 
0576         2. if the register address being to write is not required to be
0577         inverted(refer to the 'Register inversion requirement' section),
0578         goto step 3
0579 
0580           a. send 0x74 PS/2 command to FSP;
0581 
0582           b. send the inverted register address to FSP and goto step 5;
0583 
0584         3. if the register address being to write is not required to be
0585         swapped(refer to the 'Register swapping requirement' section),
0586         goto step 4
0587 
0588           a. send 0x77 PS/2 command to FSP;
0589 
0590           b. send the swapped register address to FSP and goto step 5;
0591 
0592         4. send 0x55 PS/2 command to FSP;
0593 
0594           a. send the register address to FSP and goto step 5;
0595 
0596         5. send 0xf3 PS/2 command to FSP;
0597 
0598         6. if the register value being to write is not required to be
0599         inverted(refer to the 'Register inversion requirement' section),
0600         goto step 7
0601 
0602           a. send 0x47 PS/2 command to FSP;
0603 
0604           b. send the inverted register value to FSP and goto step 9;
0605 
0606         7. if the register value being to write is not required to be
0607         swapped(refer to the 'Register swapping requirement' section),
0608         goto step 8
0609 
0610           a. send 0x44 PS/2 command to FSP;
0611 
0612           b. send the swapped register value to FSP and goto step 9;
0613 
0614         8. send 0x33 PS/2 command to FSP;
0615 
0616           a. send the register value to FSP;
0617 
0618         9. the register writing sequence is completed.
0619 
0620         * Since the Cx release, the hardware will return 1's
0621           complement of the register value at the 3rd byte of status request
0622           result. Host can optionally send another 0xe9 (status request) PS/2
0623           command to FSP at the end of register writing to verify that the
0624           register writing operation is successful (?? indicates don't care
0625           byte)::
0626 
0627                 host: 0xe9
0628                 3888: 0xfa (??) (~val) (val)
0629 
0630 Programming Sequence for Page Register Reading/Writing
0631 ======================================================
0632 
0633 In order to overcome the limitation of maximum number of registers
0634 supported, the hardware separates register into different groups called
0635 'pages.' Each page is able to include up to 255 registers.
0636 
0637 The default page after power up is 0x82; therefore, if one has to get
0638 access to register 0x8301, one has to use following sequence to switch
0639 to page 0x83, then start reading/writing from/to offset 0x01 by using
0640 the register read/write sequence described in previous section.
0641 
0642 Page register reading sequence:
0643 
0644         1. send 0xf3 PS/2 command to FSP;
0645 
0646         2. send 0x66 PS/2 command to FSP;
0647 
0648         3. send 0x88 PS/2 command to FSP;
0649 
0650         4. send 0xf3 PS/2 command to FSP;
0651 
0652         5. send 0x83 PS/2 command to FSP;
0653 
0654         6. send 0x88 PS/2 command to FSP;
0655 
0656         7. send 0xe9(status request) PS/2 command to FSP;
0657 
0658         8. the response read from FSP should be the requested page value.
0659 
0660 
0661 Page register writing sequence:
0662 
0663         1. send 0xf3 PS/2 command to FSP;
0664 
0665         2. send 0x38 PS/2 command to FSP;
0666 
0667         3. send 0x88 PS/2 command to FSP;
0668 
0669         4. send 0xf3 PS/2 command to FSP;
0670 
0671         5. if the page address being written is not required to be
0672         inverted(refer to the 'Register inversion requirement' section),
0673         goto step 6
0674 
0675           a. send 0x47 PS/2 command to FSP;
0676 
0677           b. send the inverted page address to FSP and goto step 9;
0678 
0679         6. if the page address being written is not required to be
0680         swapped(refer to the 'Register swapping requirement' section),
0681         goto step 7
0682 
0683           a. send 0x44 PS/2 command to FSP;
0684 
0685           b. send the swapped page address to FSP and goto step 9;
0686 
0687         7. send 0x33 PS/2 command to FSP;
0688 
0689         8. send the page address to FSP;
0690 
0691         9. the page register writing sequence is completed.
0692 
0693 Gesture ID
0694 ==========
0695 
0696 Unlike other devices which sends multiple fingers' coordinates to host,
0697 FSP processes multiple fingers' coordinates internally and convert them
0698 into a 8 bits integer, namely 'Gesture ID.'  Following is a list of
0699 supported gesture IDs:
0700 
0701         ======= ==================================
0702         ID      Description
0703         ======= ==================================
0704         0x86    2 finger straight up
0705         0x82    2 finger straight down
0706         0x80    2 finger straight right
0707         0x84    2 finger straight left
0708         0x8f    2 finger zoom in
0709         0x8b    2 finger zoom out
0710         0xc0    2 finger curve, counter clockwise
0711         0xc4    2 finger curve, clockwise
0712         0x2e    3 finger straight up
0713         0x2a    3 finger straight down
0714         0x28    3 finger straight right
0715         0x2c    3 finger straight left
0716         0x38    palm
0717         ======= ==================================
0718 
0719 Register Listing
0720 ================
0721 
0722 Registers are represented in 16 bits values. The higher 8 bits represent
0723 the page address and the lower 8 bits represent the relative offset within
0724 that particular page.  Refer to the 'Programming Sequence for Page Register
0725 Reading/Writing' section for instructions on how to change current page
0726 address::
0727 
0728  offset width           default r/w     name
0729  0x8200 bit7~bit0       0x01    RO      device ID
0730 
0731  0x8201 bit7~bit0               RW      version ID
0732                                         0xc1: STL3888 Ax
0733                                         0xd0 ~ 0xd2: STL3888 Bx
0734                                         0xe0 ~ 0xe1: STL3888 Cx
0735                                         0xe2 ~ 0xe3: STL3888 Dx
0736 
0737  0x8202 bit7~bit0       0x01    RO      vendor ID
0738 
0739  0x8203 bit7~bit0       0x01    RO      product ID
0740 
0741  0x8204 bit3~bit0       0x01    RW      revision ID
0742 
0743  0x820b                                 test mode status 1
0744         bit3            1       RO      0: rotate 180 degree
0745                                         1: no rotation
0746                                         *only supported by H/W prior to Cx
0747 
0748  0x820f                                 register file page control
0749         bit2            0       RW      1: rotate 180 degree
0750                                         0: no rotation
0751                                         *supported since Cx
0752 
0753         bit0            0       RW      1 to enable page 1 register files
0754                                         *only supported by H/W prior to Cx
0755 
0756  0x8210                         RW      system control 1
0757         bit0            1       RW      Reserved, must be 1
0758         bit1            0       RW      Reserved, must be 0
0759         bit4            0       RW      Reserved, must be 0
0760         bit5            1       RW      register clock gating enable
0761                                         0: read only, 1: read/write enable
0762         (Note that following registers does not require clock gating being
0763         enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
0764         40 41 42 43.  In addition to that, this bit must be 1 when gesture
0765         mode is enabled)
0766 
0767  0x8220                                 test mode status
0768         bit5~bit4               RO      number of buttons
0769                                         11 => 2, lbtn/rbtn
0770                                         10 => 4, lbtn/rbtn/scru/scrd
0771                                         01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr
0772                                         00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
0773                                         *only supported by H/W prior to Cx
0774 
0775  0x8231                         RW      on-pad command detection
0776         bit7            0       RW      on-pad command left button down tag
0777                                         enable
0778                                         0: disable, 1: enable
0779                                         *only supported by H/W prior to Cx
0780 
0781  0x8234                         RW      on-pad command control 5
0782         bit4~bit0       0x05    RW      XLO in 0s/4/1, so 03h = 0010.1b = 2.5
0783         (Note that position unit is in 0.5 scanline)
0784                                         *only supported by H/W prior to Cx
0785 
0786         bit7            0       RW      on-pad tap zone enable
0787                                         0: disable, 1: enable
0788                                         *only supported by H/W prior to Cx
0789 
0790  0x8235                         RW      on-pad command control 6
0791         bit4~bit0       0x1d    RW      XHI in 0s/4/1, so 19h = 1100.1b = 12.5
0792         (Note that position unit is in 0.5 scanline)
0793                                         *only supported by H/W prior to Cx
0794 
0795  0x8236                         RW      on-pad command control 7
0796         bit4~bit0       0x04    RW      YLO in 0s/4/1, so 03h = 0010.1b = 2.5
0797         (Note that position unit is in 0.5 scanline)
0798                                         *only supported by H/W prior to Cx
0799 
0800  0x8237                         RW      on-pad command control 8
0801         bit4~bit0       0x13    RW      YHI in 0s/4/1, so 11h = 1000.1b = 8.5
0802         (Note that position unit is in 0.5 scanline)
0803                                         *only supported by H/W prior to Cx
0804 
0805  0x8240                         RW      system control 5
0806         bit1            0       RW      FSP Intellimouse mode enable
0807                                         0: disable, 1: enable
0808                                         *only supported by H/W prior to Cx
0809 
0810         bit2            0       RW      movement + abs. coordinate mode enable
0811                                         0: disable, 1: enable
0812         (Note that this function has the functionality of bit 1 even when
0813         bit 1 is not set. However, the format is different from that of bit 1.
0814         In addition, when bit 1 and bit 2 are set at the same time, bit 2 will
0815         override bit 1.)
0816                                         *only supported by H/W prior to Cx
0817 
0818         bit3            0       RW      abs. coordinate only mode enable
0819                                         0: disable, 1: enable
0820         (Note that this function has the functionality of bit 1 even when
0821         bit 1 is not set. However, the format is different from that of bit 1.
0822         In addition, when bit 1, bit 2 and bit 3 are set at the same time,
0823         bit 3 will override bit 1 and 2.)
0824                                         *only supported by H/W prior to Cx
0825 
0826         bit5            0       RW      auto switch enable
0827                                         0: disable, 1: enable
0828                                         *only supported by H/W prior to Cx
0829 
0830         bit6            0       RW      G0 abs. + notify packet format enable
0831                                         0: disable, 1: enable
0832         (Note that the absolute/relative coordinate output still depends on
0833         bit 2 and 3.  That is, if any of those bit is 1, host will receive
0834         absolute coordinates; otherwise, host only receives packets with
0835         relative coordinate.)
0836                                         *only supported by H/W prior to Cx
0837 
0838         bit7            0       RW      EN_PS2_F2: PS/2 gesture mode 2nd
0839                                         finger packet enable
0840                                         0: disable, 1: enable
0841                                         *only supported by H/W prior to Cx
0842 
0843  0x8243                         RW      on-pad control
0844         bit0            0       RW      on-pad control enable
0845                                         0: disable, 1: enable
0846         (Note that if this bit is cleared, bit 3/5 will be ineffective)
0847                                         *only supported by H/W prior to Cx
0848 
0849         bit3            0       RW      on-pad fix vertical scrolling enable
0850                                         0: disable, 1: enable
0851                                         *only supported by H/W prior to Cx
0852 
0853         bit5            0       RW      on-pad fix horizontal scrolling enable
0854                                         0: disable, 1: enable
0855                                         *only supported by H/W prior to Cx
0856 
0857  0x8290                         RW      software control register 1
0858         bit0            0       RW      absolute coordination mode
0859                                         0: disable, 1: enable
0860                                         *supported since Cx
0861 
0862         bit1            0       RW      gesture ID output
0863                                         0: disable, 1: enable
0864                                         *supported since Cx
0865 
0866         bit2            0       RW      two fingers' coordinates output
0867                                         0: disable, 1: enable
0868                                         *supported since Cx
0869 
0870         bit3            0       RW      finger up one packet output
0871                                         0: disable, 1: enable
0872                                         *supported since Cx
0873 
0874         bit4            0       RW      absolute coordination continuous mode
0875                                         0: disable, 1: enable
0876                                         *supported since Cx
0877 
0878         bit6~bit5       00      RW      gesture group selection
0879                                         00: basic
0880                                         01: suite
0881                                         10: suite pro
0882                                         11: advanced
0883                                         *supported since Cx
0884 
0885         bit7            0       RW      Bx packet output compatible mode
0886                                         0: disable, 1: enable
0887                                         *supported since Cx
0888                                         *supported since Cx
0889 
0890 
0891  0x833d                         RW      on-pad command control 1
0892         bit7            1       RW      on-pad command detection enable
0893                                         0: disable, 1: enable
0894                                         *supported since Cx
0895 
0896  0x833e                         RW      on-pad command detection
0897         bit7            0       RW      on-pad command left button down tag
0898                                         enable. Works only in H/W based PS/2
0899                                         data packet mode.
0900                                         0: disable, 1: enable
0901                                         *supported since Cx