USBUS HID IO interface module.
More...
USBUS HID IO interface module.
|
file | hid_io.h |
| USB HID callback and read/write functions.
|
|
|
typedef void(* | usb_hid_io_cb_t) (void *) |
| USBUS HID IO RX callback function.
|
|
◆ usb_hid_io_cb_t
typedef void(* usb_hid_io_cb_t) (void *) |
USBUS HID IO RX callback function.
Definition at line 37 of file hid_io.h.
◆ usb_hid_io_init()
void usb_hid_io_init |
( |
usbus_t * |
usbus, |
|
|
const uint8_t * |
report_desc, |
|
|
size_t |
report_desc_size |
|
) |
| |
Initialize an USB HID IO interface.
- Parameters
-
[in] | usbus | USBUS context |
[in] | report_desc | USB_HID report descriptor |
[in] | report_desc_size | size of USB_HID report descriptor |
◆ usb_hid_io_read()
int usb_hid_io_read |
( |
void * |
buffer, |
|
|
size_t |
len |
|
) |
| |
Read data from USB HID OUT endpoint (blocking)
Wrapper for isrpipe_read
- Precondition
buffer != NULL
- Parameters
-
[out] | buffer | buffer to read data into |
[in] | len | length of buffer |
- Returns
- Number of bytes read
◆ usb_hid_io_read_timeout()
int usb_hid_io_read_timeout |
( |
void * |
buffer, |
|
|
size_t |
len, |
|
|
uint32_t |
timeout |
|
) |
| |
Read data from USB HID OUT endpoint (with timeout, blocking)
Wrapper for isrpipe_read_timeout
- Precondition
buffer != NULL
- Parameters
-
[out] | buffer | buffer to read data into |
[in] | len | length of buffer |
[in] | timeout | timeout in microseconds |
- Returns
- Number of bytes read
◆ usb_hid_io_set_rx_cb()
Set USBUS HID IO RX callback.
- Parameters
-
[in] | cb | callback function to use |
[in] | arg | argument that will be passed to cb |
◆ usb_hid_io_write()
void usb_hid_io_write |
( |
const void * |
buffer, |
|
|
size_t |
len |
|
) |
| |
Write data to USB HID IN endpoint buffer.
- Precondition
buffer != NULL
- Parameters
-
[in] | buffer | buffer containing data to write |
[in] | len | length of buffer |