USB Host Shield 2.0
Classes | Macros
usbhid.h File Reference
#include "Usb.h"
#include "hidusagestr.h"
Include dependency graph for usbhid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  HidItemPrefix
 
struct  MainItemIOFeature
 
class  HIDReportParser
 
class  USBHID
 

Macros

#define MAX_REPORT_PARSERS   2
 
#define HID_MAX_HID_CLASS_DESCRIPTORS   5
 
#define DATA_SIZE_MASK   0x03
 
#define TYPE_MASK   0x0C
 
#define TAG_MASK   0xF0
 
#define DATA_SIZE_0   0x00
 
#define DATA_SIZE_1   0x01
 
#define DATA_SIZE_2   0x02
 
#define DATA_SIZE_4   0x03
 
#define TYPE_MAIN   0x00
 
#define TYPE_GLOBAL   0x04
 
#define TYPE_LOCAL   0x08
 
#define TAG_MAIN_INPUT   0x80
 
#define TAG_MAIN_OUTPUT   0x90
 
#define TAG_MAIN_COLLECTION   0xA0
 
#define TAG_MAIN_FEATURE   0xB0
 
#define TAG_MAIN_ENDCOLLECTION   0xC0
 
#define TAG_GLOBAL_USAGEPAGE   0x00
 
#define TAG_GLOBAL_LOGICALMIN   0x10
 
#define TAG_GLOBAL_LOGICALMAX   0x20
 
#define TAG_GLOBAL_PHYSMIN   0x30
 
#define TAG_GLOBAL_PHYSMAX   0x40
 
#define TAG_GLOBAL_UNITEXP   0x50
 
#define TAG_GLOBAL_UNIT   0x60
 
#define TAG_GLOBAL_REPORTSIZE   0x70
 
#define TAG_GLOBAL_REPORTID   0x80
 
#define TAG_GLOBAL_REPORTCOUNT   0x90
 
#define TAG_GLOBAL_PUSH   0xA0
 
#define TAG_GLOBAL_POP   0xB0
 
#define TAG_LOCAL_USAGE   0x00
 
#define TAG_LOCAL_USAGEMIN   0x10
 
#define TAG_LOCAL_USAGEMAX   0x20
 
#define bmREQ_HID_OUT   USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define bmREQ_HID_IN   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
 
#define bmREQ_HID_REPORT   USB_SETUP_DEVICE_TO_HOST|USB_SETUP_TYPE_STANDARD|USB_SETUP_RECIPIENT_INTERFACE
 
#define HID_REQUEST_GET_REPORT   0x01
 
#define HID_REQUEST_GET_IDLE   0x02
 
#define HID_REQUEST_GET_PROTOCOL   0x03
 
#define HID_REQUEST_SET_REPORT   0x09
 
#define HID_REQUEST_SET_IDLE   0x0A
 
#define HID_REQUEST_SET_PROTOCOL   0x0B
 
#define HID_DESCRIPTOR_HID   0x21
 
#define HID_DESCRIPTOR_REPORT   0x22
 
#define HID_DESRIPTOR_PHY   0x23
 
#define USB_HID_BOOT_PROTOCOL   0x00
 
#define HID_RPT_PROTOCOL   0x01
 
#define HID_INTF   0x03
 
#define HID_BOOT_INTF_SUBCLASS   0x01
 
#define USB_HID_PROTOCOL_NONE   0x00
 
#define USB_HID_PROTOCOL_KEYBOARD   0x01
 
#define USB_HID_PROTOCOL_MOUSE   0x02
 
#define HID_ITEM_TYPE_MAIN   0
 
#define HID_ITEM_TYPE_GLOBAL   1
 
#define HID_ITEM_TYPE_LOCAL   2
 
#define HID_ITEM_TYPE_RESERVED   3
 
#define HID_LONG_ITEM_PREFIX   0xfe
 
#define bmHID_MAIN_ITEM_TAG   0xfc
 
#define bmHID_MAIN_ITEM_INPUT   0x80
 
#define bmHID_MAIN_ITEM_OUTPUT   0x90
 
#define bmHID_MAIN_ITEM_FEATURE   0xb0
 
#define bmHID_MAIN_ITEM_COLLECTION   0xa0
 
#define bmHID_MAIN_ITEM_END_COLLECTION   0xce
 
#define HID_MAIN_ITEM_COLLECTION_PHYSICAL   0
 
#define HID_MAIN_ITEM_COLLECTION_APPLICATION   1
 
#define HID_MAIN_ITEM_COLLECTION_LOGICAL   2
 
#define HID_MAIN_ITEM_COLLECTION_REPORT   3
 
#define HID_MAIN_ITEM_COLLECTION_NAMED_ARRAY   4
 
#define HID_MAIN_ITEM_COLLECTION_USAGE_SWITCH   5
 
#define HID_MAIN_ITEM_COLLECTION_USAGE_MODIFIER   6
 

Macro Definition Documentation

◆ MAX_REPORT_PARSERS

#define MAX_REPORT_PARSERS   2

Definition at line 23 of file usbhid.h.

