All comments in the library, bootloaders, demos and projects have now been spell...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / HIDReportData.h
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2009.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
7 */
8
9 /*
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
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.
20
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
28 this software.
29 */
30
31 /** \file
32 *
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.
35 */
36
37 #ifndef __HIDREPORTDATA_H__
38 #define __HIDREPORTDATA_H__
39
40 /* Public Interface - May be used in end-application: */
41 /* Macros: */
42 /** HID_ReportItem_t.ItemFlags flag for constant data. */
43 #define IOF_CONSTANT (1 << 0)
44
45 /** HID_ReportItem_t.ItemFlags flag for data. */
46 #define IOF_DATA (0 << 0)
47
48 /** HID_ReportItem_t.ItemFlags flag for variable data. */
49 #define IOF_VARIABLE (1 << 1)
50
51 /** HID_ReportItem_t.ItemFlags flag for array data. */
52 #define IOF_ARRAY (0 << 1)
53
54 /** HID_ReportItem_t.ItemFlags flag for relative data. */
55 #define IOF_RELATIVE (1 << 2)
56
57 /** HID_ReportItem_t.ItemFlags flag for absolute data. */
58 #define IOF_ABSOLUTE (0 << 2)
59
60 /** HID_ReportItem_t.ItemFlags flag for wrapped value data. */
61 #define IOF_WRAP (1 << 3)
62
63 /** HID_ReportItem_t.ItemFlags flag for non-wrapped value data. */
64 #define IOF_NOWRAP (0 << 3)
65
66 /** HID_ReportItem_t.ItemFlags flag for non linear data. */
67 #define IOF_NONLINEAR (1 << 4)
68
69 /** HID_ReportItem_t.ItemFlags flag for linear data. */
70 #define IOF_LINEAR (0 << 4)
71
72 /** HID_ReportItem_t.ItemFlags flag for no preferred state. */
73 #define IOF_NOPREFERRED (1 << 5)
74
75 /** HID_ReportItem_t.ItemFlags flag for preferred state items. */
76 #define IOF_PREFERREDSTATE (0 << 5)
77
78 /** HID_ReportItem_t.ItemFlags flag for null state items. */
79 #define IOF_NULLSTATE (1 << 6)
80
81 /** HID_ReportItem_t.ItemFlags flag for no null position data. */
82 #define IOF_NONULLPOSITION (0 << 6)
83
84 /** HID_ReportItem_t.ItemFlags flag for buffered bytes. */
85 #define IOF_BUFFEREDBYTES (1 << 8)
86
87 /** HID_ReportItem_t.ItemFlags flag for bit field data. */
88 #define IOF_BITFIELD (0 << 8)
89
90 /* Private Interface - For use in library only: */
91 #if !defined(__DOXYGEN__)
92 /* Macros: */
93 #define DATA_SIZE_MASK 0b00000011
94 #define TYPE_MASK 0b00001100
95 #define TAG_MASK 0b11110000
96
97 #define DATA_SIZE_0 0b00000000
98 #define DATA_SIZE_1 0b00000001
99 #define DATA_SIZE_2 0b00000010
100 #define DATA_SIZE_4 0b00000011
101
102 #define TYPE_MAIN 0b00000000
103 #define TYPE_GLOBAL 0b00000100
104 #define TYPE_LOCAL 0b00001000
105
106 #define TAG_MAIN_INPUT 0b10000000
107 #define TAG_MAIN_OUTPUT 0b10010000
108 #define TAG_MAIN_COLLECTION 0b10100000
109 #define TAG_MAIN_FEATURE 0b10110000
110 #define TAG_MAIN_ENDCOLLECTION 0b11000000
111 #define TAG_GLOBAL_USAGEPAGE 0b00000000
112 #define TAG_GLOBAL_LOGICALMIN 0b00010000
113 #define TAG_GLOBAL_LOGICALMAX 0b00100000
114 #define TAG_GLOBAL_PHYSMIN 0b00110000
115 #define TAG_GLOBAL_PHYSMAX 0b01000000
116 #define TAG_GLOBAL_UNITEXP 0b01010000
117 #define TAG_GLOBAL_UNIT 0b01100000
118 #define TAG_GLOBAL_REPORTSIZE 0b01110000
119 #define TAG_GLOBAL_REPORTID 0b10000000
120 #define TAG_GLOBAL_REPORTCOUNT 0b10010000
121 #define TAG_GLOBAL_PUSH 0b10100000
122 #define TAG_GLOBAL_POP 0b10110000
123 #define TAG_LOCAL_USAGE 0b00000000
124 #define TAG_LOCAL_USAGEMIN 0b00010000
125 #define TAG_LOCAL_USAGEMAX 0b00100000
126 #endif
127
128 #endif