Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
USBD HID Device API. More...
Data Structures | |
struct | hid_device_ops |
HID device user callbacks. More... | |
Enumerations | |
enum | { HID_REPORT_TYPE_INPUT = 1 , HID_REPORT_TYPE_OUTPUT , HID_REPORT_TYPE_FEATURE } |
HID report types Report types used in Get/Set Report requests. More... | |
Functions | |
int | hid_device_register (const struct device *dev, const uint8_t *const rdesc, const uint16_t rsize, const struct hid_device_ops *const ops) |
Register HID device report descriptor and user callbacks. | |
int | hid_device_submit_report (const struct device *dev, const uint16_t size, const uint8_t *const report) |
Submit new input report. | |
USBD HID Device API.
anonymous enum |
#include <zephyr/usb/class/usbd_hid.h>
HID report types Report types used in Get/Set Report requests.
Enumerator | |
---|---|
HID_REPORT_TYPE_INPUT | |
HID_REPORT_TYPE_OUTPUT | |
HID_REPORT_TYPE_FEATURE |
int hid_device_register | ( | const struct device * | dev, |
const uint8_t *const | rdesc, | ||
const uint16_t | rsize, | ||
const struct hid_device_ops *const | ops | ||
) |
#include <zephyr/usb/class/usbd_hid.h>
Register HID device report descriptor and user callbacks.
The device must register report descriptor and user callbacks before USB device support is initialized and enabled.
[in] | dev | Pointer to HID device |
[in] | rdesc | Pointer to HID report descriptor |
[in] | rsize | Size of HID report descriptor |
[in] | ops | Pointer to HID device callbacks |
int hid_device_submit_report | ( | const struct device * | dev, |
const uint16_t | size, | ||
const uint8_t *const | report | ||
) |
#include <zephyr/usb/class/usbd_hid.h>
Submit new input report.
Submit a new input report to be sent via the interrupt IN pipe. If sync is true, the functions will block until the report is sent. If the device does not provide input_report_done() callback, hid_device_submit_report() will be processed synchronously.
[in] | dev | Pointer to HID device |
[in] | size | Size of the input report |
[in] | report | Input report buffer. Report buffer must be aligned. |