hidtypes.h

Go to the documentation of this file.
00001 
00008 #ifndef TYPE_H
00009 #define TYPE_H
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif /* __cplusplus */
00014 
00015 #include <sys/types.h>
00016 
00017 /* 
00018  * Types
00019  */
00020 #if !AIX
00021 typedef unsigned char  uchar;
00022 #endif
00023 
00024 #if HPUX || __APPLE__
00025 typedef unsigned long  ulong;
00026 #endif
00027 
00028 typedef short          wchar;
00029 
00030 /* 
00031  * Constants
00032  */
00033 #define PATH_SIZE               10 
00034 #define USAGE_TAB_SIZE          50 
00037 #define MAX_REPORT             300
00038 
00040 #define REPORT_DSC_SIZE       6144
00041 
00042 /* 
00043  * Items
00044  * -------------------------------------------------------------------------- */
00045 #define SIZE_0                0x00
00046 #define SIZE_1                0x01
00047 #define SIZE_2                0x02
00048 #define SIZE_4                0x03
00049 #define SIZE_MASK             0x03
00050                               
00051 #define TYPE_MAIN             0x00
00052 #define TYPE_GLOBAL           0x04
00053 #define TYPE_LOCAL            0x08
00054 #define TYPE_MASK             0x0C
00055 
00056 /* Main items */
00057 #define ITEM_COLLECTION       0xA0
00058 #define ITEM_END_COLLECTION   0xC0
00059 #define ITEM_FEATURE          0xB0
00060 #define ITEM_INPUT            0x80
00061 #define ITEM_OUTPUT           0x90
00062 
00063 /* Global items */
00064 #define ITEM_UPAGE            0x04
00065 #define ITEM_LOG_MIN          0x14
00066 #define ITEM_LOG_MAX          0x24
00067 #define ITEM_PHY_MIN          0x34
00068 #define ITEM_PHY_MAX          0x44
00069 #define ITEM_UNIT_EXP         0x54
00070 #define ITEM_UNIT             0x64
00071 #define ITEM_REP_SIZE         0x74
00072 #define ITEM_REP_ID           0x84
00073 #define ITEM_REP_COUNT        0x94
00074 
00075 /* Local items */
00076 #define ITEM_USAGE            0x08
00077 #define ITEM_STRING           0x78
00078 
00079 /* Long item */
00080 #define ITEM_LONG       0xFC
00081 
00082 #define ITEM_MASK             0xFC
00083 
00084 /* Attribute Flags */
00085 #define ATTR_DATA_CST         0x01
00086 #define ATTR_NVOL_VOL         0x80
00087 
00091 typedef struct
00092 {
00093   ushort UPage;
00094   ushort Usage;
00095 } HIDNode;
00096 
00100 typedef struct
00101 {
00102   uchar   Size;             
00103   HIDNode Node[PATH_SIZE];  
00104 } HIDPath;
00105 
00109 typedef struct
00110 {
00111   long    Value;            
00112   HIDPath Path;             
00114   uchar   ReportID;         
00115   uchar   Offset;           
00116   uchar   Size;             
00118   uchar   Type;             
00119   uchar   Attribute;        
00121   ulong   Unit;             
00122   char    UnitExp;          
00124   long    LogMin;           
00125   long    LogMax;           
00126   long    PhyMin;           
00127   long    PhyMax;           
00128 } HIDData;
00129 
00130 /* -------------------------------------------------------------------------- */
00131 typedef struct
00132 {
00133   uchar   ReportDesc[REPORT_DSC_SIZE];  
00134   ushort  ReportDescSize;               
00135   ushort  Pos;                          
00136   uchar   Item;                         
00137   long    Value;                        
00139   HIDData Data;                         
00141   uchar   OffsetTab[MAX_REPORT][3];     
00142   uchar   ReportCount;                  
00143   uchar   Count;                        
00145   ushort  UPage;                        
00146   HIDNode UsageTab[USAGE_TAB_SIZE];     
00147   uchar   UsageSize;                    
00149   uchar   nObject;                      
00150   uchar   nReport;                      
00151 } HIDParser;
00152 
00153 #ifdef __cplusplus
00154 } /* extern "C" */
00155 #endif /* __cplusplus */
00156 
00157 #endif

Generated on Sun Mar 30 15:28:24 2008 for libhid by  doxygen 1.5.1