*
* @returns ERROR_OK on success, or ERROR_JTAG_QUEUE_FAILED on failure.
*/
-static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd);
+static int ft2232_stableclocks(int num_cycles, struct jtag_command* cmd);
static char * ft2232_device_desc_A = NULL;
static char* ft2232_device_desc = NULL;
static uint16_t ft2232_vid[MAX_USB_IDS + 1] = { 0x0403, 0 };
static uint16_t ft2232_pid[MAX_USB_IDS + 1] = { 0x6010, 0 };
-typedef struct ft2232_layout_s
-{
+struct ft2232_layout {
char* name;
int (*init)(void);
void (*reset)(int trst, int srst);
void (*blink)(void);
-} ft2232_layout_t;
+};
/* init procedures for supported layouts */
static int usbjtag_init(void);
static void signalyzer_h_blink(void);
static void ktlink_blink(void);
-static const ft2232_layout_t ft2232_layouts[] =
+static const struct ft2232_layout ft2232_layouts[] =
{
{ "usbjtag", usbjtag_init, usbjtag_reset, NULL },
{ "jtagkey", jtagkey_init, jtagkey_reset, NULL },
static uint8_t nTRST, nTRSTnOE, nSRST, nSRSTnOE;
-static const ft2232_layout_t *layout;
+static const struct ft2232_layout *layout;
static uint8_t low_output = 0x0;
static uint8_t low_direction = 0x0;
static uint8_t high_output = 0x0;
static enum ftdi_chip_type ftdi_device;
#endif
-static jtag_command_t* first_unsent; /* next command that has to be sent */
+static struct jtag_command* first_unsent; /* next command that has to be sent */
static int require_send;
/* http://urjtag.wiki.sourceforge.net/Cable + FT2232 says:
LOG_DEBUG("%s", line);
}
-static int ft2232_send_and_recv(jtag_command_t* first, jtag_command_t* last)
+static int ft2232_send_and_recv(struct jtag_command* first, struct jtag_command* last)
{
- jtag_command_t* cmd;
+ struct jtag_command* cmd;
uint8_t* buffer;
int scan_size;
enum scan_type type;
}
}
-static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, uint8_t* buffer, int scan_size)
+static int ft2232_large_scan(struct scan_command* cmd, enum scan_type type, uint8_t* buffer, int scan_size)
{
int num_bytes = (scan_size + 7) / 8;
int bits_left = scan_size;
LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction);
}
-static int ft2232_execute_runtest(jtag_command_t *cmd)
+static int ft2232_execute_runtest(struct jtag_command *cmd)
{
int retval;
int i;
return retval;
}
-static int ft2232_execute_statemove(jtag_command_t *cmd)
+static int ft2232_execute_statemove(struct jtag_command *cmd)
{
int predicted_size = 0;
int retval = ERROR_OK;
return retval;
}
-static int ft2232_execute_pathmove(jtag_command_t *cmd)
+static int ft2232_execute_pathmove(struct jtag_command *cmd)
{
int predicted_size = 0;
int retval = ERROR_OK;
return retval;
}
-static int ft2232_execute_scan(jtag_command_t *cmd)
+static int ft2232_execute_scan(struct jtag_command *cmd)
{
uint8_t* buffer;
int scan_size; /* size of IR or DR scan */
}
-static int ft2232_execute_reset(jtag_command_t *cmd)
+static int ft2232_execute_reset(struct jtag_command *cmd)
{
int retval;
int predicted_size = 0;
return retval;
}
-static int ft2232_execute_sleep(jtag_command_t *cmd)
+static int ft2232_execute_sleep(struct jtag_command *cmd)
{
int retval;
retval = ERROR_OK;
- DEBUG_JTAG_IO("sleep %i", cmd->cmd.sleep->us);
+ DEBUG_JTAG_IO("sleep %" PRIi32, cmd->cmd.sleep->us);
if (ft2232_send_and_recv(first_unsent, cmd) != ERROR_OK)
retval = ERROR_JTAG_QUEUE_FAILED;
first_unsent = cmd->next;
jtag_sleep(cmd->cmd.sleep->us);
- DEBUG_JTAG_IO("sleep %i usec while in %s",
+ DEBUG_JTAG_IO("sleep %" PRIi32 " usec while in %s",
cmd->cmd.sleep->us,
tap_state_name(tap_get_state()));
return retval;
}
-static int ft2232_execute_stableclocks(jtag_command_t *cmd)
+static int ft2232_execute_stableclocks(struct jtag_command *cmd)
{
int retval;
retval = ERROR_OK;
return retval;
}
-static int ft2232_execute_command(jtag_command_t *cmd)
+static int ft2232_execute_command(struct jtag_command *cmd)
{
int retval;
retval = ERROR_OK;
static int ft2232_execute_queue(void)
{
- jtag_command_t* cmd = jtag_command_queue; /* currently processed command */
+ struct jtag_command* cmd = jtag_command_queue; /* currently processed command */
int retval;
first_unsent = cmd; /* next command that has to be sent */
uint8_t buf[1];
int retval;
uint32_t bytes_written;
- const ft2232_layout_t* cur_layout = ft2232_layouts;
+ const struct ft2232_layout* cur_layout = ft2232_layouts;
int i;
if (tap_get_tms_path_len(TAP_IRPAUSE,TAP_IRPAUSE) == 7)
return ERROR_OK;
}
-static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd)
+static int ft2232_stableclocks(int num_cycles, struct jtag_command* cmd)
{
int retval = 0;
buffer_write(high_direction);
}
-static int ft2232_register_commands(struct command_context_s* cmd_ctx)
+static int ft2232_register_commands(struct command_context* cmd_ctx)
{
register_command(cmd_ctx, NULL, "ft2232_device_desc",
ft2232_handle_device_desc_command, COMMAND_CONFIG,
}
-jtag_interface_t ft2232_interface = {
+struct jtag_interface ft2232_interface = {
.name = "ft2232",
.register_commands = &ft2232_register_commands,
.init = &ft2232_init,