◆ HID_MAX_HID_CLASS_DESCRIPTORS

#define HID_MAX_HID_CLASS_DESCRIPTORS   5

Definition at line 24 of file usbhid.h.

◆ DATA_SIZE_MASK

#define DATA_SIZE_MASK   0x03

Definition at line 26 of file usbhid.h.

◆ TYPE_MASK

#define TYPE_MASK   0x0C

Definition at line 27 of file usbhid.h.

◆ TAG_MASK

#define TAG_MASK   0xF0

Definition at line 28 of file usbhid.h.

◆ DATA_SIZE_0

#define DATA_SIZE_0   0x00

Definition at line 30 of file usbhid.h.

◆ DATA_SIZE_1

#define DATA_SIZE_1   0x01

Definition at line 31 of file usbhid.h.

◆ DATA_SIZE_2

#define DATA_SIZE_2   0x02

Definition at line 32 of file usbhid.h.

◆ DATA_SIZE_4

#define DATA_SIZE_4   0x03

Definition at line 33 of file usbhid.h.

◆ TYPE_MAIN

#define TYPE_MAIN   0x00

Definition at line 35 of file usbhid.h.

◆ TYPE_GLOBAL

#define TYPE_GLOBAL   0x04

Definition at line 36 of file usbhid.h.

◆ TYPE_LOCAL

#define TYPE_LOCAL   0x08

Definition at line 37 of file usbhid.h.

◆ TAG_MAIN_INPUT

#define TAG_MAIN_INPUT   0x80

Definition at line 39 of file usbhid.h.

◆ TAG_MAIN_OUTPUT

#define TAG_MAIN_OUTPUT   0x90

Definition at line 40 of file usbhid.h.

◆ TAG_MAIN_COLLECTION

#define TAG_MAIN_COLLECTION   0xA0

Definition at line 41 of file usbhid.h.

◆ TAG_MAIN_FEATURE

#define TAG_MAIN_FEATURE   0xB0

Definition at line 42 of file usbhid.h.

◆ TAG_MAIN_ENDCOLLECTION

#define TAG_MAIN_ENDCOLLECTION   0xC0

Definition at line 43 of file usbhid.h.

◆ TAG_GLOBAL_USAGEPAGE

#define TAG_GLOBAL_USAGEPAGE   0x00

Definition at line 45 of file usbhid.h.

◆ TAG_GLOBAL_LOGICALMIN

#define TAG_GLOBAL_LOGICALMIN   0x10

Definition at line 46 of file usbhid.h.

◆ TAG_GLOBAL_LOGICALMAX

#define TAG_GLOBAL_LOGICALMAX   0x20

Definition at line 47 of file usbhid.h.

◆ TAG_GLOBAL_PHYSMIN

#define TAG_GLOBAL_PHYSMIN   0x30

Definition at line 48 of file usbhid.h.

◆ TAG_GLOBAL_PHYSMAX

#define TAG_GLOBAL_PHYSMAX   0x40

Definition at line 49 of file usbhid.h.

◆ TAG_GLOBAL_UNITEXP

#define TAG_GLOBAL_UNITEXP   0x50

Definition at line 50 of file usbhid.h.

◆ TAG_GLOBAL_UNIT

#define TAG_GLOBAL_UNIT   0x60

Definition at line 51 of file usbhid.h.

◆ TAG_GLOBAL_REPORTSIZE

#define TAG_GLOBAL_REPORTSIZE   0x70

Definition at line 52 of file usbhid.h.

◆ TAG_GLOBAL_REPORTID

#define TAG_GLOBAL_REPORTID   0x80

Definition at line 53 of file usbhid.h.

◆ TAG_GLOBAL_REPORTCOUNT

#define TAG_GLOBAL_REPORTCOUNT   0x90

Definition at line 54 of file usbhid.h.

◆ TAG_GLOBAL_PUSH

#define TAG_GLOBAL_PUSH   0xA0

Definition at line 55 of file usbhid.h.

◆ TAG_GLOBAL_POP

#define TAG_GLOBAL_POP   0xB0

Definition at line 56 of file usbhid.h.

◆ TAG_LOCAL_USAGE

#define TAG_LOCAL_USAGE   0x00

Definition at line 58 of file usbhid.h.

◆ TAG_LOCAL_USAGEMIN

#define TAG_LOCAL_USAGEMIN   0x10

Definition at line 59 of file usbhid.h.

◆ TAG_LOCAL_USAGEMAX

#define TAG_LOCAL_USAGEMAX   0x20

Definition at line 60 of file usbhid.h.

◆ bmREQ_HID_OUT

Definition at line 63 of file usbhid.h.

◆ bmREQ_HID_IN

Definition at line 64 of file usbhid.h.

◆ bmREQ_HID_REPORT

Definition at line 65 of file usbhid.h.

◆ HID_REQUEST_GET_REPORT

#define HID_REQUEST_GET_REPORT   0x01

Definition at line 69 of file usbhid.h.

◆ HID_REQUEST_GET_IDLE

#define HID_REQUEST_GET_IDLE   0x02

