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 /** \ingroup Group_HIDParser 
  38  *  @defgroup Group_HIDIOFConst Input/Output/Feature Masks 
  40  *  Masks indicating the type of Input, Output of Feature HID report item. 
  45 #ifndef __HIDREPORTDATA_H__ 
  46 #define __HIDREPORTDATA_H__ 
  48         /* Public Interface - May be used in end-application: */ 
  50                         /** HID_ReportItem_t.ItemFlags flag for constant data. */ 
  51                         #define IOF_CONSTANT             (1 << 0) 
  53                         /** HID_ReportItem_t.ItemFlags flag for data. */ 
  54                         #define IOF_DATA                 (0 << 0) 
  56                         /** HID_ReportItem_t.ItemFlags flag for variable data. */ 
  57                         #define IOF_VARIABLE             (1 << 1) 
  59                         /** HID_ReportItem_t.ItemFlags flag for array data. */ 
  60                         #define IOF_ARRAY                (0 << 1) 
  62                         /** HID_ReportItem_t.ItemFlags flag for relative data. */ 
  63                         #define IOF_RELATIVE             (1 << 2) 
  65                         /** HID_ReportItem_t.ItemFlags flag for absolute data. */ 
  66                         #define IOF_ABSOLUTE             (0 << 2) 
  68                         /** HID_ReportItem_t.ItemFlags flag for wrapped value data. */ 
  69                         #define IOF_WRAP                 (1 << 3) 
  71                         /** HID_ReportItem_t.ItemFlags flag for non-wrapped value data. */ 
  72                         #define IOF_NOWRAP               (0 << 3) 
  74                         /** HID_ReportItem_t.ItemFlags flag for non linear data. */ 
  75                         #define IOF_NONLINEAR            (1 << 4) 
  77                         /** HID_ReportItem_t.ItemFlags flag for linear data. */ 
  78                         #define IOF_LINEAR               (0 << 4) 
  80                         /** HID_ReportItem_t.ItemFlags flag for no preferred state. */ 
  81                         #define IOF_NOPREFERRED          (1 << 5) 
  83                         /** HID_ReportItem_t.ItemFlags flag for preferred state items. */ 
  84                         #define IOF_PREFERREDSTATE       (0 << 5) 
  86                         /** HID_ReportItem_t.ItemFlags flag for null state items. */ 
  87                         #define IOF_NULLSTATE            (1 << 6) 
  89                         /** HID_ReportItem_t.ItemFlags flag for no null position data. */ 
  90                         #define IOF_NONULLPOSITION       (0 << 6) 
  92                         /** HID_ReportItem_t.ItemFlags flag for buffered bytes. */ 
  93                         #define IOF_BUFFEREDBYTES        (1 << 8) 
  95                         /** HID_ReportItem_t.ItemFlags flag for bit field data. */ 
  96                         #define IOF_BITFIELD             (0 << 8) 
  98         /* Private Interface - For use in library only: */ 
  99         #if !defined(__DOXYGEN__) 
 101                         #define DATA_SIZE_MASK           0x03 
 102                         #define TYPE_MASK                0x0C 
 103                         #define TAG_MASK                 0xF0 
 105                         #define DATA_SIZE_0              0x00 
 106                         #define DATA_SIZE_1              0x01 
 107                         #define DATA_SIZE_2              0x02 
 108                         #define DATA_SIZE_4              0x03 
 110                         #define TYPE_MAIN                0x00 
 111                         #define TYPE_GLOBAL              0x04 
 112                         #define TYPE_LOCAL               0x08 
 114                         #define TAG_MAIN_INPUT           0x80 
 115                         #define TAG_MAIN_OUTPUT          0x90 
 116                         #define TAG_MAIN_COLLECTION      0xA0 
 117                         #define TAG_MAIN_FEATURE         0xB0 
 118                         #define TAG_MAIN_ENDCOLLECTION   0xC0 
 120                         #define TAG_GLOBAL_USAGEPAGE     0x00 
 121                         #define TAG_GLOBAL_LOGICALMIN    0x10 
 122                         #define TAG_GLOBAL_LOGICALMAX    0x20 
 123                         #define TAG_GLOBAL_PHYSMIN       0x30 
 124                         #define TAG_GLOBAL_PHYSMAX       0x40 
 125                         #define TAG_GLOBAL_UNITEXP       0x50 
 126                         #define TAG_GLOBAL_UNIT          0x60 
 127                         #define TAG_GLOBAL_REPORTSIZE    0x70 
 128                         #define TAG_GLOBAL_REPORTID      0x80 
 129                         #define TAG_GLOBAL_REPORTCOUNT   0x90 
 130                         #define TAG_GLOBAL_PUSH          0xA0 
 131                         #define TAG_GLOBAL_POP           0xB0 
 133                         #define TAG_LOCAL_USAGE          0x00 
 134                         #define TAG_LOCAL_USAGEMIN       0x10 
 135                         #define TAG_LOCAL_USAGEMAX       0x20