hid_io.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 Nils Ollrogge
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <string.h>
22 #include <stdint.h>
23 
24 #include "usb/usbus.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 typedef void (*usb_hid_io_cb_t)(void *);
34 
42 
51 void usb_hid_io_write(const void *buffer, size_t len);
52 
65 int usb_hid_io_read(void *buffer, size_t len);
66 
80 int usb_hid_io_read_timeout(void *buffer, size_t len, uint32_t timeout);
81 
89 void usb_hid_io_init(usbus_t *usbus, const uint8_t *report_desc, size_t report_desc_size);
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
int usb_hid_io_read_timeout(void *buffer, size_t len, uint32_t timeout)
Read data from USB HID OUT endpoint (with timeout, blocking)
void usb_hid_io_write(const void *buffer, size_t len)
Write data to USB HID IN endpoint buffer.
void usb_hid_io_init(usbus_t *usbus, const uint8_t *report_desc, size_t report_desc_size)
Initialize an USB HID IO interface.
void(* usb_hid_io_cb_t)(void *)
USBUS HID IO RX callback function.
Definition: hid_io.h:33
void usb_hid_io_set_rx_cb(usb_hid_io_cb_t cb, void *arg)
Set USBUS HID IO RX callback.
int usb_hid_io_read(void *buffer, size_t len)
Read data from USB HID OUT endpoint (blocking)
USBUS context struct.
Definition: usbus.h:444
USBUS basic interface.