3      Copyright (C) Dean Camera, 2011. 
   5   dean [at] fourwalledcubicle [dot] com 
  10   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, distribute, and sell this 
  13   software and its documentation for any purpose is hereby granted 
  14   without fee, provided that the above copyright notice appear in 
  15   all 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 
  32  *  \brief Constants for HID report item attributes. 
  34  *  HID report item constants for report item attributes. Refer to the HID specification for 
  35  *  details on each flag's meaning when applied to an IN, OUT or FEATURE item. 
  38 /** \ingroup Group_HIDParser 
  39  *  @defgroup Group_HIDIOFConst Input/Output/Feature Masks 
  41  *  Masks indicating the type of Input, Output of Feature HID report item. 
  46 #ifndef __HIDREPORTDATA_H__ 
  47 #define __HIDREPORTDATA_H__ 
  49         /* Public Interface - May be used in end-application: */ 
  51                         /** \ref HID_ReportItem_t.ItemFlags flag for constant data. */ 
  52                         #define IOF_CONSTANT             (1 << 0) 
  54                         /** \ref HID_ReportItem_t.ItemFlags flag for data. */ 
  55                         #define IOF_DATA                 (0 << 0) 
  57                         /** \ref HID_ReportItem_t.ItemFlags flag for variable data. */ 
  58                         #define IOF_VARIABLE             (1 << 1) 
  60                         /** \ref HID_ReportItem_t.ItemFlags flag for array data. */ 
  61                         #define IOF_ARRAY                (0 << 1) 
  63                         /** \ref HID_ReportItem_t.ItemFlags flag for relative data. */ 
  64                         #define IOF_RELATIVE             (1 << 2) 
  66                         /** \ref HID_ReportItem_t.ItemFlags flag for absolute data. */ 
  67                         #define IOF_ABSOLUTE             (0 << 2) 
  69                         /** \ref HID_ReportItem_t.ItemFlags flag for wrapped value data. */ 
  70                         #define IOF_WRAP                 (1 << 3) 
  72                         /** \ref HID_ReportItem_t.ItemFlags flag for non-wrapped value data. */ 
  73                         #define IOF_NOWRAP               (0 << 3) 
  75                         /** \ref HID_ReportItem_t.ItemFlags flag for non linear data. */ 
  76                         #define IOF_NONLINEAR            (1 << 4) 
  78                         /** \ref HID_ReportItem_t.ItemFlags flag for linear data. */ 
  79                         #define IOF_LINEAR               (0 << 4) 
  81                         /** \ref HID_ReportItem_t.ItemFlags flag for no preferred state. */ 
  82                         #define IOF_NOPREFERRED          (1 << 5) 
  84                         /** \ref HID_ReportItem_t.ItemFlags flag for preferred state items. */ 
  85                         #define IOF_PREFERREDSTATE       (0 << 5) 
  87                         /** \ref HID_ReportItem_t.ItemFlags flag for null state items. */ 
  88                         #define IOF_NULLSTATE            (1 << 6) 
  90                         /** \ref HID_ReportItem_t.ItemFlags flag for no null position data. */ 
  91                         #define IOF_NONULLPOSITION       (0 << 6) 
  93                         /** \ref HID_ReportItem_t.ItemFlags flag for buffered bytes. */ 
  94                         #define IOF_BUFFEREDBYTES        (1 << 8) 
  96                         /** \ref HID_ReportItem_t.ItemFlags flag for bit field data. */ 
  97                         #define IOF_BITFIELD             (0 << 8) 
  99         /* Private Interface - For use in library only: */ 
 100         #if !defined(__DOXYGEN__) 
 102                         #define DATA_SIZE_MASK           0x03 
 103                         #define TYPE_MASK                0x0C 
 104                         #define TAG_MASK                 0xF0 
 106                         #define DATA_SIZE_0              0x00 
 107                         #define DATA_SIZE_1              0x01 
 108                         #define DATA_SIZE_2              0x02 
 109                         #define DATA_SIZE_4              0x03 
 111                         #define TYPE_MAIN                0x00 
 112                         #define TYPE_GLOBAL              0x04 
 113                         #define TYPE_LOCAL               0x08 
 115                         #define TAG_MAIN_INPUT           0x80 
 116                         #define TAG_MAIN_OUTPUT          0x90 
 117                         #define TAG_MAIN_COLLECTION      0xA0 
 118                         #define TAG_MAIN_FEATURE         0xB0 
 119                         #define TAG_MAIN_ENDCOLLECTION   0xC0 
 121                         #define TAG_GLOBAL_USAGEPAGE     0x00 
 122                         #define TAG_GLOBAL_LOGICALMIN    0x10 
 123                         #define TAG_GLOBAL_LOGICALMAX    0x20 
 124                         #define TAG_GLOBAL_PHYSMIN       0x30 
 125                         #define TAG_GLOBAL_PHYSMAX       0x40 
 126                         #define TAG_GLOBAL_UNITEXP       0x50 
 127                         #define TAG_GLOBAL_UNIT          0x60 
 128                         #define TAG_GLOBAL_REPORTSIZE    0x70 
 129                         #define TAG_GLOBAL_REPORTID      0x80 
 130                         #define TAG_GLOBAL_REPORTCOUNT   0x90 
 131                         #define TAG_GLOBAL_PUSH          0xA0 
 132                         #define TAG_GLOBAL_POP           0xB0 
 134                         #define TAG_LOCAL_USAGE          0x00 
 135                         #define TAG_LOCAL_USAGEMIN       0x10 
 136                         #define TAG_LOCAL_USAGEMAX       0x20