This directory contains an implementation of a USB HID Driver implemented on top of the USB Host Library.
HID driver allows access to HID devices.
The following steps outline the typical API call pattern of the HID Class Driver:
-
Install the USB Host Library via 'usb_host_install()'
-
Install the HID driver via 'hid_host_install()'
-
The HID Host driver device callback provide the following events (via two callbacks):
- HID_HOST_DRIVER_EVENT_CONNECTED
- HID_HOST_INTERFACE_EVENT_INPUT_REPORT
- HID_HOST_INTERFACE_EVENT_TRANSFER_ERROR
- HID_HOST_INTERFACE_EVENT_DISCONNECTED
-
Specific HID device can be opened or closed with:
- 'hid_host_device_open()'
- 'hid_host_device_close()'
-
To enable / disable data receiving in case of event (keyboard key was pressed or mouse device was moved e.t.c) use:
- 'hid_host_device_start()'
- 'hid_host_device_stop()'
-
HID Class specific device requests:
- 'hid_host_interface_get_report_descriptor()'
- 'hid_class_request_get_report()'
- 'hid_class_request_get_idle()'
- 'hid_class_request_get_protocol()'
- 'hid_class_request_set_report()'
- 'hid_class_request_set_idle()'
- 'hid_class_request_set_protocol()'
-
When HID device event occurs the driver call an interface callback with events:
- HID_HOST_INTERFACE_EVENT_INPUT_REPORT
- HID_HOST_INTERFACE_EVENT_TRANSFER_ERROR
- HID_HOST_INTERFACE_EVENT_DISCONNECTED
-
The HID driver can be uninstalled via 'hid_host_uninstall()'
- Empty
- For an example, refer to hid_host_example
- HID Driver support any HID compatible device with a USB bIterfaceClass 0x03 (Human Interface Device).
- There are two options to handle HID device input data: either in RAW format or via special event handlers (which are available only for HID Devices which supprot Boot Protocol).