3 Copyright (C) Dean Camera, 2009.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
33 * Constants for HID report item attributes. Refer to the HID specification for details on each
34 * flag's meaning when applied to an IN, OUT or FEATURE item.
37 #ifndef __HIDREPORTDATA_H__
38 #define __HIDREPORTDATA_H__
40 /* Public Interface - May be used in end-application: */
42 /** HID_ReportItem_t.ItemFlags flag for constant data. */
43 #define IOF_CONSTANT (1 << 0)
45 /** HID_ReportItem_t.ItemFlags flag for data. */
46 #define IOF_DATA (0 << 0)
48 /** HID_ReportItem_t.ItemFlags flag for variable data. */
49 #define IOF_VARIABLE (1 << 1)
51 /** HID_ReportItem_t.ItemFlags flag for array data. */
52 #define IOF_ARRAY (0 << 1)
54 /** HID_ReportItem_t.ItemFlags flag for relative data. */
55 #define IOF_RELATIVE (1 << 2)
57 /** HID_ReportItem_t.ItemFlags flag for absolute data. */
58 #define IOF_ABSOLUTE (0 << 2)
60 /** HID_ReportItem_t.ItemFlags flag for wrapped value data. */
61 #define IOF_WRAP (1 << 3)
63 /** HID_ReportItem_t.ItemFlags flag for non-wrapped value data. */
64 #define IOF_NOWRAP (0 << 3)
66 /** HID_ReportItem_t.ItemFlags flag for non linear data. */
67 #define IOF_NONLINEAR (1 << 4)
69 /** HID_ReportItem_t.ItemFlags flag for linear data. */
70 #define IOF_LINEAR (0 << 4)
72 /** HID_ReportItem_t.ItemFlags flag for no preferred state. */
73 #define IOF_NOPREFERRED (1 << 5)
75 /** HID_ReportItem_t.ItemFlags flag for preferred state items. */
76 #define IOF_PREFERREDSTATE (0 << 5)
78 /** HID_ReportItem_t.ItemFlags flag for null state items. */
79 #define IOF_NULLSTATE (1 << 6)
81 /** HID_ReportItem_t.ItemFlags flag for no null position data. */
82 #define IOF_NONULLPOSITION (0 << 6)
84 /** HID_ReportItem_t.ItemFlags flag for buffered bytes. */
85 #define IOF_BUFFEREDBYTES (1 << 8)
87 /** HID_ReportItem_t.ItemFlags flag for bit field data. */
88 #define IOF_BITFIELD (0 << 8)
90 /* Private Interface - For use in library only: */
91 #if !defined(__DOXYGEN__)
93 #define DATA_SIZE_MASK 0x03
94 #define TYPE_MASK 0x0C
97 #define DATA_SIZE_0 0x00
98 #define DATA_SIZE_1 0x01
99 #define DATA_SIZE_2 0x02
100 #define DATA_SIZE_4 0x03
102 #define TYPE_MAIN 0x00
103 #define TYPE_GLOBAL 0x04
104 #define TYPE_LOCAL 0x08
106 #define TAG_MAIN_INPUT 0x80
107 #define TAG_MAIN_OUTPUT 0x90
108 #define TAG_MAIN_COLLECTION 0xA0
109 #define TAG_MAIN_FEATURE 0xB0
110 #define TAG_MAIN_ENDCOLLECTION 0xC0
112 #define TAG_GLOBAL_USAGEPAGE 0x00
113 #define TAG_GLOBAL_LOGICALMIN 0x10
114 #define TAG_GLOBAL_LOGICALMAX 0x20
115 #define TAG_GLOBAL_PHYSMIN 0x30
116 #define TAG_GLOBAL_PHYSMAX 0x40
117 #define TAG_GLOBAL_UNITEXP 0x50
118 #define TAG_GLOBAL_UNIT 0x60
119 #define TAG_GLOBAL_REPORTSIZE 0x70
120 #define TAG_GLOBAL_REPORTID 0x80
121 #define TAG_GLOBAL_REPORTCOUNT 0x90
122 #define TAG_GLOBAL_PUSH 0xA0
123 #define TAG_GLOBAL_POP 0xB0
125 #define TAG_LOCAL_USAGE 0x00
126 #define TAG_LOCAL_USAGEMIN 0x10
127 #define TAG_LOCAL_USAGEMAX 0x20