#error "BUG: either FTD2XX and LIBFTDI has to be used"
#endif
-
int presto_jtag_speed(int speed);
int presto_jtag_khz(int khz, int *jtag_speed);
int presto_jtag_speed_div(int speed, int *khz);
.quit = presto_jtag_quit,
};
-
int presto_bitq_out(int tms, int tdi, int tdo_req);
int presto_bitq_flush(void);
int presto_bitq_sleep(unsigned long us);
.in = presto_bitq_in,
};
-
/* -------------------------------------------------------------------------- */
-
#define FT_DEVICE_NAME_LEN 64
#define FT_DEVICE_SERNUM_LEN 64
return result;
}
-
int presto_flush(void)
{
if (presto->buff_out_pos == 0)
return ERROR_OK;
}
-
int presto_sendbyte(int data)
{
if (data == EOF) return presto_flush();
return ERROR_OK;
}
-
int presto_getbyte(void)
{
if (presto->buff_in_pos < presto->buff_in_len)
return -1;
}
-
/* -------------------------------------------------------------------------- */
-
int presto_tdi_flush(void)
{
if (presto->jtag_tdi_count == 0)
return 0;
}
-
int presto_tck_idle(void)
{
if (presto->jtag_tck == 1)
return 0;
}
-
/* -------------------------------------------------------------------------- */
-
int presto_bitq_out(int tms, int tdi, int tdo_req)
{
int i;
return 0;
}
-
int presto_bitq_flush(void)
{
presto_tdi_flush();
return presto_flush();
}
-
int presto_bitq_in_rdy(void)
{
if (presto->buff_in_pos>=presto->buff_in_len)
return presto->buff_in_len-presto->buff_in_pos;
}
-
int presto_bitq_in(void)
{
if (presto->buff_in_pos>=presto->buff_in_len)
return 0;
}
-
int presto_bitq_sleep(unsigned long us)
{
long waits;
return 0;
}
-
int presto_bitq_reset(int trst, int srst)
{
presto_tdi_flush();
return 0;
}
-
/* -------------------------------------------------------------------------- */
-
int presto_jtag_khz(int khz, int *jtag_speed)
{
if (khz < 0)
return 0;
}
-
int presto_jtag_speed_div(int speed, int *khz)
{
if ((speed < 0) || (speed > 1000))
return 0;
}
-
int presto_jtag_speed(int speed)
{
int khz;
return 0;
}
-
char *presto_serial;
int presto_handle_serial_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
return ERROR_OK;
}
-
int presto_jtag_register_commands(struct command_context_s *cmd_ctx)
{
register_command(cmd_ctx, NULL, "presto_serial", presto_handle_serial_command,
return ERROR_OK;
}
-
int presto_jtag_init(void)
{
if (presto_open(presto_serial) != ERROR_OK)
return ERROR_OK;
}
-
int presto_jtag_quit(void)
{
bitq_cleanup();