]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/nusb/kb/hid.h
add nusb/cam
[plan9front.git] / sys / src / cmd / nusb / kb / hid.h
1 /*
2  * USB keyboard/mouse constants
3  */
4 enum {
5
6         Stack = 32 * 1024,
7
8         /* HID class subclass protocol ids */
9         PtrCSP          = 0x020103,     /* mouse.boot.hid */
10         HidCSP          = 0x000003,     /* could be a trackpoint */
11         KbdCSP          = 0x010103,     /* keyboard.boot.hid */
12
13         /* Requests */
14         Getreport = 0x01,
15         Setreport = 0x09,
16         Getproto        = 0x03,
17         Setproto        = 0x0b,
18
19         /* protocols for SET_PROTO request */
20         Bootproto       = 0,
21         Reportproto     = 1,
22
23         /* protocols for SET_REPORT request */
24         Reportout = 0x0200,
25 };
26
27 /*
28  * USB HID report descriptor item tags
29  */ 
30 enum {
31         /* main items */
32         Input   = 8,
33         Output,
34         Collection,
35         Feature,
36
37         CollectionEnd,
38
39         /* global items */
40         UsagPg = 0,
41         LogiMin,
42         LogiMax,
43         PhysMin,
44         PhysMax,
45         UnitExp,
46         UnitTyp,
47         RepSize,
48         RepId,
49         RepCnt,
50
51         Push,
52         Pop,
53
54         /* local items */
55         Usage   = 0,
56         UsagMin,
57         UsagMax,
58         DesgIdx,
59         DesgMin,
60         DesgMax,
61         StrgIdx,
62         StrgMin,
63         StrgMax,
64
65         Delim,
66 };
67
68 /* main item flags */
69 enum {
70         Fdata   = 0<<0, Fconst  = 1<<0,
71         Farray  = 0<<1, Fvar    = 1<<1,
72         Fabs    = 0<<2, Frel    = 1<<2,
73         Fnowrap = 0<<3, Fwrap   = 1<<3,
74         Flinear = 0<<4, Fnonlin = 1<<4,
75         Fpref   = 0<<5, Fnopref = 1<<5,
76         Fnonull = 0<<6, Fnullst = 1<<6,
77 };