Atmel Software Framework

hid.h File Reference

Data Structures

struct  hid_descriptor_t
 HID descriptor. More...
 
union  hid_item_t
 HID report descriptor item. More...
 
union  hid_short_item_data_t
 HID report descriptor short item data. More...
 

Macros

HID Descriptor Types
#define HID_DESCRIPTOR   0x21
 
#define HID_REPORT_DESCRIPTOR   0x22
 
#define HID_PHYSICAL_DESCRIPTOR   0x23
 
Constants of field DESCRIPTOR_HID
#define HID_BDC   0x0111
 Numeric expression identifying the HID Class Specification release (here V1.11) More...
 
#define HID_CLASS_DESC_NB_DEFAULT   0x01
 Numeric expression specifying the number of class descriptors (always at least one i.e. More...
 
HID Country Codes
#define HID_COUNTRY_CODE_NOT_SUPPORTED   0
 
#define HID_COUNTRY_CODE_ARABIC   1
 
#define HID_COUNTRY_CODE_BELGIAN   2
 
#define HID_COUNTRY_CODE_CANADIAN_BILINGUAL   3
 
#define HID_COUNTRY_CODE_CANADIAN_FRENCH   4
 
#define HID_COUNTRY_CODE_CZECH_REPUBLIC   5
 
#define HID_COUNTRY_CODE_DANISH   6
 
#define HID_COUNTRY_CODE_FINNISH   7
 
#define HID_COUNTRY_CODE_FRENCH   8
 
#define HID_COUNTRY_CODE_GERMAN   9
 
#define HID_COUNTRY_CODE_GREEK   10
 
#define HID_COUNTRY_CODE_HEBREW   11
 
#define HID_COUNTRY_CODE_HUNGARY   12
 
#define HID_COUNTRY_CODE_INTERNATIONAL_ISO   13
 
#define HID_COUNTRY_CODE_ITALIAN   14
 
#define HID_COUNTRY_CODE_JAPAN_KATAKANA   15
 
#define HID_COUNTRY_CODE_KOREAN   16
 
#define HID_COUNTRY_CODE_LATIN_AMERICAN   17
 
#define HID_COUNTRY_CODE_NETHERLANDS_DUTCH   18
 
#define HID_COUNTRY_CODE_NORWEGIAN   19
 
#define HID_COUNTRY_CODE_PERSIAN_FARSI   20
 
#define HID_COUNTRY_CODE_POLAND   21
 
#define HID_COUNTRY_CODE_PORTUGUESE   22
 
#define HID_COUNTRY_CODE_RUSSIA   23
 
#define HID_COUNTRY_CODE_SLOVAKIA   24
 
#define HID_COUNTRY_CODE_SPANISH   25
 
#define HID_COUNTRY_CODE_SWEDISH   26
 
#define HID_COUNTRY_CODE_SWISS_FRENCH   27
 
#define HID_COUNTRY_CODE_SWISS_GERMAN   28
 
#define HID_COUNTRY_CODE_SWITZERLAND   29
 
#define HID_COUNTRY_CODE_TAIWAN   30
 
#define HID_COUNTRY_CODE_TURKISH_Q   31
 
#define HID_COUNTRY_CODE_UK   32
 
#define HID_COUNTRY_CODE_US   33
 
#define HID_COUNTRY_CODE_YUGOSLAVIA   34
 
#define HID_COUNTRY_CODE_TURKISH_F   35
 
HID KEYS values
#define HID_A   4
 
#define HID_B   5
 
#define HID_C   6
 
#define HID_D   7
 
#define HID_E   8
 
#define HID_F   9
 
#define HID_G   10
 
#define HID_H   11
 
#define HID_I   12
 
#define HID_J   13
 
#define HID_K   14
 
#define HID_L   15
 
#define HID_M   16
 
#define HID_N   17
 
#define HID_O   18
 
#define HID_P   19
 
#define HID_Q   20
 
#define HID_R   21
 
#define HID_S   22
 
#define HID_T   23
 
#define HID_U   24
 
#define HID_V   25
 
#define HID_W   26
 
#define HID_X   27
 
#define HID_Y   28
 
#define HID_Z   29
 
#define HID_1   30
 
#define HID_2   31
 
#define HID_3   32
 
#define HID_4   33
 
#define HID_5   34
 
#define HID_6   35
 
#define HID_7   36
 
#define HID_8   37
 
#define HID_9   38
 
#define HID_0   39
 
#define HID_ENTER   40
 
#define HID_ESCAPE   41
 
#define HID_BACKSPACE   42
 
#define HID_TAB   43
 
#define HID_SPACEBAR   44
 
#define HID_UNDERSCORE   45
 
#define HID_PLUS   46
 
#define HID_BACKSLASH   49
 
#define HID_TILDE   53
 
#define HID_COMMA   54
 
#define HID_DOT   55
 
#define HID_SLASH   56
 
#define HID_CAPS   LOCK 57
 
#define HID_F1   58
 
#define HID_F2   59
 
#define HID_F3   60
 
#define HID_F4   61
 
#define HID_F5   62
 
#define HID_F6   63
 
#define HID_F7   64
 
#define HID_F8   65
 
#define HID_F9   66
 
#define HID_F10   67
 
#define HID_F11   68
 
#define HID_F12   69
 
#define HID_PRINTSCREEN   70
 
#define HID_SCROLL   LOCK 71
 
#define HID_PAUSE   72
 
#define HID_INSERT   73
 
#define HID_HOME   74
 
#define HID_PAGEUP   75
 
#define HID_DELETE   76
 
#define HID_END   77
 
#define HID_PAGEDOWN   78
 
#define HID_RIGHT   79
 
#define HID_LEFT   80
 
#define HID_DOWN   81
 
#define HID_UP   82
 
#define HID_KEYPAD_NUM_LOCK   83
 
#define HID_KEYPAD_DIVIDE   84
 
#define HID_KEYPAD_AT   85
 
#define HID_KEYPAD_MULTIPLY   85
 
#define HID_KEYPAD_MINUS   86
 
#define HID_KEYPAD_PLUS   87
 
#define HID_KEYPAD_ENTER   88
 
#define HID_KEYPAD_1   89
 
#define HID_KEYPAD_2   90
 
#define HID_KEYPAD_3   91
 
#define HID_KEYPAD_4   92
 
#define HID_KEYPAD_5   93
 
#define HID_KEYPAD_6   94
 
#define HID_KEYPAD_7   95
 
#define HID_KEYPAD_8   96
 
#define HID_KEYPAD_9   97
 
#define HID_KEYPAD_0   98
 
HID modifier values
#define HID_MODIFIER_NONE   0x00
 
#define HID_MODIFIER_LEFT_CTRL   0x01
 
#define HID_MODIFIER_LEFT_SHIFT   0x02
 
#define HID_MODIFIER_LEFT_ALT   0x04
 
#define HID_MODIFIER_LEFT_GUI   0x08
 
#define HID_MODIFIER_RIGHT_CTRL   0x10
 
#define HID_MODIFIER_RIGHT_SHIFT   0x20
 
#define HID_MODIFIER_RIGHT_ALT   0x40
 
#define HID_MODIFIER_RIGHT_GUI   0x80
 
HID Requests
#define HID_GET_REPORT   0x01
 
#define HID_GET_IDLE   0x02
 
#define HID_GET_PROTOCOL   0x03
 
#define HID_SET_REPORT   0x09
 
#define HID_SET_IDLE   0x0A
 
#define HID_SET_PROTOCOL   0x0B
 
HID Report Types
#define HID_REPORT_INPUT   0x01
 
#define HID_REPORT_OUTPUT   0x02
 
#define HID_REPORT_FEATURE   0x03
 
Special HID Report IDs
#define HID_REPORT_ID_ALL   0x00
 
Special HID Idle Durations
#define HID_IDLE_DURATION_INDEFINITE   0x00
 
HID Protocols
#define HID_BOOT_PROTOCOL   0x00
 
#define HID_REPORT_PROTOCOL   0x01
 
HID Report Descriptor Item Types
#define HID_ITEM_TYPE_MAIN   0x00
 
#define HID_ITEM_TYPE_GLOBAL   0x01
 
#define HID_ITEM_TYPE_LOCAL   0x02
 
#define HID_ITEM_TYPE_RESERVED   0x03
 
Special HID Report Descriptor Item Tags
#define HID_ITEM_TAG_LONG_ITEM   0x0F
 
HID Report Descriptor Main Item Tags
#define HID_MAIN_ITEM_TAG_INPUT   0x08
 
#define HID_MAIN_ITEM_TAG_OUTPUT   0x09
 
#define HID_MAIN_ITEM_TAG_FEATURE   0x0B
 
#define HID_MAIN_ITEM_TAG_COLLECTION   0x0A
 
#define HID_MAIN_ITEM_TAG_END_COLLECTION   0x0C
 
HID Report Descriptor Global Item Tags
#define HID_GLOBAL_ITEM_TAG_USAGE_PAGE   0x00
 
#define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM   0x01
 
#define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM   0x02
 
#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM   0x03
 
#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM   0x04
 
#define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT   0x05
 
#define HID_GLOBAL_ITEM_TAG_UNIT   0x06
 
#define HID_GLOBAL_ITEM_TAG_REPORT_SIZE   0x07
 
#define HID_GLOBAL_ITEM_TAG_REPORT_ID   0x08
 
#define HID_GLOBAL_ITEM_TAG_REPORT_COUNT   0x09
 
#define HID_GLOBAL_ITEM_TAG_PUSH   0x0A
 
#define HID_GLOBAL_ITEM_TAG_POP   0x0B
 
HID Report Descriptor Local Item Tags
#define HID_LOCAL_ITEM_TAG_USAGE   0x00
 
#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM   0x01
 
#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM   0x02
 
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX   0x03
 
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM   0x04
 
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM   0x05
 
#define HID_LOCAL_ITEM_TAG_STRING_INDEX   0x07
 
#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM   0x08
 
#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM   0x09
 
#define HID_LOCAL_ITEM_TAG_DELIMITER   0x0A
 

Typedefs

typedef unsigned char hid_report_id_t
 HID report ID. More...
 

#define HID_0   39
#define HID_1   30
#define HID_2   31
#define HID_3   32
#define HID_4   33
#define HID_5   34
#define HID_6   35
#define HID_7   36
#define HID_8   37
#define HID_9   38
#define HID_A   4
#define HID_B   5
#define HID_BACKSLASH   49
#define HID_BACKSPACE   42
#define HID_BDC   0x0111

Numeric expression identifying the HID Class Specification release (here V1.11)

#define HID_BOOT_PROTOCOL   0x00
#define HID_C   6
#define HID_CAPS   LOCK 57
#define HID_CLASS_DESC_NB_DEFAULT   0x01

Numeric expression specifying the number of class descriptors (always at least one i.e.

Report descriptor.)

#define HID_COMMA   54
#define HID_COUNTRY_CODE_ARABIC   1
#define HID_COUNTRY_CODE_BELGIAN   2
#define HID_COUNTRY_CODE_CANADIAN_BILINGUAL   3
#define HID_COUNTRY_CODE_CANADIAN_FRENCH   4
#define HID_COUNTRY_CODE_CZECH_REPUBLIC   5
#define HID_COUNTRY_CODE_DANISH   6
#define HID_COUNTRY_CODE_FINNISH   7
#define HID_COUNTRY_CODE_FRENCH   8
#define HID_COUNTRY_CODE_GERMAN   9
#define HID_COUNTRY_CODE_GREEK   10
#define HID_COUNTRY_CODE_HEBREW   11
#define HID_COUNTRY_CODE_HUNGARY   12
#define HID_COUNTRY_CODE_INTERNATIONAL_ISO   13
#define HID_COUNTRY_CODE_ITALIAN   14
#define HID_COUNTRY_CODE_JAPAN_KATAKANA   15
#define HID_COUNTRY_CODE_KOREAN   16
#define HID_COUNTRY_CODE_LATIN_AMERICAN   17
#define HID_COUNTRY_CODE_NETHERLANDS_DUTCH   18
#define HID_COUNTRY_CODE_NORWEGIAN   19
#define HID_COUNTRY_CODE_NOT_SUPPORTED   0
#define HID_COUNTRY_CODE_PERSIAN_FARSI   20
#define HID_COUNTRY_CODE_POLAND   21
#define HID_COUNTRY_CODE_PORTUGUESE   22
#define HID_COUNTRY_CODE_RUSSIA   23
#define HID_COUNTRY_CODE_SLOVAKIA   24
#define HID_COUNTRY_CODE_SPANISH   25
#define HID_COUNTRY_CODE_SWEDISH   26
#define HID_COUNTRY_CODE_SWISS_FRENCH   27
#define HID_COUNTRY_CODE_SWISS_GERMAN   28
#define HID_COUNTRY_CODE_SWITZERLAND   29
#define HID_COUNTRY_CODE_TAIWAN   30
#define HID_COUNTRY_CODE_TURKISH_F   35
#define HID_COUNTRY_CODE_TURKISH_Q   31
#define HID_COUNTRY_CODE_UK   32
#define HID_COUNTRY_CODE_US   33
#define HID_COUNTRY_CODE_YUGOSLAVIA   34
#define HID_D   7
#define HID_DELETE   76
#define HID_DESCRIPTOR   0x21
#define HID_DOT   55
#define HID_DOWN   81
#define HID_E   8
#define HID_END   77
#define HID_ENTER   40
#define HID_ESCAPE   41
#define HID_F   9
#define HID_F1   58
#define HID_F10   67
#define HID_F11   68
#define HID_F12   69
#define HID_F2   59
#define HID_F3   60
#define HID_F4   61
#define HID_F5   62
#define HID_F6   63
#define HID_F7   64
#define HID_F8   65
#define HID_F9   66
#define HID_G   10
#define HID_GET_IDLE   0x02
#define HID_GET_PROTOCOL   0x03
#define HID_GET_REPORT   0x01
#define HID_GLOBAL_ITEM_TAG_LOGICAL_MAXIMUM   0x02
#define HID_GLOBAL_ITEM_TAG_LOGICAL_MINIMUM   0x01
#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM   0x04
#define HID_GLOBAL_ITEM_TAG_PHYSICAL_MINIMUM   0x03
#define HID_GLOBAL_ITEM_TAG_POP   0x0B
#define HID_GLOBAL_ITEM_TAG_PUSH   0x0A
#define HID_GLOBAL_ITEM_TAG_REPORT_COUNT   0x09
#define HID_GLOBAL_ITEM_TAG_REPORT_ID   0x08
#define HID_GLOBAL_ITEM_TAG_REPORT_SIZE   0x07
#define HID_GLOBAL_ITEM_TAG_UNIT   0x06
#define HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT   0x05
#define HID_GLOBAL_ITEM_TAG_USAGE_PAGE   0x00
#define HID_H   11
#define HID_HOME   74
#define HID_I   12
#define HID_IDLE_DURATION_INDEFINITE   0x00

Referenced by host_mouse_hid_task().

#define HID_INSERT   73
#define HID_ITEM_TAG_LONG_ITEM   0x0F

Referenced by host_hid_get_item().

#define HID_ITEM_TYPE_GLOBAL   0x01
#define HID_ITEM_TYPE_LOCAL   0x02
#define HID_ITEM_TYPE_MAIN   0x00
#define HID_ITEM_TYPE_RESERVED   0x03
#define HID_J   13
#define HID_K   14
#define HID_KEYPAD_0   98
#define HID_KEYPAD_1   89
#define HID_KEYPAD_2   90
#define HID_KEYPAD_3   91
#define HID_KEYPAD_4   92
#define HID_KEYPAD_5   93
#define HID_KEYPAD_6   94
#define HID_KEYPAD_7   95
#define HID_KEYPAD_8   96
#define HID_KEYPAD_9   97
#define HID_KEYPAD_AT   85
#define HID_KEYPAD_DIVIDE   84
#define HID_KEYPAD_ENTER   88
#define HID_KEYPAD_MINUS   86
#define HID_KEYPAD_MULTIPLY   85
#define HID_KEYPAD_NUM_LOCK   83
#define HID_KEYPAD_PLUS   87
#define HID_L   15
#define HID_LEFT   80
#define HID_LOCAL_ITEM_TAG_DELIMITER   0x0A
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_INDEX   0x03
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MAXIMUM   0x05
#define HID_LOCAL_ITEM_TAG_DESIGNATOR_MINIMUM   0x04
#define HID_LOCAL_ITEM_TAG_STRING_INDEX   0x07
#define HID_LOCAL_ITEM_TAG_STRING_MAXIMUM   0x09
#define HID_LOCAL_ITEM_TAG_STRING_MINIMUM   0x08
#define HID_LOCAL_ITEM_TAG_USAGE   0x00
#define HID_LOCAL_ITEM_TAG_USAGE_MAXIMUM   0x02
#define HID_LOCAL_ITEM_TAG_USAGE_MINIMUM   0x01
#define HID_M   16
#define HID_MAIN_ITEM_TAG_COLLECTION   0x0A
#define HID_MAIN_ITEM_TAG_END_COLLECTION   0x0C
#define HID_MAIN_ITEM_TAG_FEATURE   0x0B
#define HID_MAIN_ITEM_TAG_INPUT   0x08
#define HID_MAIN_ITEM_TAG_OUTPUT   0x09
#define HID_MODIFIER_LEFT_ALT   0x04
#define HID_MODIFIER_LEFT_CTRL   0x01
#define HID_MODIFIER_LEFT_GUI   0x08
#define HID_MODIFIER_LEFT_SHIFT   0x02
#define HID_MODIFIER_NONE   0x00
#define HID_MODIFIER_RIGHT_ALT   0x40
#define HID_MODIFIER_RIGHT_CTRL   0x10
#define HID_MODIFIER_RIGHT_GUI   0x80
#define HID_MODIFIER_RIGHT_SHIFT   0x20
#define HID_N   17
#define HID_O   18
#define HID_P   19
#define HID_PAGEDOWN   78
#define HID_PAGEUP   75
#define HID_PAUSE   72
#define HID_PHYSICAL_DESCRIPTOR   0x23

Referenced by usb_user_read_request().

#define HID_PLUS   46
#define HID_PRINTSCREEN   70
#define HID_Q   20
#define HID_R   21
#define HID_REPORT_DESCRIPTOR   0x22
#define HID_REPORT_FEATURE   0x03

Referenced by usb_user_read_request().

#define HID_REPORT_ID_ALL   0x00

Referenced by host_mouse_hid_task().

#define HID_REPORT_INPUT   0x01

Referenced by usb_user_read_request().

#define HID_REPORT_OUTPUT   0x02

Referenced by usb_user_read_request().

#define HID_REPORT_PROTOCOL   0x01
#define HID_RIGHT   79
#define HID_S   22
#define HID_SCROLL   LOCK 71
#define HID_SET_IDLE   0x0A
#define HID_SET_PROTOCOL   0x0B
#define HID_SET_REPORT   0x09
#define HID_SLASH   56
#define HID_SPACEBAR   44
#define HID_T   23
#define HID_TAB   43
#define HID_TILDE   53
#define HID_U   24
#define HID_UNDERSCORE   45
#define HID_UP   82
#define HID_V   25
#define HID_W   26
#define HID_X   27
#define HID_Y   28
#define HID_Z   29

typedef unsigned char hid_report_id_t

HID report ID.