Loading...
Searching...
No Matches
hid_io.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Nils Ollrogge
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for
6 * more details.
7 */
8
22#ifndef USB_USBUS_HID_IO_H
23#define USB_USBUS_HID_IO_H
24
25#include <string.h>
26#include <stdint.h>
27
28#include "usb/usbus.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
37typedef void (*usb_hid_io_cb_t)(void *);
38
46
55void usb_hid_io_write(const void *buffer, size_t len);
56
69int usb_hid_io_read(void *buffer, size_t len);
70
84int usb_hid_io_read_timeout(void *buffer, size_t len, uint32_t timeout);
85
93void usb_hid_io_init(usbus_t *usbus, const uint8_t *report_desc, size_t report_desc_size);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif /* USB_USBUS_HID_IO_H */
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:37
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:448
USBUS basic interface.