15. Sentelic 觸控板

版權所有:

© 2002-2011 Sentelic Corporation。

最後更新:

2011 年 12 月 07 日

15.1. 指感應板 Intellimouse 模式(滾動輪,第 4 和第 5 個按鈕)

  1. MSID 4:滾動輪模式加上前進頁面(第 4 個按鈕)和後退頁面(第 5 個按鈕)

  1. 將取樣率設定為 200;

  2. 將取樣率設定為 200;

  3. 將取樣率設定為 80;

  4. 發出“獲取裝置 ID”命令 (0xF2) 並等待響應;

  5. FSP 將響應 0x04。

Packet 1
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7 => Y overflow
        Bit6 => X overflow
        Bit5 => Y sign bit
        Bit4 => X sign bit
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X Movement(9-bit 2's complement integers)
Byte 3: Y Movement(9-bit 2's complement integers)
Byte 4: Bit3~Bit0 => the scrolling wheel's movement since the last data report.
                    valid values, -8 ~ +7
        Bit4 => 1 = 4th mouse button is pressed, Forward one page.
                0 = 4th mouse button is not pressed.
        Bit5 => 1 = 5th mouse button is pressed, Backward one page.
                0 = 5th mouse button is not pressed.
  1. MSID 6:水平和垂直滾動

  • 將暫存器 0x40 中的位 1 設定為 1

FSP 將滾動輪的移動替換為 4 位以顯示水平和垂直滾動。

Packet 1
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7 => Y overflow
        Bit6 => X overflow
        Bit5 => Y sign bit
        Bit4 => X sign bit
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X Movement(9-bit 2's complement integers)
Byte 3: Y Movement(9-bit 2's complement integers)
Byte 4: Bit0 => the Vertical scrolling movement downward.
        Bit1 => the Vertical scrolling movement upward.
        Bit2 => the Horizontal scrolling movement leftward.
        Bit3 => the Horizontal scrolling movement rightward.
        Bit4 => 1 = 4th mouse button is pressed, Forward one page.
                0 = 4th mouse button is not pressed.
        Bit5 => 1 = 5th mouse button is pressed, Backward one page.
                0 = 5th mouse button is not pressed.
  1. MSID 7

FSP 使用 2 個數據包(8 位元組)來表示絕對位置。 因此,我們有資料包編號來識別資料包。

如果資料包編號為 0,則資料包為資料包 1。 如果資料包編號為 1,則資料包為資料包 2。 請在程式中計算此數字。

啟用 MSID 7 時,將同時啟用 MSID6 特殊資料包。

15.2. STL3886-G0 的絕對位置

  1. 將暫存器 0x40 中的位 2 或 3 設定為 1

  2. 將暫存器 0x40 中的位 6 設定為 1

Packet 1 (ABSOLUTE POSITION)
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordination packet
                => 10, Notify packet
        Bit5 => valid bit
        Bit4 => 1
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit4 => scroll up
        Bit5 => scroll down
        Bit6 => scroll left
        Bit7 => scroll right

Notify Packet for G0
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordination packet
                => 10, Notify packet
        Bit5 => 0
        Bit4 => 1
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: Message Type => 0x5A (Enable/Disable status packet)
        Mode Type => 0xA5 (Normal/Icon mode status)
Byte 3: Message Type => 0x00 (Disabled)
                    => 0x01 (Enabled)
        Mode Type    => 0x00 (Normal)
                    => 0x01 (Icon)
Byte 4: Bit7~Bit0 => Don't Care

15.3. STL3888-Ax 的絕對位置

Packet 1 (ABSOLUTE POSITION)
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordination packet
                => 10, Notify packet
                => 11, Normal data packet with on-pad click
        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
                When both fingers are up, the last two reports have zero valid
                bit.
        Bit4 => arc
        Bit3 => 1
        Bit2 => Left Button, 1 is pressed, 0 is released.
        Bit1 => 0
        Bit0 => 1
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit5~Bit4 => y1_g
        Bit7~Bit6 => x1_g

Packet 2 (ABSOLUTE POSITION)
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordinates packet
                => 10, Notify packet
                => 11, Normal data packet with on-pad click
        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
                When both fingers are up, the last two reports have zero valid
                bit.
        Bit4 => arc
        Bit3 => 1
        Bit2 => Right Button, 1 is pressed, 0 is released.
        Bit1 => 1
        Bit0 => 0
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit5~Bit4 => y2_g
        Bit7~Bit6 => x2_g

Notify Packet for STL3888-Ax
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordinates packet
                => 10, Notify packet
                => 11, Normal data packet with on-pad click
        Bit5 => 1
        Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
                0: left button is generated by the on-pad command
                1: left button is generated by the external button
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
Byte 3: Bit7~Bit6 => Don't care
        Bit5~Bit4 => Number of fingers
        Bit3~Bit1 => Reserved
        Bit0 => 1: enter gesture mode; 0: leaving gesture mode
Byte 4: Bit7 => scroll right button
        Bit6 => scroll left button
        Bit5 => scroll down button
        Bit4 => scroll up button
            * Note that if gesture and additional button (Bit4~Bit7)
            happen at the same time, the button information will not
            be sent.
        Bit3~Bit0 => Reserved

多指、多座標模式的取樣序列

通知資料包(有效位 == 1),abs pkt 1,abs pkt 2,abs pkt 1,abs pkt 2,...,通知資料包(有效位 == 0)

15.4. STL3888-B0 的絕對位置

Packet 1(ABSOLUTE POSITION)
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordinates packet
                => 10, Notify packet
                => 11, Normal data packet with on-pad click
        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
                When both fingers are up, the last two reports have zero valid
                bit.
        Bit4 => finger up/down information. 1: finger down, 0: finger up.
        Bit3 => 1
        Bit2 => finger index, 0 is the first finger, 1 is the second finger.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit4 => scroll down button
        Bit5 => scroll up button
        Bit6 => scroll left button
        Bit7 => scroll right button

Packet 2 (ABSOLUTE POSITION)
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordination packet
                => 10, Notify packet
                => 11, Normal data packet with on-pad click
        Bit5 => Valid bit, 0 means that the coordinate is invalid or finger up.
                When both fingers are up, the last two reports have zero valid
                bit.
        Bit4 => finger up/down information. 1: finger down, 0: finger up.
        Bit3 => 1
        Bit2 => finger index, 0 is the first finger, 1 is the second finger.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit4 => scroll down button
        Bit5 => scroll up button
        Bit6 => scroll left button
        Bit7 => scroll right button

STL3888-B0 的通知資料包

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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordination packet
                => 10, Notify packet
                => 11, Normal data packet with on-pad click
        Bit5 => 1
        Bit4 => when in absolute coordinates mode (valid when EN_PKT_GO is 1):
                0: left button is generated by the on-pad command
                1: left button is generated by the external button
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: Message Type => 0xB7 (Multi Finger, Multi Coordinate mode)
Byte 3: Bit7~Bit6 => Don't care
        Bit5~Bit4 => Number of fingers
        Bit3~Bit1 => Reserved
        Bit0 => 1: enter gesture mode; 0: leaving gesture mode
Byte 4: Bit7 => scroll right button
        Bit6 => scroll left button
        Bit5 => scroll up button
        Bit4 => scroll down button
            * Note that if gesture and additional button(Bit4~Bit7)
            happen at the same time, the button information will not
            be sent.
        Bit3~Bit0 => Reserved

多指、多座標模式的取樣序列

通知資料包(有效位 == 1),abs pkt 1,abs pkt 2,abs pkt 1,abs pkt 2,...,通知資料包(有效位 == 0)

15.5. STL3888-Cx 和 STL3888-Dx 的絕對位置

Single Finger, Absolute Coordinate Mode (SFAC)
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordinates packet
                => 10, Notify packet
        Bit5 => Coordinate mode(always 0 in SFAC mode):
                0: single-finger absolute coordinates (SFAC) mode
                1: multi-finger, multiple coordinates (MFMC) mode
        Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
                1: The LEFT button is generated by external button
                Default is 1 even if the LEFT button is not pressed.
        Bit3 => Always 1, as specified by PS/2 protocol.
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit4 => 4th mouse button(forward one page)
        Bit5 => 5th mouse button(backward one page)
        Bit6 => scroll left button
        Bit7 => scroll right button

Multi Finger, Multiple Coordinates Mode (MFMC):
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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordination packet
                => 10, Notify packet
        Bit5 => Coordinate mode (always 1 in MFMC mode):
                0: single-finger absolute coordinates (SFAC) mode
                1: multi-finger, multiple coordinates (MFMC) mode
        Bit4 => 0: The LEFT button is generated by on-pad command (OPC)
                1: The LEFT button is generated by external button
                Default is 1 even if the LEFT button is not pressed.
        Bit3 => Always 1, as specified by PS/2 protocol.
        Bit2 => Finger index, 0 is the first finger, 1 is the second finger.
                If bit 1 and 0 are all 1 and bit 4 is 0, the middle external
                button is pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: X coordinate (xpos[9:2])
Byte 3: Y coordinate (ypos[9:2])
Byte 4: Bit1~Bit0 => Y coordinate (xpos[1:0])
        Bit3~Bit2 => X coordinate (ypos[1:0])
        Bit4 => 4th mouse button(forward one page)
        Bit5 => 5th mouse button(backward one page)
        Bit6 => scroll left button
        Bit7 => scroll right button

當兩個手指中的一個抬起時,裝置將輸出四個連續的 MFMC#0 報告資料包,X 和 Y 為零,表示第一個手指抬起,或者輸出四個連續的 MFMC#1 報告資料包,X 和 Y 為零,表示第二個手指抬起。 另一方面,如果兩個手指都抬起,裝置將輸出四個連續的單指絕對座標 (SFAC) 資料包,X 和 Y 為零。

STL3888-Cx/Dx 的通知資料包

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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  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|
      |---------------|     |---------------|    |---------------|    |---------------|

Byte 1: Bit7~Bit6 => 00, Normal data packet
                => 01, Absolute coordinates packet
                => 10, Notify packet
        Bit5 => Always 0
        Bit4 => 0: The LEFT button is generated by on-pad command(OPC)
                1: The LEFT button is generated by external button
                Default is 1 even if the LEFT button is not pressed.
        Bit3 => 1
        Bit2 => Middle Button, 1 is pressed, 0 is not pressed.
        Bit1 => Right Button, 1 is pressed, 0 is not pressed.
        Bit0 => Left Button, 1 is pressed, 0 is not pressed.
Byte 2: Message type:
        0xba => gesture information
        0xc0 => one finger hold-rotating gesture
Byte 3: The first parameter for the received message:
        0xba => gesture ID (refer to the 'Gesture ID' section)
        0xc0 => region ID
Byte 4: The second parameter for the received message:
        0xba => N/A
        0xc0 => finger up/down information

多指、多座標模式的取樣序列

通知資料包(有效位 == 1),MFMC 資料包 1(位元組 1,位 2 == 0),MFMC 資料包 2(位元組 1,位 2 == 1),MFMC 資料包 1,MFMC 資料包 2,...,通知資料包(有效位 == 0)

也就是說,當裝置處於 MFMC 模式時,主機將接收到每個手指的交錯絕對座標資料包。

15.6. FSP 啟用/停用資料包

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
BYTE  |---------------|BYTE |---------------|BYTE|---------------|BYTE|---------------|
  1   |Y|X|0|0|1|M|R|L|  2  |0|1|0|1|1|0|1|E|  3 | | | | | | | | |  4 | | | | | | | | |
      |---------------|     |---------------|    |---------------|    |---------------|

FSP will send out enable/disable packet when FSP receive PS/2 enable/disable
command. Host will receive the packet which Middle, Right, Left button will
be set. The packet only use byte 0 and byte 1 as a pattern of original packet.
Ignore the other bytes of the packet.

Byte 1: Bit7 => 0, Y overflow
        Bit6 => 0, X overflow
        Bit5 => 0, Y sign bit
        Bit4 => 0, X sign bit
        Bit3 => 1
        Bit2 => 1, Middle Button
        Bit1 => 1, Right Button
        Bit0 => 1, Left Button
Byte 2: Bit7~1 => (0101101b)
        Bit0 => 1 = Enable
                0 = Disable
Byte 3: Don't care
Byte 4: Don't care (MOUSE ID 3, 4)
Byte 5~8: Don't care (Absolute packet)

15.7. PS/2 命令集

FSP 支援基本的 PS/2 命令集和模式,有關 PS/2 命令的詳細資訊,請參閱以下 URL

http://www.computer-engineering.org/ps2mouse/

15.8. 用於確定資料包解析流程的程式設計序列

  1. 透過讀取裝置 ID(0x00) 和版本(0x01) 暫存器來識別 FSP

  2. 對於 FSP 版本 < STL3888 Cx,透過讀取“測試模式狀態”(0x20) 暫存器來確定按鈕數量

    buttons = reg[0x20] & 0x30
    
    if buttons == 0x30 or buttons == 0x20:
            # two/four buttons
            Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
            section A for packet parsing detail(ignore byte 4, bit ~ 7)
    elif buttons == 0x10:
            # 6 buttons
            Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
            section B for packet parsing detail
    elif buttons == 0x00:
            # 6 buttons
            Refer to 'Finger Sensing Pad PS/2 Mouse Intellimouse'
            section A for packet parsing detail
    
  3. 對於 FSP 版本 >= STL3888 Cx

    有關資料包解析的詳細資訊,請參閱“指感應板 PS/2 滑鼠 Intellimouse”部分 A(忽略位元組 4,位 ~ 7)

15.9. 用於暫存器讀取/寫入的程式設計序列

暫存器反轉要求

以下值在傳送到 FSP 之前需要反轉(C 中的“~”運算子)

0xe8, 0xe9, 0xee, 0xf2, 0xf3 and 0xff.

暫存器交換要求

以下值需要將其高 4 位和低 4 位在傳送到 FSP 之前進行交換

10, 20, 40, 60, 80, 100 and 200.

暫存器讀取序列

  1. 向 FSP 傳送 0xf3 PS/2 命令;

  2. 向 FSP 傳送 0x66 PS/2 命令;

  3. 向 FSP 傳送 0x88 PS/2 命令;

  4. 向 FSP 傳送 0xf3 PS/2 命令;

5. 如果要讀取的暫存器地址不需要反轉(請參閱“暫存器反轉要求”部分),請轉到步驟 6

  1. 向 FSP 傳送 0x68 PS/2 命令;

  2. 將反轉的暫存器地址傳送到 FSP,然後轉到步驟 8;

6. 如果要讀取的暫存器地址不需要交換(請參閱“暫存器交換要求”部分),請轉到步驟 7

  1. 向 FSP 傳送 0xcc PS/2 命令;

  2. 將交換的暫存器地址傳送到 FSP,然後轉到步驟 8;

  1. 向 FSP 傳送 0x66 PS/2 命令;

  1. 將原始暫存器地址傳送到 FSP,然後轉到步驟 8;

  1. 向 FSP 傳送 0xe9(狀態請求)PS/2 命令;

9. 從 FSP 讀取的響應的第 4 個位元組應該是請求的暫存器值(?? 表示不關心位元組)

host: 0xe9
3888: 0xfa (??) (??) (val)
  • 請注意,自 Cx 版本以來,硬體將在狀態請求結果的第 3 個位元組處返回暫存器值的 1 的補碼

    host: 0xe9
    3888: 0xfa (??) (~val) (val)
    

暫存器寫入序列

  1. 向 FSP 傳送 0xf3 PS/2 命令;

2. 如果要寫入的暫存器地址不需要反轉(請參閱“暫存器反轉要求”部分),請轉到步驟 3

  1. 向 FSP 傳送 0x74 PS/2 命令;

  2. 將反轉的暫存器地址傳送到 FSP,然後轉到步驟 5;

3. 如果要寫入的暫存器地址不需要交換(請參閱“暫存器交換要求”部分),請轉到步驟 4

  1. 向 FSP 傳送 0x77 PS/2 命令;

  2. 將交換的暫存器地址傳送到 FSP,然後轉到步驟 5;

  1. 向 FSP 傳送 0x55 PS/2 命令;

  1. 將暫存器地址傳送到 FSP,然後轉到步驟 5;

  1. 向 FSP 傳送 0xf3 PS/2 命令;

6. 如果要寫入的暫存器值不需要反轉(請參閱“暫存器反轉要求”部分),請轉到步驟 7

  1. 向 FSP 傳送 0x47 PS/2 命令;

  2. 將反轉的暫存器值傳送到 FSP,然後轉到步驟 9;

7. 如果要寫入的暫存器值不需要交換(請參閱“暫存器交換要求”部分),請轉到步驟 8

  1. 向 FSP 傳送 0x44 PS/2 命令;

  2. 將交換的暫存器值傳送到 FSP,然後轉到步驟 9;

  1. 向 FSP 傳送 0x33 PS/2 命令;

  1. 將暫存器值傳送到 FSP;

  1. 暫存器寫入序列完成。

  • 自 Cx 版本以來,硬體將在狀態請求結果的第 3 個位元組處返回暫存器值的 1 的補碼。 主機可以選擇在暫存器寫入結束時向 FSP 傳送另一個 0xe9(狀態請求)PS/2 命令,以驗證暫存器寫入操作是否成功(?? 表示不關心位元組)

    host: 0xe9
    3888: 0xfa (??) (~val) (val)
    

15.10. 用於頁面暫存器讀取/寫入的程式設計序列

為了克服支援的最大暫存器數量的限制,硬體將暫存器分成不同的組,稱為“頁面”。 每個頁面最多可以包含 255 個暫存器。

上電後的預設頁面是 0x82;因此,如果必須訪問暫存器 0x8301,則必須使用以下序列切換到頁面 0x83,然後使用上一節中描述的暫存器讀/寫序列從/向偏移量 0x01 開始讀取/寫入。

頁面暫存器讀取序列

  1. 向 FSP 傳送 0xf3 PS/2 命令;

  2. 向 FSP 傳送 0x66 PS/2 命令;

  3. 向 FSP 傳送 0x88 PS/2 命令;

  4. 向 FSP 傳送 0xf3 PS/2 命令;

  5. 向 FSP 傳送 0x83 PS/2 命令;

  6. 向 FSP 傳送 0x88 PS/2 命令;

  7. 向 FSP 傳送 0xe9(狀態請求)PS/2 命令;

  8. 從 FSP 讀取的響應應該是請求的頁面值。

頁面暫存器寫入序列

  1. 向 FSP 傳送 0xf3 PS/2 命令;

  2. 向 FSP 傳送 0x38 PS/2 命令;

  3. 向 FSP 傳送 0x88 PS/2 命令;

  4. 向 FSP 傳送 0xf3 PS/2 命令;

5. 如果要寫入的頁面地址不需要反轉(請參閱“暫存器反轉要求”部分),請轉到步驟 6

  1. 向 FSP 傳送 0x47 PS/2 命令;

  2. 將反轉的頁面地址傳送到 FSP,然後轉到步驟 9;

6. 如果要寫入的頁面地址不需要交換(請參閱“暫存器交換要求”部分),請轉到步驟 7

  1. 向 FSP 傳送 0x44 PS/2 命令;

  2. 將交換的頁面地址傳送到 FSP,然後轉到步驟 9;

  1. 向 FSP 傳送 0x33 PS/2 命令;

  2. 將頁面地址傳送到 FSP;

  3. 頁面暫存器寫入序列完成。

15.11. 手勢 ID

與其他將多個手指的座標傳送到主機的裝置不同,FSP 在內部處理多個手指的座標並將它們轉換為 8 位整數,即“手勢 ID”。 以下是支援的手勢 ID 列表

ID

描述

0x86

2 指向上

0x82

2 指向下

0x80

2 指向右

0x84

2 指向左

0x8f

2 指放大

0x8b

2 指縮小

0xc0

2 指曲線,逆時針

0xc4

2 指曲線,順時針

0x2e

3 指向上

0x2a

3 指向下

0x28

3 指向右

0x2c

3 指向左

0x38

手掌

15.12. 暫存器列表

暫存器以 16 位值表示。 高 8 位表示頁面地址,低 8 位表示該特定頁面內的相對偏移量。 有關如何更改當前頁面地址的說明,請參閱“用於頁面暫存器讀取/寫入的程式設計序列”部分

offset width           default r/w     name
0x8200 bit7~bit0       0x01    RO      device ID

0x8201 bit7~bit0               RW      version ID
                                       0xc1: STL3888 Ax
                                       0xd0 ~ 0xd2: STL3888 Bx
                                       0xe0 ~ 0xe1: STL3888 Cx
                                       0xe2 ~ 0xe3: STL3888 Dx

0x8202 bit7~bit0       0x01    RO      vendor ID

0x8203 bit7~bit0       0x01    RO      product ID

0x8204 bit3~bit0       0x01    RW      revision ID

0x820b                                 test mode status 1
       bit3            1       RO      0: rotate 180 degree
                                       1: no rotation
                                       *only supported by H/W prior to Cx

0x820f                                 register file page control
       bit2            0       RW      1: rotate 180 degree
                                       0: no rotation
                                       *supported since Cx

       bit0            0       RW      1 to enable page 1 register files
                                       *only supported by H/W prior to Cx

0x8210                         RW      system control 1
       bit0            1       RW      Reserved, must be 1
       bit1            0       RW      Reserved, must be 0
       bit4            0       RW      Reserved, must be 0
       bit5            1       RW      register clock gating enable
                                       0: read only, 1: read/write enable
       (Note that following registers does not require clock gating being
       enabled prior to write: 05 06 07 08 09 0c 0f 10 11 12 16 17 18 23 2e
       40 41 42 43.  In addition to that, this bit must be 1 when gesture
       mode is enabled)

0x8220                                 test mode status
       bit5~bit4               RO      number of buttons
                                       11 => 2, lbtn/rbtn
                                       10 => 4, lbtn/rbtn/scru/scrd
                                       01 => 6, lbtn/rbtn/scru/scrd/scrl/scrr
                                       00 => 6, lbtn/rbtn/scru/scrd/fbtn/bbtn
                                       *only supported by H/W prior to Cx

0x8231                         RW      on-pad command detection
       bit7            0       RW      on-pad command left button down tag
                                       enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

0x8234                         RW      on-pad command control 5
       bit4~bit0       0x05    RW      XLO in 0s/4/1, so 03h = 0010.1b = 2.5
       (Note that position unit is in 0.5 scanline)
                                       *only supported by H/W prior to Cx

       bit7            0       RW      on-pad tap zone enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

0x8235                         RW      on-pad command control 6
       bit4~bit0       0x1d    RW      XHI in 0s/4/1, so 19h = 1100.1b = 12.5
       (Note that position unit is in 0.5 scanline)
                                       *only supported by H/W prior to Cx

0x8236                         RW      on-pad command control 7
       bit4~bit0       0x04    RW      YLO in 0s/4/1, so 03h = 0010.1b = 2.5
       (Note that position unit is in 0.5 scanline)
                                       *only supported by H/W prior to Cx

0x8237                         RW      on-pad command control 8
       bit4~bit0       0x13    RW      YHI in 0s/4/1, so 11h = 1000.1b = 8.5
       (Note that position unit is in 0.5 scanline)
                                       *only supported by H/W prior to Cx

0x8240                         RW      system control 5
       bit1            0       RW      FSP Intellimouse mode enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

       bit2            0       RW      movement + abs. coordinate mode enable
                                       0: disable, 1: enable
       (Note that this function has the functionality of bit 1 even when
       bit 1 is not set. However, the format is different from that of bit 1.
       In addition, when bit 1 and bit 2 are set at the same time, bit 2 will
       override bit 1.)
                                       *only supported by H/W prior to Cx

       bit3            0       RW      abs. coordinate only mode enable
                                       0: disable, 1: enable
       (Note that this function has the functionality of bit 1 even when
       bit 1 is not set. However, the format is different from that of bit 1.
       In addition, when bit 1, bit 2 and bit 3 are set at the same time,
       bit 3 will override bit 1 and 2.)
                                       *only supported by H/W prior to Cx

       bit5            0       RW      auto switch enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

       bit6            0       RW      G0 abs. + notify packet format enable
                                       0: disable, 1: enable
       (Note that the absolute/relative coordinate output still depends on
       bit 2 and 3.  That is, if any of those bit is 1, host will receive
       absolute coordinates; otherwise, host only receives packets with
       relative coordinate.)
                                       *only supported by H/W prior to Cx

       bit7            0       RW      EN_PS2_F2: PS/2 gesture mode 2nd
                                       finger packet enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

0x8243                         RW      on-pad control
       bit0            0       RW      on-pad control enable
                                       0: disable, 1: enable
       (Note that if this bit is cleared, bit 3/5 will be ineffective)
                                       *only supported by H/W prior to Cx

       bit3            0       RW      on-pad fix vertical scrolling enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

       bit5            0       RW      on-pad fix horizontal scrolling enable
                                       0: disable, 1: enable
                                       *only supported by H/W prior to Cx

0x8290                         RW      software control register 1
       bit0            0       RW      absolute coordination mode
                                       0: disable, 1: enable
                                       *supported since Cx

       bit1            0       RW      gesture ID output
                                       0: disable, 1: enable
                                       *supported since Cx

       bit2            0       RW      two fingers' coordinates output
                                       0: disable, 1: enable
                                       *supported since Cx

       bit3            0       RW      finger up one packet output
                                       0: disable, 1: enable
                                       *supported since Cx

       bit4            0       RW      absolute coordination continuous mode
                                       0: disable, 1: enable
                                       *supported since Cx

       bit6~bit5       00      RW      gesture group selection
                                       00: basic
                                       01: suite
                                       10: suite pro
                                       11: advanced
                                       *supported since Cx

       bit7            0       RW      Bx packet output compatible mode
                                       0: disable, 1: enable
                                       *supported since Cx
                                       *supported since Cx


0x833d                         RW      on-pad command control 1
       bit7            1       RW      on-pad command detection enable
                                       0: disable, 1: enable
                                       *supported since Cx

0x833e                         RW      on-pad command detection
       bit7            0       RW      on-pad command left button down tag
                                       enable. Works only in H/W based PS/2
                                       data packet mode.
                                       0: disable, 1: enable
                                       *supported since Cx