libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
hid.h
Go to the documentation of this file.
1
/** @defgroup usb_hid_defines USB HID Type Definitions
2
3
@brief <b>Defined Constants and Types for the USB HID Type Definitions</b>
4
5
@ingroup USB_defines
6
7
@version 1.0.0
8
9
@author @htmlonly © @endhtmlonly 2010
10
Gareth McMullin <gareth@blacksphere.co.nz>
11
12
@date 10 March 2013
13
14
LGPL License Terms @ref lgpl_license
15
*/
16
17
/*
18
* This file is part of the libopencm3 project.
19
*
20
* Copyright (C) 2010 Gareth McMullin <gareth@blacksphere.co.nz>
21
*
22
* This library is free software: you can redistribute it and/or modify
23
* it under the terms of the GNU Lesser General Public License as published by
24
* the Free Software Foundation, either version 3 of the License, or
25
* (at your option) any later version.
26
*
27
* This library is distributed in the hope that it will be useful,
28
* but WITHOUT ANY WARRANTY; without even the implied warranty of
29
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30
* GNU Lesser General Public License for more details.
31
*
32
* You should have received a copy of the GNU Lesser General Public License
33
* along with this library. If not, see <http://www.gnu.org/licenses/>.
34
*/
35
36
/**@{*/
37
38
#ifndef __HID_H
39
#define __HID_H
40
41
#include <stdint.h>
42
43
#define USB_CLASS_HID 3
44
45
/* USB HID 4.2 */
46
#define USB_HID_SUBCLASS_NO 0
47
#define USB_HID_SUBCLASS_BOOT_INTERFACE 1
48
49
/* USB HID 4.3 */
50
#define USB_HID_INTERFACE_PROTOCOL_NONE 0
51
#define USB_HID_INTERFACE_PROTOCOL_KEYBOARD 1
52
#define USB_HID_INTERFACE_PROTOCOL_MOUSE 2
53
54
/* USB HID 7.1 */
55
#define USB_HID_DT_HID 0x21
56
#define USB_HID_DT_REPORT 0x22
57
#define USB_HID_DT_PHYSICAL 0x23
58
/** @deprecated Use @ref USB_HID_DT_HID */
59
#define USB_DT_HID USB_HID_DT_HID
60
/** @deprecated Use @ref USB_HID_DT_REPORT */
61
#define USB_DT_REPORT USB_HID_DT_REPORT
62
63
/* USB HID 7.2 */
64
#define USB_HID_REQ_TYPE_GET_REPORT 0x01
65
#define USB_HID_REQ_TYPE_GET_IDLE 0x02
66
#define USB_HID_REQ_TYPE_GET_PROTOCOL 0x03
67
#define USB_HID_REQ_TYPE_SET_REPORT 0x09
68
#define USB_HID_REQ_TYPE_SET_IDLE 0x0A
69
#define USB_HID_REQ_TYPE_SET_PROTOCOL 0x0B
70
71
/* USB HID 7.2.1 */
72
#define USB_HID_REPORT_TYPE_INPUT 1
73
#define USB_HID_REPORT_TYPE_OUTPUT 2
74
#define USB_HID_REPORT_TYPE_FEATURE 3
75
76
/* USB HID 7.2.5 */
77
#define USB_HID_PROTOCOL_BOOT 0
78
#define USB_HID_PROTOCOL_REPORT 1
79
80
struct
usb_hid_descriptor
{
81
uint8_t
bLength
;
82
uint8_t
bDescriptorType
;
83
uint16_t
bcdHID
;
84
uint8_t
bCountryCode
;
85
uint8_t
bNumDescriptors
;
86
} __attribute__((packed));
87
88
#endif
89
90
/**@}*/
91
usb_hid_descriptor
Definition:
hid.h:80
usb_hid_descriptor::bDescriptorType
uint8_t bDescriptorType
Definition:
hid.h:82
usb_hid_descriptor::bNumDescriptors
uint8_t bNumDescriptors
Definition:
hid.h:85
usb_hid_descriptor::bCountryCode
uint8_t bCountryCode
Definition:
hid.h:84
usb_hid_descriptor::bLength
uint8_t bLength
Definition:
hid.h:81
usb_hid_descriptor::bcdHID
uint16_t bcdHID
Definition:
hid.h:83
include
libopencm3
usb
hid.h
Generated on Tue Mar 7 2023 16:11:49 for libopencm3 by
1.9.4