source: mainline/uspace/lib/drv/include/usbhid_iface.h@ d7f7a4a

Last change on this file since d7f7a4a was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 4 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2010 Vojtech Horky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libdrv
8 * @{
9 */
10/** @file
11 * USB HID interface definition.
12 */
13
14#ifndef LIBDRV_USBHID_IFACE_H_
15#define LIBDRV_USBHID_IFACE_H_
16
17#include "ddf/driver.h"
18
19extern errno_t usbhid_dev_get_event_length(async_sess_t *, size_t *);
20extern errno_t usbhid_dev_get_event(async_sess_t *, uint8_t *, size_t, size_t *,
21 int *, unsigned int);
22extern errno_t usbhid_dev_get_report_descriptor_length(async_sess_t *, size_t *);
23extern errno_t usbhid_dev_get_report_descriptor(async_sess_t *, uint8_t *, size_t,
24 size_t *);
25
26/** USB HID device communication interface. */
27typedef struct {
28 /** Get size of the event in bytes.
29 *
30 * @param[in] fun DDF function answering the request.
31 * @return Size of the event in bytes.
32 */
33 size_t (*get_event_length)(ddf_fun_t *fun);
34
35 /** Get single event from the HID device.
36 *
37 * @param[in] fun DDF function answering the request.
38 * @param[out] buffer Buffer with raw data from the device.
39 * @param[out] act_size Actual number of returned events.
40 * @param[in] flags Flags (see USBHID_IFACE_FLAG_*).
41 * @return Error code.
42 */
43 errno_t (*get_event)(ddf_fun_t *fun, uint8_t *buffer, size_t size,
44 size_t *act_size, int *event_nr, unsigned int flags);
45
46 /** Get size of the report descriptor in bytes.
47 *
48 * @param[in] fun DDF function answering the request.
49 * @return Size of the report descriptor in bytes.
50 */
51 size_t (*get_report_descriptor_length)(ddf_fun_t *fun);
52
53 /** Get the report descriptor from the HID device.
54 *
55 * @param[in] fun DDF function answering the request.
56 * @param[out] desc Buffer with the report descriptor.
57 * @param[in] size Size of the allocated @p desc buffer.
58 * @param[out] act_size Actual size of the report descriptor returned.
59 * @return Error code.
60 */
61 errno_t (*get_report_descriptor)(ddf_fun_t *fun, uint8_t *desc,
62 size_t size, size_t *act_size);
63} usbhid_iface_t;
64
65#endif
66/**
67 * @}
68 */
Note: See TracBrowser for help on using the repository browser.