#include "windows.h"
#endif
-#include "replacements.h"
-
-/* project specific includes */
-#include "log.h"
-#include "types.h"
-#include "jtag.h"
-#include "configuration.h"
+#include "interface.h"
#include "time_support.h"
#include "bitq.h"
-/* system includes */
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
/* PRESTO access library includes */
#if BUILD_PRESTO_FTD2XX == 1
int jtag_tdi_count;
int jtag_speed;
-
+
} presto_t;
static presto_t presto_state;
presto->jtag_tdi_count=0;
presto->jtag_speed=0;
-
+
#if BUILD_PRESTO_FTD2XX == 1
return presto_open_ftd2xx(req_serial);
#elif BUILD_PRESTO_LIBFTDI == 1
presto_sendbyte(presto->jtag_tdi_data);
presto->jtag_tdi_count = 0;
presto->jtag_tdi_data = 0;
-
+
return 0;
}
presto_sendbyte(0xCA);
presto->jtag_tck = 0;
}
-
+
return 0;
}
if (khz >= 3000) *jtag_speed = 0;
else *jtag_speed = (1000+khz-1)/khz;
-
+
return 0;
}
if (speed == 0) *khz = 3000;
else *khz = 1000/speed;
-
+
return 0;
}
static int presto_jtag_speed(int speed)
{
int khz;
-
+
if (presto_jtag_speed_div(speed, &khz))
{
return ERROR_INVALID_ARGUMENTS;
}
presto->jtag_speed = speed;
-
+
if (khz%1000 == 0)
LOG_INFO("setting speed to %d, max. TCK freq. is %d MHz", speed, khz/1000);
else
LOG_INFO("setting speed to %d, max. TCK freq. is %d kHz", speed, khz);
-
+
return 0;
}
LOG_INFO("PRESTO open, serial number '%s'", presto->serial);
/* use JTAG speed setting from configuration file */
- presto_jtag_speed(jtag_speed);
+ presto_jtag_speed(jtag_get_speed());
bitq_interface = &presto_bitq;
return ERROR_OK;