Loading...
Searching...
No Matches

Definition for USB HID interfaces. More...

Detailed Description

Definition for USB HID interfaces.

Author
Nils Ollrogge nils..nosp@m.ollr.nosp@m.ogge@.nosp@m.fu-b.nosp@m.erlin.nosp@m..de

Definition in file hid.h.

#include <stdint.h>
#include "usb/hid/hid_usage.h"
+ Include dependency graph for hid.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  usb_desc_hid_t
 USB HID descriptor struct. More...
 

Macros

#define USB_TYPE_DESCRIPTOR_HID   0x21
 USB HID type descriptor.
 
#define USB_HID_VERSION_BCD   0x0110
 USB HID version in BCD.
 
#define USB_HID_COUNTRY_CODE_NOTSUPPORTED   0x00
 USB HID country codes.
 
#define USBUS_HID_EP_IN_REQUIRED_NUMOF   1
 Number of IN EPs required for the HID interface.
 
#define USBUS_HID_EP_OUT_REQUIRED_NUMOF   1
 Number of Out EPs required for the HID interface.
 
#define USB_HID_ITEM_TYPE_MAIN   0x0
 HID Main item type.
 
#define USB_HID_ITEM_TYPE_GLOBAL   0x1
 HID Global item type.
 
#define USB_HID_ITEM_TYPE_LOCAL   0x2
 HID Local item type.
 
#define USB_HID_ITEM_TAG_INPUT   0x8
 HID Input item tag.
 
#define USB_HID_ITEM_TAG_OUTPUT   0x9
 HID Output item tag.
 
#define USB_HID_ITEM_TAG_COLLECTION   0xA
 HID Collection item tag.
 
#define USB_HID_ITEM_TAG_FEATURE   0xB
 HID Feature item tag.
 
#define USB_HID_ITEM_TAG_COLLECTION_END   0xC
 HID End Collection item tag.
 
#define USB_HID_ITEM_TAG_USAGE_PAGE   0x0
 HID Usage Page item tag.
 
#define USB_HID_ITEM_TAG_LOGICAL_MIN   0x1
 HID Logical Minimum item tag.
 
#define USB_HID_ITEM_TAG_LOGICAL_MAX   0x2
 HID Logical Maximum item tag.
 
#define USB_HID_ITEM_TAG_PHYSICAL_MIN   0x3
 HID Physical Minimum item tag.
 
#define USB_HID_ITEM_TAG_PHYSICAL_MAX   0x4
 HID Physical Maximum item tag.
 
#define USB_HID_ITEM_TAG_UNIT_EXPONENT   0x5
 HID Unit Exponent item tag.
 
#define USB_HID_ITEM_TAG_UNIT   0x6
 HID Unit item tag.
 
#define USB_HID_ITEM_TAG_REPORT_SIZE   0x7
 HID Report Size item tag.
 
#define USB_HID_ITEM_TAG_REPORT_ID   0x8
 HID Report ID item tag.
 
#define USB_HID_ITEM_TAG_REPORT_COUNT   0x9
 HID Report count item tag.
 
#define USB_HID_ITEM_TAG_USAGE   0x0
 HID Usage item tag.
 
#define USB_HID_ITEM_TAG_USAGE_MIN   0x1
 HID Usage Minimum item tag.
 
#define USB_HID_ITEM_TAG_USAGE_MAX   0x2
 HID Usage Maximum item tag.
 
#define USB_HID_COLLECTION_PHYSICAL   0x00
 Physical collection type.
 
#define USB_HID_COLLECTION_APPLICATION   0x01
 Application collection type.
 
#define USB_HID_COLLECTION_LOGICAL   0x02
 Logical (interrelated data) collection type.
 
#define USB_HID_COLLECTION_REPORT   0x03
 Report collection type.
 
#define USB_HID_COLLECTION_NAMED_ARRAY   0x04
 Named array collection type.
 
#define USB_HID_COLLECTION_USAGE_SWITCH   0x05
 Usage switch collection type.
 
#define USB_HID_COLLECTION_USAGE_MOD   0x06
 Modifier switch collection type.
 
#define USB_HID_ITEM(tag, type, size)    (((tag & 0xF) << 4) | ((type & 0x3) << 2) | (size & 0x3))
 Defines a HID descriptor short item.
 
#define USB_HID_INPUT(input)
 Defines a HID descriptor input item.
 
#define USB_HID_OUTPUT(output)
 Defines a HID descriptor output item.
 
#define USB_HID_FEATURE(feature)
 Defines a HID Feature item.
 
#define USB_HID_COLLECTION(collection)
 Defines a HID Collection item.
 
#define USB_HID_END_COLLECTION    USB_HID_ITEM(USB_HID_ITEM_TAG_COLLECTION_END, USB_HID_ITEM_TYPE_MAIN, 0)
 Defines a HID End Collection item.
 
#define USB_HID_USAGE_PAGE(page)
 Defines a HID Usage Page item.
 
#define USB_HID_USAGE_PAGE16(page)
 Defines a HID Usage Page item.
 
#define USB_HID_LOGICAL_MIN8(minimum)
 Defines a HID Logical Minimum item.
 
#define USB_HID_LOGICAL_MIN16(minimum)
 Defines a HID Logical Minimum item.
 
#define USB_HID_LOGICAL_MIN32(minimum)
 Defines a HID Logical Minimum item.
 
#define USB_HID_LOGICAL_MAX8(maximum)
 Defines a HID Logical Maximum item.
 
#define USB_HID_LOGICAL_MAX16(maximum)
 Defines a HID Logical Maximum item.
 
#define USB_HID_LOGICAL_MAX32(maximum)
 Defines a HID Logical Maximum item.
 
#define USB_HID_REPORT_SIZE(size)
 Defines a HID Report Size item.
 
#define USB_HID_REPORT_ID(id)
 Defines a HID Report ID item.
 
#define USB_HID_REPORT_COUNT(count)
 Define HID Report Count item.
 
#define USB_HID_USAGE(index)
 Defines a HID Usage Index item.
 
#define USB_HID_USAGE_MIN8(start)
 Defines a HID Usage Minimum item.
 
#define USB_HID_USAGE_MIN16(start)
 Define HID Usage Minimum item with the data length of two bytes.
 
#define USB_HID_USAGE_MAX8(end)
 Defines HID Usage Maximum item.
 
#define USB_HID_USAGE_MAX16(end)
 Defines HID Usage Maximum item.
 

USB HID subclass types

#define USB_HID_SUBCLASS_NONE   0x0
 
#define USB_HID_SUBCLASS_BOOT   0x1
 

USB HID protocol types

#define USB_HID_PROTOCOL_NONE   0x0
 
#define USB_HID_PROTOCOL_KEYBOARD   0x1
 
#define USB_HID_PROTOCOL_MOUSE   0x2
 

USB HID descriptor types

#define USB_HID_DESCR_HID   0x21
 
#define USB_HID_DESCR_REPORT   0x22
 
#define USB_HID_DESCR_PHYSICAL   0x23
 

USB HID class specific control requests

#define USB_HID_REQUEST_GET_REPORT   0x01
 
#define USB_HID_REQUEST_GET_IDLE   0x02
 
#define USB_HID_REQUEST_GET_PROTOCOL   0x03
 
#define USB_HID_REQUEST_SET_REPORT   0x09
 
#define USB_HID_REQUEST_SET_IDLE   0x0a
 
#define USB_HID_REQUEST_SET_PROTOCOL   0x0b