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

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

[复制链接]
lijiatu 发布时间:2020-11-8 17:36
请教各位大佬,我最近使用F405芯片,用stm32CubeMX默认创建了一个USBHID的例程,这个例程默认就是一个HID模拟鼠标移动的程序,我创建之后也是可以正常枚举并且鼠标正常移动的,说明生成的工程是没有问题的,然后我把报告描述符修改成了一个多点触摸的描述符,这个描述符是以前项目使用的,是没有问题的。变量也没有改变,只是把报告描述符的内容替换了,如下图:4 G$ D1 O9 }0 ]
1.png
3 f% r; h. x) B/ E; E这个报告描述符字节比较大,又474个字节,然后我又把相应的配置描述符修改了,如下图所示:) I& i1 Z- |3 b, V5 J3 X
' w+ [7 D, o3 D) I% x% d0 F1 E
把配置描述符集合里HID描述符中描述报告描述符大小的字节改成我们修改后的大小,如下图
% C3 H6 @! s# f' y; a  b$ ], L 3.png
$ w2 F0 D9 B: f$ y; ^
  B3 t4 i+ W" m" D1 E, p) r- u. m按道理,将这些修改之后,就相当于重新约定了HID上报数据的协议,随后,我又按照新规定的报告描述符的协议模拟上报触控点的数据。
