Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Data Structures | |
struct | hid_ops |
USB HID device interface. More... | |
Typedefs | |
typedef int(* | hid_cb_t) (const struct device *dev, struct usb_setup_packet *setup, int32_t *len, uint8_t **data) |
typedef void(* | hid_int_ready_callback) (const struct device *dev) |
typedef void(* | hid_protocol_cb_t) (const struct device *dev, uint8_t protocol) |
typedef void(* | hid_idle_cb_t) (const struct device *dev, uint16_t report_id) |
Functions | |
void | usb_hid_register_device (const struct device *dev, const uint8_t *desc, size_t size, const struct hid_ops *op) |
Register HID device. More... | |
int | hid_int_ep_write (const struct device *dev, const uint8_t *data, uint32_t data_len, uint32_t *bytes_ret) |
Write to USB HID interrupt endpoint buffer. More... | |
int | hid_int_ep_read (const struct device *dev, uint8_t *data, uint32_t max_data_len, uint32_t *ret_bytes) |
Read from USB HID interrupt endpoint buffer. More... | |
int | usb_hid_set_proto_code (const struct device *dev, uint8_t proto_code) |
Set USB HID class Protocol Code. More... | |
int | usb_hid_init (const struct device *dev) |
Initialize USB HID class support. More... | |
typedef int(* hid_cb_t) (const struct device *dev, struct usb_setup_packet *setup, int32_t *len, uint8_t **data) |
#include <include/usb/class/usb_hid.h>
#include <include/usb/class/usb_hid.h>
#include <include/usb/class/usb_hid.h>
#include <include/usb/class/usb_hid.h>
int hid_int_ep_read | ( | const struct device * | dev, |
uint8_t * | data, | ||
uint32_t | max_data_len, | ||
uint32_t * | ret_bytes | ||
) |
#include <include/usb/class/usb_hid.h>
Read from USB HID interrupt endpoint buffer.
[in] | dev | Pointer to USB HID device |
[in] | data | Pointer to data buffer |
[in] | max_data_len | Max length of data to copy |
[out] | ret_bytes | Number of bytes to copy. If data is NULL and ret_bytes is 0 the number of bytes available in the buffer will be returned. |
int hid_int_ep_write | ( | const struct device * | dev, |
const uint8_t * | data, | ||
uint32_t | data_len, | ||
uint32_t * | bytes_ret | ||
) |
#include <include/usb/class/usb_hid.h>
Write to USB HID interrupt endpoint buffer.
[in] | dev | Pointer to USB HID device |
[in] | data | Pointer to data buffer |
[in] | data_len | Length of data to copy |
[out] | bytes_ret | Bytes written to the EP buffer. |
int usb_hid_init | ( | const struct device * | dev | ) |
#include <include/usb/class/usb_hid.h>
Initialize USB HID class support.
[in] | dev | Pointer to USB HID device |
void usb_hid_register_device | ( | const struct device * | dev, |
const uint8_t * | desc, | ||
size_t | size, | ||
const struct hid_ops * | op | ||
) |
#include <include/usb/class/usb_hid.h>
Register HID device.
[in] | dev | Pointer to USB HID device |
[in] | desc | Pointer to HID report descriptor |
[in] | size | Size of HID report descriptor |
[in] | op | Pointer to USB HID device interrupt struct |
#include <include/usb/class/usb_hid.h>
Set USB HID class Protocol Code.
Should be called before usb_hid_init().
[in] | dev | Pointer to USB HID device |
[in] | proto_code | Protocol Code to be used for bInterfaceProtocol |