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 
9 #pragma once
10 
24 #include <string.h>
25 #include <stdint.h>
26 
27 #include "usb/usbus.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
36 typedef void (*usb_hid_io_cb_t)(void *);
37 
45 
54 void usb_hid_io_write(const void *buffer, size_t len);
55 
68 int usb_hid_io_read(void *buffer, size_t len);
69 
83 int usb_hid_io_read_timeout(void *buffer, size_t len, uint32_t timeout);
84 
92 void usb_hid_io_init(usbus_t *usbus, const uint8_t *report_desc, size_t report_desc_size);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
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:36
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:447
USBUS basic interface.