2.26.1. usb_host_class_hid — Human Interface Device (HID)

In computing, the USB human interface device class (USB HID class) is a part of the USB specification for computer peripherals: it specifies a device class (a type of computer hardware) for human interface devices such as keyboards, mice, game controllers and alphanumeric display devices.

More information on Wikipedia.


Source code: src/drivers/usb/host/class/hid.h, src/drivers/usb/host/class/hid.c


Defines

USB_CLASS_HID_SUBCLASS_NONE
USB_CLASS_HID_SUBCLASS_BOOT_INTERFACE
USB_CLASS_HID_PROTOCOL_NONE
USB_CLASS_HID_PROTOCOL_KEYBOARD
USB_CLASS_HID_PROTOCOL_MOUSE

Functions

int usb_host_class_hid_init(struct usb_host_class_hid_driver_t *self_p, struct usb_host_driver_t *usb_p, struct usb_host_class_hid_device_t *devices_p, size_t length)

Initialize driver object from given configuration.

Return
zero(0) or negative error code.
Parameters
  • self_p -

    Driver object to be initialized.

  • usb_p -

    USB driver to use.

  • devices_p -

    Array of devices. One entry in this array is allocated for each HID device that is connected to the host.

  • length -

    Length of the devices array.

int usb_host_class_hid_start(struct usb_host_class_hid_driver_t *self_p)

Starts the HID driver.

Return
zero(0) or negative error code.
Parameters
  • self_p -

    Initialized driver object to start.

int usb_host_class_hid_stop(struct usb_host_class_hid_driver_t *self_p)

Stops the HID driver.

Return
zero(0) or negative error code.
Parameters
  • self_p -

    Initialized to stop.

struct usb_host_class_hid_device_t

Public Members

uint8_t buf[1]
struct usb_host_class_hid_driver_t

Public Members

struct usb_host_driver_t *usb_p
struct usb_host_class_hid_device_t *devices_p
size_t length
size_t size
struct usb_host_class_hid_driver_t::@12 usb_host_class_hid_driver_t::report
struct usb_host_device_driver_t device_driver