31 unsigned int size, uint32_t *bytes_read)
39 retval = ftdi_read_data(
ftdic, buf + *bytes_read,
44 ftdi_get_error_string(
ftdic));
47 *bytes_read += retval;
53 uint32_t *bytes_written)
58 retval = ftdi_write_data(
ftdic, buf,
size);
62 ftdi_get_error_string(
ftdic));
65 *bytes_written = retval;
71 uint8_t latency_timer;
74 LOG_INFO(
"usb blaster interface using libftdi");
75 if (ftdi_init(
ftdic) < 0)
84 if (ftdi_usb_reset(
ftdic) < 0) {
89 if (ftdi_set_latency_timer(
ftdic, 2) < 0) {
94 if (ftdi_get_latency_timer(
ftdic, &latency_timer) < 0)
97 LOG_DEBUG(
"current latency timer: %u", latency_timer);
99 ftdi_disable_bitbang(
ftdic);
107 ftdi_usb_close(
ftdic);
113 struct ftdi_context
ftdic;
#define ERROR_JTAG_DEVICE_ERROR
#define ERROR_JTAG_INIT_FAILED
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
static struct ftdi_context ftdic
size_t size
Size of the control block search area.
struct ftdi_context ftdic
int(* open)(struct ublast_lowlevel *low)
static int ublast_ftdi_quit(struct ublast_lowlevel *low)
struct ublast_lowlevel * ublast_register_ftdi(void)
ublast_register_ftdi - get a lowlevel USB Blaster driver ublast2_register_libusb - get a lowlevel USB...
static int ublast_ftdi_write(struct ublast_lowlevel *low, uint8_t *buf, int size, uint32_t *bytes_written)
static struct ftdi_context * ublast_getftdic(struct ublast_lowlevel *low)
static struct ublast_lowlevel_priv info
static int ublast_ftdi_read(struct ublast_lowlevel *low, uint8_t *buf, unsigned int size, uint32_t *bytes_read)
static int ublast_ftdi_init(struct ublast_lowlevel *low)
static struct ublast_lowlevel low