5 ^/ p3 m! r; b1 k. m. T通过Bus hound显示枚举是成功的,也一直在按照报告描述符规定的协议向主机发送数据,但是没有模拟触控的现象,我使用以前的工程是有明显
5 J5 S+ G) @! n' Q) d的触控屏幕的现象的。通过设备管理器查看设备是正常运行的,然后用Bus hound观察枚举过程,发现一直在上报数据,但是在枚举过程中在主机! M* Z. g& F6 a6 [, a
发送GET_REPORT之后出现了USTS c0000004   stall pid 错误,出现之后枚举也没有停止,而是正常运行的,数据也是正常上报的,
" A1 J; P+ T) c; W: @但就是没有现象,我感觉是主机没有接收到报告描述符,或者接收错误了,导致虽然数据是正常上报的,但是系统不知道上报的数据的含义,: [" Q( j( F6 ^  C( N8 e
有没有大佬懂得这方面的错误,还请指导一下,工程其他地方都没有动,就是修改了配置、报告描述符等信息。& X5 q4 f- ^6 y/ G
4.png % Y/ G6 ~, w6 h. k- G

3 V- [% y# v* n" A 5.png . C, O, b. l" Z# R+ o& F( U
: B' i* c# H6 c( 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 =
, |  `* q  H- A# j* {{& V; [9 A6 |9 ]8 X0 q! s
//Below is the report descriptor for an example multi-touch device, which can support ! {5 X( \! h. J0 j/ O0 X* \, I
//up to 5 simultaneous contacts.  This report descriptor also supports multiple device modes.) [9 ~* {8 ~, `) g5 M1 d$ A0 ?
//The OS may select the device mode (ex: mouse, single-touch digitizer, multi-touch digitizer)
, P/ g, s- T- o6 q( R- s+ E$ G0 z/ h% H//by sending a SET_REPORT (feature) control transfer.  In each mode, the device firmware- M& R& b& d% }
//should behave differently and send input packets on the HID IN endpoint, formatted1 v. V/ L* q  ]+ D' A
//based on the report descriptor collections associated with that mode.) V0 g9 H' U0 b  B

3 D* W" k% m) T//Each IN packet (HID report) sent to the host (in multi-touch digitizer mode) is ?? bytes long (Bytes 0-13).  
' F' f2 l$ b5 E4 T1 G, [- Q- M//The data is sent in little endian format.  To send the report to the host, verify / Z+ z% f, ^8 O+ ^& }6 n' f1 h# \" v  k
//that the HID IN endpoint buffer is not already busy, then place the data in the HID 4 ^+ V# ]8 [) I) A; W. z9 h
//IN endpoint buffer SRAM, and then call the UsbSendEP5Report() function.  The data will 7 {/ r5 Y0 `2 h) }* Y; H2 f
//then get sent to the host, at the next opportunity when the host polls that endpoint
+ x0 K' h; P, o* L//(by sending an IN token packet to the endpoint).. q& f  e4 Y) q

+ v- }) U3 A! h' d% i5 Y1 g5 n$ M//NOTE (Contact identifier number): For a multi-touch device, the firmware needs to * E2 h4 i) D( P- Q
//keep track of each contact point separately and independantly.  For example, suppose 1 T3 E$ x9 Z# W9 Z# W- L& u
//a human first presses one finger to the screen.  The firmware would detect this, and
& K# q# J* l: x) t. T//it should arbitrarily assign a contact identifier number for this contact. Typically
5 J* O7 |% d" U- C2 ~( b//it would be assigned something like contact ID = "1". As the human moves their finger
/ o  X$ {0 e8 r$ ?2 Y) x& D2 R//around on the contact surface the firmware will report new X and Y coordinate ' v- v4 W$ B+ U( H
//information for this contact, but the contact ID byte should always be = "1" for
3 |& M' ^2 Z! p  e, V//this contact.
4 a# E: o% [7 v) {. Y; P% {# |//! v4 P, J- D. c( ]
//Now suppose the human places a second finger onto the touch surface, so there are
+ X" H6 f+ A2 z3 f//two simultanous contacts.  The firmware should assign this second contact a new " c! O2 ?: J3 B7 k8 a2 @
//contact ID, for instance, contact ID = "2".  So long as the first contact is still) M- v  L% K% I. ~7 h7 s
//valid, the firmware needs to continue reporting ID = "1" for the first contact.  
; Q# B: Q  {7 `, _% S//The firmware will continue to report information using these contact ID numbers   s2 F9 S( `" ?+ E' v  f
//until such time as a contact becomes invalid (human removes their finger from the
/ U" D$ G- d$ ]0 y. K- {; r//screen).- S2 ^, b! Y( P
, F/ x: r, b* j* K
( k! l2 z9 s* |* W/ a( O" I  M9 y
    //Top level collection for use in Multi-Touch Digitizer device mode.# F9 u# q8 m- C* ~
    //-------------------------------------------------------------------: [; y0 ?6 B: R% @8 L. q  q
    //Format for multi-touch digitizer input reports Using this report descriptor:3 p4 J, q. `! H: i3 N
    //Byte[0] = Report ID == MULTI_TOUCH_DATA_REPORT_ID0 H) e" Q3 f' b, C9 f8 k
    //1st contact point info in bytes 1-6.
6 L; `0 S: b: ?    //Byte[1] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch
  D6 Z& L% w& h9 ]. x    //Byte[2] = Contact identifier number (see note above): Q7 H" e6 K* ^) I  o5 {
    //Byte[3] = X-coordinate LSB
* }, A$ D; U9 t6 ~, S    //Byte[4] = X-coordinate MSB
$ Z2 V6 t: L( V& i6 C    //Byte[5] = Y-coordinate LSB4 Y# w* ~  f0 U
    //Byte[6] = Y-coordinate MSB
$ u9 x; I$ t) |/ e, c    ( I1 y& z" G3 [4 ]2 c( E- l
    //2nd contact point info in bytes 7-12
  ?9 |1 _2 O' n& l* l" j' t    //Byte[7] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch
$ j6 e4 l" V, M9 {% k    //Byte[8] = Contact identifier number (see note above)
! O, }9 P: b) Q, |% S    //Byte[9] = X-coordinate LSB
$ s# v' L7 f. E: o    //Byte[10]= X-coordinate MSB
7 t7 d& C! E; K( N; _+ N+ j    //Byte[11]= Y-coordinate LSB( f4 N4 @* ?' _; O! Q3 V5 u
    //Byte[12]= Y-coordinate MSB7 k: ^1 ~* j( h, j# P! j
, M: ?# A6 v+ N1 i
    //3rd contact point info in bytes 13-18# c/ o$ B& c, n' b9 V' @2 @
    //Byte[13] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch6 f# P) R8 G/ Q- l* `
    //Byte[14] = Contact identifier number (see note above)5 e0 k% Z6 l) E, \2 r
    //Byte[15] = X-coordinate LSB: u" X0 O! X: i
    //Byte[16] = X-coordinate MSB
# l; {7 [- ^  k' R" s8 o    //Byte[17] = Y-coordinate LSB: Q  W+ J5 i5 z3 _; w; `6 n
    //Byte[18] = Y-coordinate MSB8 u7 t- R$ c+ B( f7 l1 q: o) G
   
" Y# b5 a' O! g    //4th contact point info in bytes 19-24- I' V4 e6 f% p% }' O
    //Byte[19] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch4 v+ w" y$ X; q% j) l3 }) D
    //Byte[20] = Contact identifier number (see note above)( l9 h8 w; y$ p
    //Byte[21] = X-coordinate LSB
6 q7 F! l7 ~9 u7 `    //Byte[22] = X-coordinate MSB
9 I/ O6 h6 W( }  D/ p    //Byte[23] = Y-coordinate LSB
0 M& s9 S7 N/ n- y: @* _    //Byte[24] = Y-coordinate MSB
! \' F' I$ N! C$ H$ U- r9 W: f! B
8 y% u9 Q' j+ }  j9 r0 K    //5th contact point info in bytes 25-30
8 Q1 `+ w; W" n8 s2 W8 k    //Byte[25] = Bits7-3: pad bits (unused), Bit1:In Range, Bit0:Tip Switch
- F2 E0 ]$ V) I3 C+ W8 o* b    //Byte[26] = Contact identifier number (see note above)
: L& M5 @( g8 a7 O; Q' l    //Byte[27] = X-coordinate LSB
' {% E" R8 w% _* n( D' L    //Byte[28]= X-coordinate MSB
  y# r  y# @$ m7 `/ @    //Byte[29]= Y-coordinate LSB/ H+ r4 p; F' l. _( x. N0 i& r5 Q
    //Byte[30]= Y-coordinate MSB8 H8 R) ]3 i2 U# l/ e/ S
+ V' H3 S  @1 ]6 A" c) z: ^
    //Byte[31]= 8-bit number indicating how many of the above contact points are valid.  
9 C. x( N0 ~# ?, z3 A    //                        If only the first contact is valid, send "1" here.  If both are valid, send "2".......etc.6 F7 W4 o- @: j0 i) N, a

  o, {5 D. @# b4 _    //HID Report descriptor for an example Multi-Touch (5 simultaneous contacts), multi-modes device.( v: u# s/ ^& O$ K0 c8 z/ r" _
    //------------------------------------------------------------------------------------------------
) g, @' K% `" ?. i& X# u7 W    //Note: In a real application, at a minimum, certain terms in the report descriptor
% X7 J+ C& p# t' b* a    //(ex: UNIT, UNIT_EXPONENT, PHYSICAL_MAXIMUM and LOGICAL_MAXIMUM) will need to be modified to4 q" z  Z7 b) {
    //match the characteristics (ex: size) of the actual application being developed.  See the HID1_11.pdf
/ v" ^+ w! f: o8 F+ F( w    //specifications regarding these terms.
1 r9 f7 T5 L: m  [6 h! A" [8 n% I' Y) g* L1 S2 P

1 T& J- |* D  s/ P9 J* E    //contact point* Y1 b* r3 B: ~& y7 W+ C, b; L
    0x05, 0x0D,                  // USAGE_PAGE (Digitizers)          0 @  l3 M! S. q  r
    0x09, 0x04,                  // USAGE (Touch Screen)            
. F. `4 r7 s& n    0xA1, 0x01,           // COLLECTION (Application)         
% ^& ?8 A  E  k! D! K+ C    0x85, MULTI_TOUCH_DATA_REPORT_ID,        //   REPORT_ID (Touch)   
  P7 n/ Y; [& _. j/ H! ?    0x09, 0x22,           //   USAGE (Finger)
6 x2 H' r; a8 v  }) `    //Finger 0     ) j9 k& k9 k7 ]4 I5 S% a7 |& w( O" i: {
    FINGER_USAGE,  
6 ]3 ^: Q5 z; Z" x" h) H. b  W# U7 ^    //Finger 1     . N4 L# F3 D8 \$ j
    FINGER_USAGE,$ G- v4 W' ~* y9 g) k
    //Finger 2     
/ k& `" R9 Q3 Z    FINGER_USAGE,+ A) V. M1 h' f4 Z7 j5 T4 z
    //Finger 3     + J: u! Z' k1 z$ u0 @- B5 Q! ~) H
    FINGER_USAGE,   
& E! z3 Y6 F% D( l) o    //Finger 4     
2 Q% p# u& c3 E! M" r$ f    FINGER_USAGE,- K, s  e9 O/ z! f( k
    //Finger 5     
5 q  i0 ]+ w, r  H2 n    FINGER_USAGE,9 h0 a& o3 `& |- x! v4 \
    //Finger 6     $ |' J1 u9 o9 c# r1 B
    FINGER_USAGE,
1 R4 I+ O+ ^( k    //Finger 7     , |0 I* l+ s! L& @9 p7 ~0 ]9 k/ m# q
    FINGER_USAGE,2 r" B( o7 J6 g! m9 x; L
    //Finger 8     
# G* [; Z' k$ J+ |. Y) Z. a  |) o$ ?    FINGER_USAGE,8 z) ?. p5 g6 m* }( }' a8 r
    //Finger 9     5 K' v% B9 v9 ?, G% m" ?2 S  Q8 }
    FINGER_USAGE,
* K5 l9 Q0 p' P: T
8 ?8 Z7 F% K$ m" u  ^/ K    //Timestamp in relative time - Scan Time
8 p: U1 z1 p  O2 d! D3 B2 R0 R
( O" Y3 b9 @# }: u2 {        0x05, 0x0D,                    //   Usage Page (Digitizer)
' B' E! Q+ p, j* r* _3 e$ Z' q        0x55, 0x0C,                    //   Unit Exponent (-4)
+ x6 P5 V# I& H4 J- e! K4 n6 ~        0x66, 0x01, 0x10,              //   Unit (Seconds) / u/ j1 C: w, H8 U  m" b
        0x47, 0xFF, 0xFF, 0x00, 0x00,  //   Physical Maximum (65535)8 L0 [; D; p' J  a1 ^
        0x27, 0xFF, 0xFF, 0x00, 0x00,  //   Logical Maximum (65535) ! M* I/ v% ]( I9 G, i, K
        0x75, 0x10,                    //   Report Size (16) % z0 A9 `# |4 R1 a6 F
        0x95, 0x01,                    //   Report Count (1) & Y5 W3 m9 K# U0 w" n8 V4 m4 x
        0x09, 0x56,                    //   Usage (0x56, Relative Scan Time)3 Y* @6 O. y( n( |
        0x81, 0x02,                    //   Input (Data,Var,Abs)
  V  q' q6 {" U# v! b/ t1 d( z% `7 A
    //indicating how many of the above contact points
" R1 K( m% Y: Y4 Y  x! ?  C   
7 L! S  e# @& e8 M    0x05, 0x0D,                  //   USAGE_PAGE (Digitizers)   
/ c" o: w% J1 B: w  c    0x09, 0x54,                  //   USAGE (Actual (contact) count)
$ n' K  T) ]& W; x) M8 M    0x95, 0x01,           //   REPORT_COUNT (1), F$ ^' u0 u# ^
    0x75, 0x08,           //   REPORT_SIZE (8)    : B5 M8 h' F6 Z+ O1 H- \+ S
    0x25, 0x0A,           //   LOGICAL_MAXIMUM (10)                                6 J7 Q5 ?7 ^1 t7 K
    0x81, 0x02,           //   INPUT (Data,Var,Abs)                               
  H, K+ N8 z5 n6 m% X( D
+ X5 n! d9 R" A9 q, B2 `6 @    //In addition to standard HID reports (containing contact X/Y/tip-switch/in-range
9 V* W# x1 D+ R9 K    //information), the firmware can send feature report information to the host.  
3 W3 s' X) d  f3 I, C    //Feature reports lets the host know information about the firmware/hardware
" X: U6 ~. |. v: p! B& _) Z+ S    //application design.  The host will typically request a feature report by sending
& N( F2 l1 N$ \% ^. M' W$ Z8 b    //a GET_REPORT control transfer, with the bRequest = REPORT, but with wIndex (MSB) = 0x03
2 L4 i/ q- `. J6 U1 t    //(get feature report request as indicated in the HID1_11.pdf specifications). If a
2 ~+ N: w* j4 l" N; r5 p    //feature report is sent to the host, it should be sent as a 2-byte packet (for 3 h" R# P$ x- [! P5 {
    //this example project), formatted like follows:) I/ m  o# h8 W* Y/ b! y# H
    //Byte[0]= Report ID == VALID_CONTACTS_FEATURE_REPORT_ID == Feature report ID
: h5 P5 J, R# z& h3 L+ N    //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 points6 I3 f7 C, A# E7 Z4 `8 G+ d" T8 J
    //See the UserGetReportHandler() function that sends this type of packet in the MultiTouch.c file.& i2 w' T  z3 c5 A* b

/ i9 v6 c7 |% L/ c- }! p    //GET_REPORT CTL : A1 01 52 03 04 00 02 00; p) }9 r% `* n- H+ S# F8 b
    //            IN : 52 05
+ R5 ~  V) `3 z( Q( K8 r! W& H    2 L$ m; P% {. \( l8 k
    0x85, VALID_CONTACTS_FEATURE_REPORT_ID,   //   REPORT_ID (Feature)        " s+ ]5 n# D6 @! |' h
    0x09, 0x55,                               //   USAGE(Maximum Count)# A) I- ~  M; s" n, a! w6 u
    0xB1, 0x02,                               //   FEATURE (Data,Var,Abs) 3 R+ X8 p/ ]. j1 j1 a
: d2 d, t( b" ]' y
    0x06, 0x00, 0xff,                         //     USAGE_PAGE (Vendor Defined)   
3 ^% [& y, ~6 b3 q+ ~. o+ ^    0x09, 0xC5,                               //     USAGE (Vendor Usage 0xC5)
$ X$ z/ B! Z5 i$ U: |1 _5 A4 X    0x85, VALID_CONTACTS_FEATURE_REPORT_ID,   //     REPORT_ID (VALID_CONTACTS_FEATURE_REPORT_ID)   
# ?& |: Y1 s9 I: ~! i    0x15, 0x00,                               //     LOGICAL_MINIMUM (0)         
; \5 n4 S* ~/ g    0x26, 0xff, 0x00,                         //     LOGICAL_MAXIMUM (0xff)
1 [3 p; x! y' O0 Q! R& }4 }" O    0x75, 0x08,                               //     REPORT_SIZE (8)            
( _* D  S8 D- V) R( K+ n    0x96, 0x00, 0x01,                         //     REPORT_COUNT (0x100) (256)
; o! s, z' A, l9 a! @    0xB1, 0x02,                               //     FEATURE (Data,Var,Abs)
7 L2 g- g# l, `  c' s: N    9 E/ e! v8 ~' p- n& N% \
    0x05, 0x0d,                               //    USAGE_PAGE (Digitizer)7 s, T. u. Q/ N  o0 S' J' }
    0x85, Latency_Mode_Feature_Report_ID,     //    REPORT_ID (Latency)              
1 H( c. G3 j! G3 {3 q: R6 X    0x09, 0x60,                               //    USAGE(Latency Mode)( r2 J3 i# {# `0 B) g. |& n
    0x75, 0x01,                               //    REPORT_SIZE (1)
- k) J) n; I* `) R/ N    0x95, 0x01,                               //    REPORT_COUNT (1)  o; y# A! M1 c
    0x15, 0x00,                               //    LOGICAL_MINIMUM (0)
/ Q% E) \* p5 M0 d5 g& ]# O    0x25, 0x01,                               //    LOGICAL_MAXIMUM (1)
0 g$ [; z, |' m4 }) |    0xb1, 0x02,                               //    FEATURE (Data,Var,Abs)
, [9 I0 d7 T2 {% J* {) f* S2 s    0x95, 0x07,                               //    REPORT_COUNT (7)            
3 i# m4 H+ E- |" f- E! E& H" p" V    0xb1, 0x03,                               //    FEATURE (Cnst,Var,Abs) : c' R# O3 t& F* [7 ^$ p( n# k6 `
    ; O# }: c! B  ^8 @. ?6 Y- _7 k
    0xC0,                                     // END_COLLECTION1 `4 ?" j9 h! K7 b
0 u1 H  E/ l- j
1 G8 G% \, z5 j0 D0 c. c
    //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)
# M1 M8 N- z# P( k  j    //-------------------------------------------------------------------! b7 I, F) f( `1 r) I
    //Format of the feature report output data that the host will send to the device (when it wants to change the device mode):
2 y) F5 F5 Z# U4 I    //byte[0] = Report ID = DEVICE_MODE_FEATURE_REPORT_ID& W8 E; `* d+ L
    //byte[1] = Device Mode (that the device should switch into)
& t" ]; ]- c/ P7 _! b( L' v& P    //byte[2] = Device Identifier  q# v: `, e! [) _' e
' B4 l1 a- ~; r) s
    //SET_REPORT CTL : 21 09 53 03 04 00 03 00. B( {  T- `% B# T
    //            IN : 53 02 00  I/ t+ N9 \) ]" I( l. |6 v, F- y. h
   
; ~( }; \' l) E, n5 c1 ]4 g    0x09, 0x0E,           // USAGE (Device Configuration)
" X" l2 D' K' M    0xa1, 0x01,           // COLLECTION (Application)8 U8 y/ s3 v$ M1 R5 p0 T0 f
    0x85, DEVICE_MODE_FEATURE_REPORT_ID,     //   REPORT_ID (Configuration)              
! z+ v, v2 O. a& a/ q/ U    0x09, 0x23,           //   USAGE (Device Settings)              : n( z* a( [' \
    0xa1, 0x02,           //   COLLECTION (logical)   
' {1 c4 R0 ]/ @" g0 N. J    0x09, 0x52,           //    USAGE (Device Mode)         
  h3 {3 X1 ^( I    0x09, 0x53,           //    USAGE (Device Identifier)
5 F* v* i) M0 n3 |3 c- A    0x15, 0x00,           //    LOGICAL_MINIMUM (0)      
# c% I9 Q2 I$ F! m    0x25, 0x0a,           //    LOGICAL_MAXIMUM (10)
% n( t$ F6 {9 c' ~/ N    0x75, 0x08,           //    REPORT_SIZE (8)         8 R- |- E# a) A% Y. E' j, X
    0x95, 0x02,           //    REPORT_COUNT (2)         
" l1 X  V2 ^1 Z' K9 N& l    0xb1, 0x02,           //   FEATURE (Data,Var,Abs)   
0 P; {+ Q# k/ Q- {    0xc0,                 //   END_COLLECTION (logical)% M+ q3 b9 `7 Y6 `
    0xc0,                 // END_COLLECTION (application). A  [; }% {$ ^2 W/ i$ b7 ?
   
: d. m. t" J7 S# Y8 X# ^
# K% A; y& }8 O6 B2 B    //Top level collection for use in Mouse device mode.
  U* T; @$ _  n- C' |, G- C/ E: J: c7 Q    //-------------------------------------------------------------------
- o$ w+ H. E6 Q: ~  o  ]    0x05, 0x01, // Usage Page (Generic Desktop)             0 w% t) W% Y; p, d0 R6 M
    0x09, 0x02, // Usage (Mouse)                            4 v8 f1 d4 o" a. u' k1 E3 E$ O
    0xA1, 0x01, // Collection (Application)                 
2 Q+ V: C& M9 }1 h9 F    0x85, MOUSE_DATA_REPORT_ID, //  REPORT_ID (mouse)& T" w1 m( @! }
    0x09, 0x01, //  Usage (Pointer)                           P2 h0 j1 S% F5 m6 Q( K$ t$ g
    0xA1, 0x00, //  Collection (Physical)                  
. W% C  J/ V) ~/ F. Z5 z    0x05, 0x09, //      Usage Page (Buttons)               
$ r3 ]! I8 A4 R4 \$ T! p: z    0x19, 0x01, //      Usage Minimum (01)                  
, a& g9 Q8 h  w( X: m8 U    0x29, 0x03, //      Usage Maximum (03)                  
% ?& g& p, ?) W6 y, U- B6 l    0x15, 0x00, //      Logical Minimum (0)                 0 ^+ F4 Y4 k$ g2 [( ~
    0x25, 0x01, //      Logical Maximum (1)                 
! }: M4 ?1 ]9 ^7 x8 M    0x45, 0x00, //      Physical Maximum (0)
+ v# Z; _% U: h; \' i8 Y* U    0x65, 0x00, //      Unit (none)                  3 U0 U8 Y6 M( |2 ~
    0x95, 0x03, //      Report Count (3)                    4 \7 a0 y( v: h/ C. ?  Z" Y
    0x75, 0x01, //      Report Size (1)                     
5 z, P% E- G5 |    0x81, 0x02, //      Input (Data, Variable, Absolute)   
! g' u9 W: C$ C# j; P    0x95, 0x01, //      Report Count (1)                    
% j# ^9 E/ T- L, A& W; |$ V4 T    0x75, 0x05, //      Report Size (5)                     
' T- c2 |6 i0 i, L    0x81, 0x01, //      Input (Constant)    ;5 bit padding  
: v9 B1 ~: }4 @; M' H3 {& ^    0x05, 0x01, //      Usage Page (Generic Desktop)        
. e6 \0 G) r* p. ~8 C    0x09, 0x30, //      Usage (X)                           6 i: X  v$ g& z7 P4 J
    0x09, 0x31, //      Usage (Y)                           + a5 x. L4 Y: F8 }* g, K. q1 J4 a
    0x15, 0x81, //      Logical Minimum (-127)              : V3 }8 f6 Z; d3 S/ V2 d
    0x25, 0x7F, //      Logical Maximum (127)               ) ^2 f7 d5 p% }1 _2 b$ `7 k* y
    0x75, 0x08, //      Report Size (8)                     ( A3 l4 S: `, W! g) q5 s- P. x
    0x95, 0x02, //      Report Count (2)                    - `- R+ I/ f: u1 G' a. M* n
    0x81, 0x06, //      Input (Data, Variable, Relative)   
& Y( |' N; O) \) H* F9 G    0xC0,                 //  End Collection
" M2 |0 W) Q: @/ a    0xC0,              // End Collection            4 J# j2 @( x4 n
};4 u7 q# h6 j: o3 J

5 r$ H: n$ S/ l) s. G#define  FINGER_USAGE  \8 I$ n6 a" Z8 D  ~/ f
    0xA1, 0x02,           /*    COLLECTION (Logical)                   */  \! {' D$ b0 _# N2 d: Z
    0x05, 0x0D,                  /*       USAGE_PAGE (Digitizers)             */  \
& P! r0 z3 @2 t( w/ ~/ `    0x09, 0x42,           /*       USAGE (Tip Switch)                  */  \* ?( ~9 s2 O4 ?. S+ `) |
    0x15, 0x00,           /*       LOGICAL_MINIMUM (0)                 */  \9 y' b; Y6 P9 n
    0x25, 0x01,           /*       LOGICAL_MAXIMUM (1)                 */  \
2 z9 r2 ?0 Q4 r    0x75, 0x01,           /*       REPORT_SIZE (1)                     */  \
. g$ r0 c" a( b; P/ \! H    0x95, 0x01,           /*       REPORT_COUNT (1)                    */  \
: J7 t; t# g! C2 U/ ~    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                        */  \
9 r' B- I7 S; f; v' E$ K/ `    0x09, 0x32,                  /*       USAGE (In Range)                    */  \
* \, G7 S' H7 \2 J! s. S2 C$ V    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                */  \6 U$ O/ \$ d' Z  I9 M5 B
    0x09, 0x51,           /*       Usage(Contact ID)                   */  \( H  q7 V" T  q* @' ?! _+ G: H
    0x75, 0x06,           /*       REPORT_SIZE (6)                     */  \
! s( S) Y8 p9 f- q+ f    0x95, 0x01,           /*       REPORT_COUNT (1)                    */  \) g  u- k4 `$ [% j
    0x15, 0x00,           /*       LOGICAL_MINIMUM (0)                 */  \
5 u! }& @* H3 ^! F% z5 m5 }    0x25, 0x3F,           /*       LOGICAL_MAXIMUM (63)                */  \% j1 x& }3 g, h5 E$ [
    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                */  \# ?' I3 ?1 ~. f% ~3 ?4 ^
    0x05, 0x01,           /*       USAGE_PAGE (Generic Desk..          */  \
8 P  x" w8 L5 J. `+ R- O( k/ o    0x26, 0x20, 0x35,     /*       LOGICAL_MAXIMUM (13600)                  */  \( {+ b* P/ t9 B
    0x75, 0x10,           /*       REPORT_SIZE (16)                    */  \
8 e( k* O) G1 F" T( H9 `9 ~# l    0x95, 0x01,           /*       REPORT_COUNT (1)                                  */  \
% i+ j8 k( Q5 Q/ E* i& j4 p    0x55, 0x0E,           /*       UNIT_EXPONENT (-2)                  */  \% J( K0 r/ }, S. P" N1 l
    0x65, 0x33,           /*       UNIT (Inches, English Linear)       */  \
( q- C8 G! ^3 C! g3 }    0x09, 0x30,           /*       USAGE (X)                           */  \
! A2 k. N" w; u6 J' n0 Z5 Y" M    0x35, 0x00,           /*       PHYSICAL_MINIMUM (0)                */  \
. l8 t6 x5 Q! o9 l$ D    0x46, 0x50, 0x05,     /*       PHYSICAL_MAXIMUM (0x550 = 1360)     */  \
  _0 F6 w) W( W- d! n- Q9 h3 G    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                */  \9 s3 s3 u8 n* s. ]$ B" z; c( S
    0x26, 0xE2, 0x1D,     /*       LOGICAL_MAXIMUM (7650)              */  \
% P8 M, Z1 u2 r  }8 k) Z* n    0x46, 0xFD, 0x02,     /*       PHYSICAL_MAXIMUM (0x2FD = 765)      */  \
0 `  b) x$ o: |7 M* r, n5 b+ t    0x09, 0x31,           /*       USAGE (Y)                           */  \% v: K8 Z8 J/ R! C: A
    0x81, 0x02,           /*       INPUT (Data,Var,Abs)                               */  \" M9 |0 }6 h8 b- E6 z) H
    0xC0                  /*    END_COLLECTION                         */  7 x+ J, S' r$ o
#endif
+ J( d) E/ U$ `( l) G
) |% Z) Z& k8 n$ [. f你可以試試看這是我寫的觸控描述

所属标签

相似分享

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版