15#define USB_CLASS_HID 3
18#define USB_SUBCLASS_HID_BOOT 1
21#define USBHID_SET_PROTOCOL \
22 ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
23 USB_REQUEST_TYPE ( 0x0b ) )
26#define USBHID_PROTOCOL_BOOT 0
29#define USBHID_PROTOCOL_REPORT 1
32#define USBHID_SET_IDLE \
33 ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
34 USB_REQUEST_TYPE ( 0x0a ) )
37#define USBHID_SET_REPORT \
38 ( USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE | \
39 USB_REQUEST_TYPE ( 0x09 ) )
42#define USBHID_REPORT_INPUT 0x01
45#define USBHID_REPORT_OUTPUT 0x02
48#define USBHID_REPORT_FEATURE 0x03
107 unsigned int report,
unsigned int duration ) {
127 unsigned int type,
unsigned int report,
void *
data,
#define NULL
NULL pointer (VOID *)
uint32_t type
Operating system type.
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
u16 duration
Microseconds to reserve link.
Universal Serial Bus (USB)
static void usb_endpoint_init(struct usb_endpoint *ep, struct usb_device *usb, struct usb_endpoint_driver_operations *driver)
Initialise USB endpoint.
uint16_t protocol
Protocol ID.
A USB configuration descriptor.
USB endpoint driver operations.
struct usb_device * usb
USB device.
A USB human interface device.
struct usb_endpoint in
Interrupt IN endpoint.
struct usb_function * func
USB function.
struct usb_endpoint out
Interrupt OUT endpoint (optional)
int usb_control(struct usb_device *usb, unsigned int request, unsigned int value, unsigned int index, void *data, size_t len)
Issue USB control transaction.
int usbhid_refill(struct usb_hid *hid)
Refill USB human interface device endpoints.
int usbhid_describe(struct usb_hid *hid, struct usb_configuration_descriptor *config)
Describe USB human interface device.
static int usbhid_set_idle(struct usb_device *usb, unsigned int interface, unsigned int report, unsigned int duration)
Set idle time.
static int usbhid_set_protocol(struct usb_device *usb, unsigned int interface, unsigned int protocol)
Set protocol.
#define USBHID_SET_PROTOCOL
Set protocol.
static int usbhid_set_report(struct usb_device *usb, unsigned int interface, unsigned int type, unsigned int report, void *data, size_t len)
Set report.
static void usbhid_init(struct usb_hid *hid, struct usb_function *func, struct usb_endpoint_driver_operations *in, struct usb_endpoint_driver_operations *out)
Initialise USB human interface device.
void usbhid_close(struct usb_hid *hid)
Close USB human interface device.
#define USBHID_SET_REPORT
Set report.
int usbhid_open(struct usb_hid *hid)
Open USB human interface device.
#define USBHID_SET_IDLE
Set idle time.