OpenOCD
libftdi_helper.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef OPENOCD_JTAG_DRIVERS_LIBFTDI_HELPER_H
4 #define OPENOCD_JTAG_DRIVERS_LIBFTDI_HELPER_H
5 
6 #include <ftdi.h>
7 
8 #ifndef HAVE_LIBFTDI_TCIOFLUSH
9 /* Backward compatibility with libftdi pre 1.5 */
10 
11 static inline int ftdi_tciflush(struct ftdi_context *ftdi)
12 {
13  return ftdi_usb_purge_rx_buffer(ftdi);
14 }
15 
16 static inline int ftdi_tcoflush(struct ftdi_context *ftdi)
17 {
18  return ftdi_usb_purge_tx_buffer(ftdi);
19 }
20 
21 static inline int ftdi_tcioflush(struct ftdi_context *ftdi)
22 {
23  return ftdi_usb_purge_buffers(ftdi);
24 }
25 #endif
26 
27 #endif /* OPENOCD_JTAG_DRIVERS_LIBFTDI_HELPER_H */
static int ftdi_tcoflush(struct ftdi_context *ftdi)
static int ftdi_tcioflush(struct ftdi_context *ftdi)
static int ftdi_tciflush(struct ftdi_context *ftdi)