Definition at line 70 of file usbhid.h.

◆ HID_REQUEST_GET_PROTOCOL

#define HID_REQUEST_GET_PROTOCOL   0x03

Definition at line 71 of file usbhid.h.

◆ HID_REQUEST_SET_REPORT

#define HID_REQUEST_SET_REPORT   0x09

Definition at line 72 of file usbhid.h.

◆ HID_REQUEST_SET_IDLE

#define HID_REQUEST_SET_IDLE   0x0A

Definition at line 73 of file usbhid.h.

◆ HID_REQUEST_SET_PROTOCOL

#define HID_REQUEST_SET_PROTOCOL   0x0B

Definition at line 74 of file usbhid.h.

◆ HID_DESCRIPTOR_HID

#define HID_DESCRIPTOR_HID   0x21

Definition at line 77 of file usbhid.h.

◆ HID_DESCRIPTOR_REPORT

#define HID_DESCRIPTOR_REPORT   0x22

Definition at line 78 of file usbhid.h.

◆ HID_DESRIPTOR_PHY

#define HID_DESRIPTOR_PHY   0x23

Definition at line 79 of file usbhid.h.

◆ USB_HID_BOOT_PROTOCOL

#define USB_HID_BOOT_PROTOCOL   0x00

Definition at line 82 of file usbhid.h.

◆ HID_RPT_PROTOCOL

#define HID_RPT_PROTOCOL   0x01

Definition at line 83 of file usbhid.h.

◆ HID_INTF

#define HID_INTF   0x03

Definition at line 86 of file usbhid.h.

◆ HID_BOOT_INTF_SUBCLASS

#define HID_BOOT_INTF_SUBCLASS   0x01

Definition at line 89 of file usbhid.h.

◆ USB_HID_PROTOCOL_NONE

#define USB_HID_PROTOCOL_NONE   0x00

Definition at line 92 of file usbhid.h.

◆ USB_HID_PROTOCOL_KEYBOARD

#define USB_HID_PROTOCOL_KEYBOARD   0x01

Definition at line 93 of file usbhid.h.

◆ USB_HID_PROTOCOL_MOUSE

#define USB_HID_PROTOCOL_MOUSE   0x02

Definition at line 94 of file usbhid.h.

◆ HID_ITEM_TYPE_MAIN

#define HID_ITEM_TYPE_MAIN   0

Definition at line 96 of file usbhid.h.

◆ HID_ITEM_TYPE_GLOBAL

#define HID_ITEM_TYPE_GLOBAL   1

Definition at line 97 of file usbhid.h.

◆ HID_ITEM_TYPE_LOCAL

#define HID_ITEM_TYPE_LOCAL   2

Definition at line 98 of file usbhid.h.

◆ HID_ITEM_TYPE_RESERVED

#define HID_ITEM_TYPE_RESERVED   3

Definition at line 99 of file usbhid.h.

◆ HID_LONG_ITEM_PREFIX

#define HID_LONG_ITEM_PREFIX   0xfe

Definition at line 101 of file usbhid.h.

◆ bmHID_MAIN_ITEM_TAG

#define bmHID_MAIN_ITEM_TAG   0xfc

Definition at line 103 of file usbhid.h.

◆ bmHID_MAIN_ITEM_INPUT

#define bmHID_MAIN_ITEM_INPUT   0x80

Definition at line 105 of file usbhid.h.

◆ bmHID_MAIN_ITEM_OUTPUT

#define bmHID_MAIN_ITEM_OUTPUT   0x90

Definition at line 106 of file usbhid.h.

◆ bmHID_MAIN_ITEM_FEATURE

#define bmHID_MAIN_ITEM_FEATURE   0xb0

Definition at line 107 of file usbhid.h.

◆ bmHID_MAIN_ITEM_COLLECTION

#define bmHID_MAIN_ITEM_COLLECTION   0xa0

Definition at line 108 of file usbhid.h.

◆ bmHID_MAIN_ITEM_END_COLLECTION

#define bmHID_MAIN_ITEM_END_COLLECTION   0xce

Definition at line 109 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_PHYSICAL

#define HID_MAIN_ITEM_COLLECTION_PHYSICAL   0

Definition at line 111 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_APPLICATION

#define HID_MAIN_ITEM_COLLECTION_APPLICATION   1

Definition at line 112 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_LOGICAL

#define HID_MAIN_ITEM_COLLECTION_LOGICAL   2

Definition at line 113 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_REPORT

#define HID_MAIN_ITEM_COLLECTION_REPORT   3

Definition at line 114 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_NAMED_ARRAY

#define HID_MAIN_ITEM_COLLECTION_NAMED_ARRAY   4

Definition at line 115 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_USAGE_SWITCH

#define HID_MAIN_ITEM_COLLECTION_USAGE_SWITCH   5

Definition at line 116 of file usbhid.h.

◆ HID_MAIN_ITEM_COLLECTION_USAGE_MODIFIER

#define HID_MAIN_ITEM_COLLECTION_USAGE_MODIFIER   6

Definition at line 117 of file usbhid.h.