drivers: libusb1_common code cleanup
[openocd.git] / src / jtag / drivers / usb_blaster / ublast_access.h
1 /*
2 * Driver for USB-JTAG, Altera USB-Blaster and compatibles
3 *
4 * Inspired from original code from Kolja Waschk's USB-JTAG project
5 * (http://www.ixo.de/info/usb_jtag/), and from openocd project.
6 *
7 * Copyright (C) 2013 Franck Jullien franck.jullien@gmail.com
8 * Copyright (C) 2012 Robert Jarzmik robert.jarzmik@free.fr
9 * Copyright (C) 2011 Ali Lown ali@lown.me.uk
10 * Copyright (C) 2009 Catalin Patulea cat@vv.carleton.ca
11 * Copyright (C) 2006 Kolja Waschk usbjtag@ixo.de
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 *
26 */
27
28 #ifndef OPENOCD_JTAG_DRIVERS_USB_BLASTER_UBLAST_ACCESS_H
29 #define OPENOCD_JTAG_DRIVERS_USB_BLASTER_UBLAST_ACCESS_H
30
31 #include <libusb_common.h>
32
33 /* Low level flags */
34 #define COPY_TDO_BUFFER (1 << 0)
35
36 struct ublast_lowlevel {
37 uint16_t ublast_vid;
38 uint16_t ublast_pid;
39 uint16_t ublast_vid_uninit;
40 uint16_t ublast_pid_uninit;
41 char *ublast_device_desc;
42 struct libusb_device_handle *libusb_dev;
43 char *firmware_path;
44
45 int (*write)(struct ublast_lowlevel *low, uint8_t *buf, int size,
46 uint32_t *bytes_written);
47 int (*read)(struct ublast_lowlevel *low, uint8_t *buf, unsigned size,
48 uint32_t *bytes_read);
49 int (*open)(struct ublast_lowlevel *low);
50 int (*close)(struct ublast_lowlevel *low);
51 int (*speed)(struct ublast_lowlevel *low, int speed);
52
53 void *priv;
54 int flags;
55 };
56
57 /**
58 * ublast_register_ftdi - get a lowlevel USB Blaster driver
59 * ublast2_register_libusb - get a lowlevel USB Blaster II driver
60 *
61 * Get a lowlevel USB-Blaster driver. In the current implementation, there are 2
62 * possible lowlevel drivers :
63 * - one based on libftdi,
64 * - one based on libusb, specific to the USB-Blaster II
65 *
66 * Returns the lowlevel driver structure.
67 */
68 extern struct ublast_lowlevel *ublast_register_ftdi(void);
69 extern struct ublast_lowlevel *ublast2_register_libusb(void);
70
71 #endif /* OPENOCD_JTAG_DRIVERS_USB_BLASTER_UBLAST_ACCESS_H */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)