2 * This file is part of the libsigrok project.
4 * Copyright (C) 2017-2019 Gerhard Sittig <gerhard.sittig@gmx.net>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 /* The prefix for port names which are HID based. */
24 #define SER_HID_CONN_PREFIX "hid"
25 #define SER_HID_USB_PREFIX "usb="
26 #define SER_HID_RAW_PREFIX "raw="
27 #define SER_HID_SNR_PREFIX "sn="
30 * The maximum number of bytes any supported HID chip can communicate
31 * within a single request.
33 * CP2110: up to 63bytes
34 * CH9325: up to 7 bytes
36 #define SER_HID_CHUNK_SIZE 64
39 * Routines to get/set reports/data, provided by serial_hid.c and used
40 * in serial_hid_<chip>.c files.
42 SR_PRIV int ser_hid_hidapi_get_report(struct sr_serial_dev_inst *serial,
43 uint8_t *data, size_t len);
44 SR_PRIV int ser_hid_hidapi_set_report(struct sr_serial_dev_inst *serial,
45 const uint8_t *data, size_t len);
46 SR_PRIV int ser_hid_hidapi_get_data(struct sr_serial_dev_inst *serial,
47 uint8_t ep, uint8_t *data, size_t len, int timeout);
48 SR_PRIV int ser_hid_hidapi_set_data(struct sr_serial_dev_inst *serial,
49 uint8_t ep, const uint8_t *data, size_t len, int timeout);