你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

USB鼠标例程改成模拟触摸屏报点枚举中出现stall pid错误

[复制链接]
lijiatu 发布时间:2020-11-8 17:36
请教各位大佬,我最近使用F405芯片,用stm32CubeMX默认创建了一个USBHID的例程,这个例程默认就是一个HID模拟鼠标移动的程序,我创建之后也是可以正常枚举并且鼠标正常移动的,说明生成的工程是没有问题的,然后我把报告描述符修改成了一个多点触摸的描述符,这个描述符是以前项目使用的,是没有问题的。变量也没有改变,只是把报告描述符的内容替换了,如下图:
! H- ?0 D, b$ o$ F# s 1.png
* \. }9 x3 @' E5 y这个报告描述符字节比较大,又474个字节,然后我又把相应的配置描述符修改了,如下图所示:! {! {0 C! B( S% v( g* q

# Q' i( e4 n; z把配置描述符集合里HID描述符中描述报告描述符大小的字节改成我们修改后的大小,如下图
5 @2 T. |' _  G1 F) u# P 3.png
2 c; \" j* q2 w: g: X, k# r  Q+ Q( D
按道理,将这些修改之后,就相当于重新约定了HID上报数据的协议,随后,我又按照新规定的报告描述符的协议模拟上报触控点的数据。2 B' q) w5 o* w2 K+ K
通过Bus hound显示枚举是成功的,也一直在按照报告描述符规定的协议向主机发送数据,但是没有模拟触控的现象,我使用以前的工程是有明显
" j9 d1 `' A& h$ }2 P5 Q4 v4 U  u8 i的触控屏幕的现象的。通过设备管理器查看设备是正常运行的,然后用Bus hound观察枚举过程,发现一直在上报数据,但是在枚举过程中在主机
' L4 m4 ]5 n% Y, T发送GET_REPORT之后出现了USTS c0000004   stall pid 错误,出现之后枚举也没有停止,而是正常运行的,数据也是正常上报的,& d: G1 U& U( f5 w/ I4 j3 p
但就是没有现象,我感觉是主机没有接收到报告描述符,或者接收错误了,导致虽然数据是正常上报的,但是系统不知道上报的数据的含义,. T( {. ]" n2 g' w: L2 Z
有没有大佬懂得这方面的错误,还请指导一下,工程其他地方都没有动,就是修改了配置、报告描述符等信息。4 R8 m  g1 e2 i
4.png ' U, l6 r8 w: N) E" c

' ?% E( D) z# R 5.png
: p/ M/ {6 O, |4 }0 A
- F7 U9 Q- G  Q5 B
2.png
收藏 1 评论1 发布时间:2020-11-8 17:36

举报

1个回答
45454554 回答时间:2020-12-28 17:10:00
__ALIGN_BEGIN static uint8_t Entity3Desc[] __ALIGN_END =1 w" T* N4 ~! M5 u* \/ @  C/ G
{% P; u9 J+ G" ]6 a
//Below is the report descriptor for an example multi-touch device, which can support " w0 W' I$ X3 K0 Y! S# G
//up to 5 simultaneous contacts.  This report descriptor also supports multiple device modes.
4 v. v6 K, l% ~) g) @% [//The OS may select the device mode (ex: mouse, single-touch digitizer, multi-touch digitizer)3 _+ m' r" X  E( ?2 T! i
//by sending a SET_REPORT (feature) control transfer.  In each mode, the device firmware
$ `" v2 T4 J1 A//should behave differently and send input packets on the HID IN endpoint, formatted( L$ T2 T+ n3 L9 o+ q4 R; ^
//based on the report descriptor collections associated with that mode.
. {* q* D$ {, @9 `' L& S" o* T, K3 }1 o( N' {* ]( X0 a9 ^3 U
//Each IN packet (HID report) sent to the host (in multi-touch digitizer mode) is ?? bytes long (Bytes 0-13).  & z# a' o; `1 m- E0 b2 z
//The data is sent in little endian format.  To send the report to the host, verify   s2 W: U$ V( [; f& n
//that the HID IN endpoint buffer is not already busy, then place the data in the HID ) }) S" x. t5 u6 P! {$ M' a/ A
//IN endpoint buffer SRAM, and then call the UsbSendEP5Report() function.  The data will 9 s% r! Z! I4 {/ Q* O8 e
//then get sent to the host, at the next opportunity when the host polls that endpoint
' k0 s. c6 {, N//(by sending an IN token packet to the endpoint).! n- C  h9 ~1 b: b% f
! `. I/ U9 S% d) z
//NOTE (Contact identifier number): For a multi-touch device, the firmware needs to
2 ^' T2 H0 e; W% j7 N//keep track of each contact point separately and independantly.  For example, suppose
( g! w. E! T; ~$ A$ U+ T- p8 R# t* S//a human first presses one finger to the screen.  The firmware would detect this, and 1 a* P/ P; C7 m. z% A1 W: q
//it should arbitrarily assign a contact identifier number for this contact. Typically
8 j; v5 `: Q: v0 z' c//it would be assigned something like contact ID = "1". As the human moves their finger
+ f6 M1 t4 L( ?( V% V8 u0 C//around on the contact surface the firmware will report new X and Y coordinate
: B3 Q5 n$ P! U9 W//information for this contact, but the contact ID byte should always be = "1" for
# i  B" O* v. o2 a2 C; T; k) `//this contact.
4 b; V/ y0 r5 R4 b( E- A! Y  N. ?//7 O) {+ H6 F$ F  P/ J
//Now suppose the human places a second finger onto the touch surface, so there are 2 W# J& o2 X( ]
//two simultanous contacts.  The firmware should assign this second contact a new   ?  E# q! L2 z9 h) G) p- \
//contact ID, for instance, contact ID = "2".  So long as the first contact is still
" m1 M9 T7 N0 A7 [8 s//valid, the firmware needs to continue reporting ID = "1" for the first contact.  ' I) \! z- q- `( M, N/ I3 y7 ]! D0 _
//The firmware will continue to report information using these contact ID numbers % _8 x; I9 g+ b; T
//until such time as a contact becomes invalid (human removes their finger from the
+ L6 h( C$ j& Z6 Z5 z//screen).
" Q) Z, Z8 N7 ]8 |: F8 p- v  f$ l( Q7 H! W9 @; S: r5 `2 C
- q+ d1 D& u9 Q  h/ D: y3 D& m
    //Top level collection for use in Multi-Touch Digitizer device mode.
% n" O$ Y5 P1 U" q' n( [; v5 W, h    //-------------------------------------------------------------------: P5 c/ T6 i1 v- U9 M0 k" _5 p
    //Format for multi-touch digitizer input reports Using this report descriptor:! x% w3 V0 L/ B& m$ v3 M
    //Byte[0] = Report ID == MULTI_TOUCH_DATA_REPORT_ID' z% y+ G2 `4 [4 V* l
    //1st contact point info in bytes 1-6.
$ ^6 ?3 U* _( M, k* I7 p    //Byte[1] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch
$ ?0 b4 B8 b1 F2 [    //Byte[2] = Contact identifier number (see note above)
: y) r- {. Z9 x    //Byte[3] = X-coordinate LSB" g5 Q5 l6 Q$ t& i
    //Byte[4] = X-coordinate MSB2 Q% }8 G4 ]9 P1 L4 }6 i
    //Byte[5] = Y-coordinate LSB/ b5 C. k# G; `' J  e) v3 U
    //Byte[6] = Y-coordinate MSB, G/ X  Z% h" J' L* B* J
   
6 _/ J; Q7 a4 p8 n1 v) l    //2nd contact point info in bytes 7-12. Y$ @& l) Q" _3 s" P  y- Z. B: o  n) ?
    //Byte[7] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch& A0 H# e' R% D/ `' u, n
    //Byte[8] = Contact identifier number (see note above)6 y7 D1 x+ O& j0 T
    //Byte[9] = X-coordinate LSB
) z( O, g( A* F& M4 {: o' a    //Byte[10]= X-coordinate MSB
) p- n: r% @0 T7 R+ Y* i    //Byte[11]= Y-coordinate LSB
  i: |1 Z- d* V2 l& H# Q; [    //Byte[12]= Y-coordinate MSB
$ ^. m1 ]) ^0 g4 ]+ `& m- O) Q, Z6 w+ F; T$ v0 S6 s9 O# b, P/ T
    //3rd contact point info in bytes 13-18
" K5 ?, k) N; K1 t7 E" f% U* u- V    //Byte[13] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch9 J* Z$ R% Q% s7 {3 W
    //Byte[14] = Contact identifier number (see note above)
( y3 ^* z0 Z8 v) E    //Byte[15] = X-coordinate LSB! I- z* b5 \# u$ N* X$ E+ e
    //Byte[16] = X-coordinate MSB
; f3 B* F- d' O& M( S. b, v    //Byte[17] = Y-coordinate LSB6 R# i" T+ J  X7 v
    //Byte[18] = Y-coordinate MSB5 b) ?6 L- m- F4 |) c* e# h# S
   
$ j3 P# u  |) g' f) z4 C    //4th contact point info in bytes 19-249 `5 @+ A- ?3 l1 x5 H
    //Byte[19] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch
1 O& s5 Z# n  f% X' B& k    //Byte[20] = Contact identifier number (see note above)
' V" \; w% p9 V- ^    //Byte[21] = X-coordinate LSB' C+ j5 L: h) W5 Y
    //Byte[22] = X-coordinate MSB
) Z7 h( H7 x5 L% r3 C$ H0 t    //Byte[23] = Y-coordinate LSB" n( L) d$ r1 H) ?* D* [
    //Byte[24] = Y-coordinate MSB. V8 Z5 m# ^) z# L
' j$ i* ?4 n; E
    //5th contact point info in bytes 25-30. {9 H, g4 o" y
    //Byte[25] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch
3 F. q/ m( E& y    //Byte[26] = Contact identifier number (see note above)
# p& z: G. v4 z$ S' v* a4 R    //Byte[27] = X-coordinate LSB* b" g& {$ @! S8 u+ w4 g! T' ]1 O
    //Byte[28]= X-coordinate MSB- f6 B' w. ?- m
    //Byte[29]= Y-coordinate LSB( n1 o% c- O$ p
    //Byte[30]= Y-coordinate MSB, \1 E9 W. a9 h" F" v/ b: F) Z
0 X/ @+ P/ H% Z
    //Byte[31]= 8-bit number indicating how many of the above contact points are valid.  # X% f6 a9 j, u' {
    //                        If only the first contact is valid, send "1" here.  If both are valid, send "2".......etc.. @- V& ?# H9 W- y& r
  a% u0 ^3 m" S% J
    //HID Report descriptor for an example Multi-Touch (5 simultaneous contacts), multi-modes device.# e" E) S: r! o0 m( [
    //------------------------------------------------------------------------------------------------
- y- t+ S1 c2 Y9 ?0 }0 j9 d; |    //Note: In a real application, at a minimum, certain terms in the report descriptor 6 G7 G( Q3 @0 I" C  F
    //(ex: UNIT, UNIT_EXPONENT, PHYSICAL_MAXIMUM and LOGICAL_MAXIMUM) will need to be modified to
9 _/ h7 `7 s" q3 T    //match the characteristics (ex: size) of the actual application being developed.  See the HID1_11.pdf* {  h$ d' R7 _6 x
    //specifications regarding these terms.* p" L( j% Q2 B( @' v

6 i# l1 s; `, x$ i" {7 Y! W' ?& ]/ w  ]8 J, O1 V& b  U
    //contact point9 W! c7 C$ E) _5 b( X% c
    0x05, 0x0D,                  // USAGE_PAGE (Digitizers)         
3 ~1 a- ~2 e3 N    0x09, 0x04,                  // USAGE (Touch Screen)            
+ Y% T8 [0 V/ N7 x' f. k    0xA1, 0x01,           // COLLECTION (Application)         
$ j" @% a4 I" n0 G1 U: C. L    0x85, MULTI_TOUCH_DATA_REPORT_ID,        //   REPORT_ID (Touch)    " P# y& J9 l# Q; M5 B( l% O
    0x09, 0x22,           //   USAGE (Finger)8 x' P1 |' R5 _% C
    //Finger 0     1 u6 {% Z! S& i" t8 `: s5 ^$ D6 z
    FINGER_USAGE,  7 z+ y( ~- `5 F6 p( I( P6 M" Q
    //Finger 1     
( Q- i" j/ p# |  \$ e, O/ s  n, A    FINGER_USAGE,& f1 c' T. Y+ k( a1 p
    //Finger 2     1 z6 Y- b2 X0 t
    FINGER_USAGE,
% L0 p# J: S3 v+ t    //Finger 3     
. M! M6 `5 o1 ]. S# i    FINGER_USAGE,    & M* [7 f0 c  v: g, t# K1 X
    //Finger 4     ! K& u% V6 z# K0 c: D
    FINGER_USAGE,
! c$ N, R: q# [9 y$ c' p6 |    //Finger 5     
* ~: N1 [" G" {+ D. L0 y1 g  C    FINGER_USAGE,- D, P* ~; \  m# ^8 u9 J7 P2 n
    //Finger 6     ! n) D: W/ ?" J2 Q/ P# y) N
    FINGER_USAGE,
8 I  C1 B* m% c    //Finger 7     " Z& n, D( j+ p! r
    FINGER_USAGE,4 v/ P& L! _( U+ H8 \. D
    //Finger 8     4 @) P$ y0 N( t6 F& X
    FINGER_USAGE,; d, {3 P5 d/ \) {- q
    //Finger 9     
' F! `, K1 c, p- T' O    FINGER_USAGE,
& L3 y1 z6 b4 [& d# f) i' e4 ?) h4 |4 A: x* m" g
    //Timestamp in relative time - Scan Time
4 c6 d  S5 W- J: r$ Y$ _: s/ ^% ]  @5 B, d
        0x05, 0x0D,                    //   Usage Page (Digitizer)
$ I" ~2 d. w. q5 ?4 A* [5 }6 C        0x55, 0x0C,                    //   Unit Exponent (-4)
+ m/ d2 q+ s/ ]: m% [3 w: A        0x66, 0x01, 0x10,              //   Unit (Seconds) & k: |9 s0 l! V0 s6 |
        0x47, 0xFF, 0xFF, 0x00, 0x00,  //   Physical Maximum (65535)
0 I$ \. S2 @  y. e/ ?        0x27, 0xFF, 0xFF, 0x00, 0x00,  //   Logical Maximum (65535) & z6 X6 F$ P9 S# b) I
        0x75, 0x10,                    //   Report Size (16) ; n# f, Y: S, i) H" u; X
        0x95, 0x01,                    //   Report Count (1) - |. C' o( {5 N
        0x09, 0x56,                    //   Usage (0x56, Relative Scan Time)
2 G4 ~1 r- V6 v2 r        0x81, 0x02,                    //   Input (Data,Var,Abs)
  x% P/ D5 Y8 ?  _. l3 }0 Y$ m$ K$ A  l
    //indicating how many of the above contact points+ k. n- {! U7 Y
   
9 N8 m& ~: Y) Y    0x05, 0x0D,                  //   USAGE_PAGE (Digitizers)   
8 X; f+ ]  `- f! [) J    0x09, 0x54,                  //   USAGE (Actual (contact) count)
9 T+ d- m1 ?% v4 m    0x95, 0x01,           //   REPORT_COUNT (1)
$ b# V, b7 J% u+ F- E9 o- B+ y! R    0x75, 0x08,           //   REPORT_SIZE (8)    / I# s1 `: I+ h+ K' q% C
    0x25, 0x0A,           //   LOGICAL_MAXIMUM (10)                               
3 d7 m7 D" F% A1 H: j    0x81, 0x02,           //   INPUT (Data,Var,Abs)                               
! d3 u) b  [# v+ [
3 A6 e/ V0 F3 Y    //In addition to standard HID reports (containing contact X/Y/tip-switch/in-range
' n. C+ e* W0 j* ^5 d' i$ l$ ^' y    //information), the firmware can send feature report information to the host.  # m( y/ j, D, b. O. c
    //Feature reports lets the host know information about the firmware/hardware
/ g& A/ T- _& d4 i' t4 u    //application design.  The host will typically request a feature report by sending " I4 Y- q8 n8 v0 F7 z( h/ b
    //a GET_REPORT control transfer, with the bRequest = REPORT, but with wIndex (MSB) = 0x035 m. P6 D' `6 N
    //(get feature report request as indicated in the HID1_11.pdf specifications). If a
& i8 E' K; w2 B7 v3 {    //feature report is sent to the host, it should be sent as a 2-byte packet (for . k& G9 o9 t& K! N5 H& w6 C0 a
    //this example project), formatted like follows:
+ r3 {( u' v7 f3 d& R    //Byte[0]= Report ID == VALID_CONTACTS_FEATURE_REPORT_ID == Feature report ID
/ g  ?/ q" g" D/ ]    //Byte[1]= Maximum number of contacts simultaneously supported by this application.  Always == 2 in this demo, since this report descriptor only has input fields for 2 contact points7 L& f0 h! m: X+ s$ N: K7 B
    //See the UserGetReportHandler() function that sends this type of packet in the MultiTouch.c file.
! N! a$ R7 t  W/ [& K0 `& i5 g  a2 ]6 ^, `1 r
    //GET_REPORT CTL : A1 01 52 03 04 00 02 00; q- t% P+ E, K) H
    //            IN : 52 056 P- X) S% W; q, I7 K9 e
    4 c8 a9 l4 j0 C7 u, u* C( f7 `0 d
    0x85, VALID_CONTACTS_FEATURE_REPORT_ID,   //   REPORT_ID (Feature)        
7 F# Z1 S) F5 X, E    0x09, 0x55,                               //   USAGE(Maximum Count). h! f# `; k: s
    0xB1, 0x02,                               //   FEATURE (Data,Var,Abs)
# s' I$ U& X" g  Z( \7 C4 Q
1 e# x! ^; R" |1 e    0x06, 0x00, 0xff,                         //     USAGE_PAGE (Vendor Defined)   
* A9 H0 b. e: v6 f7 C+ O: f6 p$ Q- p6 Z    0x09, 0xC5,                               //     USAGE (Vendor Usage 0xC5)1 v& h# i9 x  W0 f
    0x85, VALID_CONTACTS_FEATURE_REPORT_ID,   //     REPORT_ID (VALID_CONTACTS_FEATURE_REPORT_ID)    8 ?7 P) }1 ~4 f# ]/ U1 g1 N0 X
    0x15, 0x00,                               //     LOGICAL_MINIMUM (0)          " f: A& Y2 g9 o$ @9 Y+ J, r
    0x26, 0xff, 0x00,                         //     LOGICAL_MAXIMUM (0xff) ; x* s1 c  M% G5 K9 ~: j, A+ f
    0x75, 0x08,                               //     REPORT_SIZE (8)             1 T0 @! F' @- p- Z$ r* w2 x0 w
    0x96, 0x00, 0x01,                         //     REPORT_COUNT (0x100) (256)
* ?( d- Z5 P9 n) H) ?3 ~0 ^    0xB1, 0x02,                               //     FEATURE (Data,Var,Abs)) Q: J, ^+ |& o* u. \
   
4 }$ f( ~+ V: E, P0 }1 X. k    0x05, 0x0d,                               //    USAGE_PAGE (Digitizer)
6 M# ?% C" w5 ]    0x85, Latency_Mode_Feature_Report_ID,     //    REPORT_ID (Latency)              
3 y" B, G8 D$ I1 }1 u    0x09, 0x60,                               //    USAGE(Latency Mode)2 I1 K4 ]7 o$ {5 |; U  }8 `
    0x75, 0x01,                               //    REPORT_SIZE (1) , d5 T( s7 D( e% {0 U
    0x95, 0x01,                               //    REPORT_COUNT (1)
5 u: n3 f  f" \! A2 y2 }8 e    0x15, 0x00,                               //    LOGICAL_MINIMUM (0)+ j: o' N9 S9 F- z% q
    0x25, 0x01,                               //    LOGICAL_MAXIMUM (1)
; ]0 A, n- }) C2 K% Z3 p4 p    0xb1, 0x02,                               //    FEATURE (Data,Var,Abs)
' K0 S0 X& i3 W1 T# f! u0 U    0x95, 0x07,                               //    REPORT_COUNT (7)             4 D/ m4 c& I) S
    0xb1, 0x03,                               //    FEATURE (Cnst,Var,Abs) ; \7 E; f( h9 h/ p0 {9 D8 y
   
7 a( j1 p4 E: ~% V4 I    0xC0,                                     // END_COLLECTION
9 J% J8 C2 x) t5 F
  p$ R; V9 [" i2 x+ C6 e9 t* l' d6 `1 C* \) r6 D/ M$ J* l7 f
    //Top level collection describing the feature report that the host will use (SET_REPORT (feature) control transfer) to set the device mode (ex: mouse, single-touch digitizer, multi-touch digitizer)
: Z$ V& u1 w8 z" C/ U9 l    //-------------------------------------------------------------------
& i- y4 Z1 l3 f# b" u- d$ r    //Format of the feature report output data that the host will send to the device (when it wants to change the device mode):% T  {% y! W% E7 l( u
    //byte[0] = Report ID = DEVICE_MODE_FEATURE_REPORT_ID: n; s! n8 s. g$ y; j3 N
    //byte[1] = Device Mode (that the device should switch into)
* _9 |- g- |* d! d+ o) o* Q9 {8 ~, ^5 L    //byte[2] = Device Identifier
* ^6 @) V$ D$ [: W) \( \( U, W
5 E5 o: i# ?* T& }1 k6 y; Y    //SET_REPORT CTL : 21 09 53 03 04 00 03 00& `- j4 G( ~" V/ A" t
    //            IN : 53 02 001 i* T- `2 J; x, n. u
    & t: h* [% j% p. T$ t( M2 d
    0x09, 0x0E,           // USAGE (Device Configuration)
) e& p% w" O! P3 D2 v# U; n    0xa1, 0x01,           // COLLECTION (Application)
% [" h( n" Z3 v$ D, y, y$ ?8 j    0x85, DEVICE_MODE_FEATURE_REPORT_ID,     //   REPORT_ID (Configuration)              % `6 i! Y# M8 L
    0x09, 0x23,           //   USAGE (Device Settings)              8 E& @9 E1 m( x3 F* F5 B* j
    0xa1, 0x02,           //   COLLECTION (logical)   
" F( b7 H) U2 x4 _  A& O9 H    0x09, 0x52,           //    USAGE (Device Mode)         
4 Y9 t- U  H7 l    0x09, 0x53,           //    USAGE (Device Identifier)
( Z. p2 g# Z* U3 E    0x15, 0x00,           //    LOGICAL_MINIMUM (0)      
& [  P* d$ s. u# d0 _    0x25, 0x0a,           //    LOGICAL_MAXIMUM (10)
: j: u* L+ T0 i$ v/ C4 w' S# B# q) v    0x75, 0x08,           //    REPORT_SIZE (8)         * w3 h0 C7 J& K' Q( z. Z7 [: t
    0x95, 0x02,           //    REPORT_COUNT (2)         ) a0 @4 I  c; e& ]4 ~
    0xb1, 0x02,           //   FEATURE (Data,Var,Abs)   
0 ?; I( \1 C/ a6 U. u; t/ n" A    0xc0,                 //   END_COLLECTION (logical)4 u9 c: j8 C2 q! U% P+ p' ]
    0xc0,                 // END_COLLECTION (application): d$ ^1 m) ?6 X3 z8 M& A
    ! }% P, E) _) D

8 d) U8 K5 q- q1 u) g& f- g5 D    //Top level collection for use in Mouse device mode. 8 _3 \- b) A4 k. E% V) b$ ^
    //-------------------------------------------------------------------
/ X! W2 H1 U2 `8 `3 g: i1 ~    0x05, 0x01, // Usage Page (Generic Desktop)            
+ o5 N, E5 s" p. b/ D6 y+ V  r+ x, j    0x09, 0x02, // Usage (Mouse)                           
0 l7 [# v  c4 H" e& b+ ^7 `- m    0xA1, 0x01, // Collection (Application)                 2 ^5 A2 M9 Z* }1 i
    0x85, MOUSE_DATA_REPORT_ID, //  REPORT_ID (mouse)% ?' l" \, Z  h  i
    0x09, 0x01, //  Usage (Pointer)                         8 g/ Z. }) K" ]* q% [
    0xA1, 0x00, //  Collection (Physical)                   + W+ [+ c2 j* t/ r: l7 B" D- b
    0x05, 0x09, //      Usage Page (Buttons)               
& J/ N9 {: f7 E0 s) ^4 S    0x19, 0x01, //      Usage Minimum (01)                    |3 D- A0 L. H
    0x29, 0x03, //      Usage Maximum (03)                  + |' i$ q8 g4 J3 _6 {
    0x15, 0x00, //      Logical Minimum (0)                 # B* Y' x/ F; J) u  J' M( [
    0x25, 0x01, //      Logical Maximum (1)                 
& ]: D$ ]4 A3 T3 a( |/ C& W7 F    0x45, 0x00, //      Physical Maximum (0)
9 L( f% [7 D* W& N    0x65, 0x00, //      Unit (none)                  ( \, `/ C% S, \& P" N$ ]/ B, o
    0x95, 0x03, //      Report Count (3)                    
/ e' X+ J' ?" V" g    0x75, 0x01, //      Report Size (1)                       I6 i& _4 y8 F
    0x81, 0x02, //      Input (Data, Variable, Absolute)    $ p* @9 m- [+ J( X4 O0 c
    0x95, 0x01, //      Report Count (1)                    $ P+ v. z8 b7 T) J3 C$ F
    0x75, 0x05, //      Report Size (5)                     4 M- x6 z1 K9 P) j
    0x81, 0x01, //      Input (Constant)    ;5 bit padding    ^) j5 \" h: Z* ]
    0x05, 0x01, //      Usage Page (Generic Desktop)        
' h5 Q0 m0 Y* a  _- D% A    0x09, 0x30, //      Usage (X)                           
2 \5 c- e( r3 O0 g2 |& G    0x09, 0x31, //      Usage (Y)                           3 ~- d# }8 w' w& G0 Q; T! Z$ v
    0x15, 0x81, //      Logical Minimum (-127)              ! e1 B/ b8 }1 s8 _1 z0 t2 d
    0x25, 0x7F, //      Logical Maximum (127)               
* T; g! O: T8 A! L    0x75, 0x08, //      Report Size (8)                     
) Q( l+ s+ O5 j+ |1 \+ J    0x95, 0x02, //      Report Count (2)                    
' G  |' G6 \7 Y% A% {    0x81, 0x06, //      Input (Data, Variable, Relative)    ) F& j3 f. h! {7 [* \+ _
    0xC0,                 //  End Collection
: W/ a& G2 j# v0 H1 E    0xC0,              // End Collection            
3 z! |7 n! g1 [% ?: [};% m" \- C" Y6 E6 ]) d; s

& ]& |4 {% }; ]. L1 `0 E#define  FINGER_USAGE  \) ~6 |, A, M& K1 A
    0xA1, 0x02,           /*    COLLECTION (Logical)                   */  \
: T6 q* R2 O, F5 M+ j+ q! x    0x05, 0x0D,                  /*       USAGE_PAGE (Digitizers)             */  \2 Z) t: w' t) |# l
    0x09, 0x42,           /*       USAGE (Tip Switch)                  */  \
1 x: K- _8 Q$ ^0 a; L" a' u- {    0x15, 0x00,           /*       LOGICAL_MINIMUM (0)                 */  \) V! w; o. O5 O
    0x25, 0x01,           /*       LOGICAL_MAXIMUM (1)                 */  \
/ v  C$ P1 s" @1 n# k5 o2 p    0x75, 0x01,           /*       REPORT_SIZE (1)                     */  \
# c) |# k2 ^: J* e# v) n5 h; i    0x95, 0x01,           /*       REPORT_COUNT (1)                    */  \. K) M  L2 ~) {2 a
    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                        */  \
8 f! p3 @7 @8 \    0x09, 0x32,                  /*       USAGE (In Range)                    */  \
& B& Z' o; N2 R5 U( X) J6 B    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                */  \
, E+ U5 z! ~  q0 Z    0x09, 0x51,           /*       Usage(Contact ID)                   */  \- p8 S" g6 x0 K
    0x75, 0x06,           /*       REPORT_SIZE (6)                     */  \5 E& _2 y9 t8 `. P
    0x95, 0x01,           /*       REPORT_COUNT (1)                    */  \
" h; P5 a, r' h! x    0x15, 0x00,           /*       LOGICAL_MINIMUM (0)                 */  \* ~% ^( U% n, P, C/ s+ `. r
    0x25, 0x3F,           /*       LOGICAL_MAXIMUM (63)                */  \
- z! z! V5 A! o9 V1 R6 F    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                */  \
* m7 S; `0 u  P3 I' T1 t: \1 k    0x05, 0x01,           /*       USAGE_PAGE (Generic Desk..          */  \
. h, `5 _0 ]8 n    0x26, 0x20, 0x35,     /*       LOGICAL_MAXIMUM (13600)                  */  \2 f" N, ^8 A" P0 |0 U
    0x75, 0x10,           /*       REPORT_SIZE (16)                    */  \
9 n! {1 x! h: }    0x95, 0x01,           /*       REPORT_COUNT (1)                                  */  \
& f) T% f$ Y3 }& B    0x55, 0x0E,           /*       UNIT_EXPONENT (-2)                  */  \* b- o1 h6 f8 c1 `& G
    0x65, 0x33,           /*       UNIT (Inches, English Linear)       */  \# p; e, {9 J6 c" l5 j
    0x09, 0x30,           /*       USAGE (X)                           */  \
0 S$ U& U7 m' A, q4 p6 B( Y9 }    0x35, 0x00,           /*       PHYSICAL_MINIMUM (0)                */  \
/ M5 P1 M7 W9 ^9 m$ Y1 P    0x46, 0x50, 0x05,     /*       PHYSICAL_MAXIMUM (0x550 = 1360)     */  \6 Q& D8 Q7 \3 g- C' n
    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                */  \
. N! S7 c: O6 y+ v* l0 x( t    0x26, 0xE2, 0x1D,     /*       LOGICAL_MAXIMUM (7650)              */  \
6 _0 z0 b6 [1 o/ v    0x46, 0xFD, 0x02,     /*       PHYSICAL_MAXIMUM (0x2FD = 765)      */  \
2 b* n& b; `% M  i    0x09, 0x31,           /*       USAGE (Y)                           */  \
, B" ?3 M( t. G, e4 Z2 W    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                               */  \. v& [2 w" o: H( u& b# X4 l
    0xC0                  /*    END_COLLECTION                         */  
" Y9 @: Y4 [; R: R2 q' B#endif
# w2 _) d+ L5 `; a2 U
$ T8 P; M4 g6 b( F6 d$ J6 z2 q你可以試試看這是我寫的觸控描述
关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版