#include <ftdi.h>
#endif
-/* enable this to debug io latency
- */
-#if 0
-#define _DEBUG_USB_IO_
-#endif
-
-/* enable this to debug communication
- */
-#if 0
-#define _DEBUG_USB_COMMS_
-#endif
-
-int ft2232_execute_queue(void);
+static int ft2232_execute_queue(void);
-int ft2232_speed(int speed);
-int ft2232_speed_div(int speed, int* khz);
-int ft2232_khz(int khz, int* jtag_speed);
-int ft2232_register_commands(struct command_context_s* cmd_ctx);
-int ft2232_init(void);
-int ft2232_quit(void);
+static int ft2232_speed(int speed);
+static int ft2232_speed_div(int speed, int* khz);
+static int ft2232_khz(int khz, int* jtag_speed);
+static int ft2232_register_commands(struct command_context_s* cmd_ctx);
+static int ft2232_init(void);
+static int ft2232_quit(void);
-int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
-int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
+static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc);
/**
static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd);
-char * ft2232_device_desc_A = NULL;
-char* ft2232_device_desc = NULL;
-char* ft2232_serial = NULL;
-char* ft2232_layout = NULL;
-unsigned char ft2232_latency = 2;
+static char * ft2232_device_desc_A = NULL;
+static char* ft2232_device_desc = NULL;
+static char* ft2232_serial = NULL;
+static char* ft2232_layout = NULL;
+static unsigned char ft2232_latency = 2;
#define MAX_USB_IDS 8
/* vid = pid = 0 marks the end of the list */
} ft2232_layout_t;
/* init procedures for supported layouts */
-int usbjtag_init(void);
-int jtagkey_init(void);
-int olimex_jtag_init(void);
-int flyswatter_init(void);
-int turtle_init(void);
-int comstick_init(void);
-int stm32stick_init(void);
-int axm0432_jtag_init(void);
-int sheevaplug_init(void);
+static int usbjtag_init(void);
+static int jtagkey_init(void);
+static int olimex_jtag_init(void);
+static int flyswatter_init(void);
+static int turtle_init(void);
+static int comstick_init(void);
+static int stm32stick_init(void);
+static int axm0432_jtag_init(void);
+static int sheevaplug_init(void);
/* reset procedures for supported layouts */
-void usbjtag_reset(int trst, int srst);
-void jtagkey_reset(int trst, int srst);
-void olimex_jtag_reset(int trst, int srst);
-void flyswatter_reset(int trst, int srst);
-void turtle_reset(int trst, int srst);
-void comstick_reset(int trst, int srst);
-void stm32stick_reset(int trst, int srst);
-void axm0432_jtag_reset(int trst, int srst);
-void sheevaplug_reset(int trst, int srst);
+static void usbjtag_reset(int trst, int srst);
+static void jtagkey_reset(int trst, int srst);
+static void olimex_jtag_reset(int trst, int srst);
+static void flyswatter_reset(int trst, int srst);
+static void turtle_reset(int trst, int srst);
+static void comstick_reset(int trst, int srst);
+static void stm32stick_reset(int trst, int srst);
+static void axm0432_jtag_reset(int trst, int srst);
+static void sheevaplug_reset(int trst, int srst);
/* blink procedures for layouts that support a blinking led */
-void olimex_jtag_blink(void);
-void flyswatter_jtag_blink(void);
-void turtle_jtag_blink(void);
+static void olimex_jtag_blink(void);
+static void flyswatter_jtag_blink(void);
+static void turtle_jtag_blink(void);
ft2232_layout_t ft2232_layouts[] =
{
.quit = ft2232_quit,
};
-int ft2232_write(u8* buf, int size, u32* bytes_written)
+static int ft2232_write(u8* buf, int size, u32* bytes_written)
{
#if BUILD_FT2232_FTD2XX == 1
FT_STATUS status;
}
-int ft2232_read(u8* buf, u32 size, u32* bytes_read)
+static int ft2232_read(u8* buf, u32 size, u32* bytes_read)
{
#if BUILD_FT2232_FTD2XX == 1
DWORD dw_bytes_read;
}
-int ft2232_speed(int speed)
+static int ft2232_speed(int speed)
{
u8 buf[3];
int retval;
}
-int ft2232_speed_div(int speed, int* khz)
+static int ft2232_speed_div(int speed, int* khz)
{
/* Take a look in the FT2232 manual,
* AN2232C-01 Command Processor for
}
-int ft2232_khz(int khz, int* jtag_speed)
+static int ft2232_khz(int khz, int* jtag_speed)
{
if (khz==0)
{
}
-int ft2232_register_commands(struct command_context_s* cmd_ctx)
+static int ft2232_register_commands(struct command_context_s* cmd_ctx)
{
register_command(cmd_ctx, NULL, "ft2232_device_desc", ft2232_handle_device_desc_command,
COMMAND_CONFIG, "the USB device description of the FTDI FT2232 device");
}
-void ft2232_read_scan(enum scan_type type, u8* buffer, int scan_size)
+static void ft2232_read_scan(enum scan_type type, u8* buffer, int scan_size)
{
int num_bytes = (scan_size + 7) / 8;
int bits_left = scan_size;
}
-void ft2232_debug_dump_buffer(void)
+static void ft2232_debug_dump_buffer(void)
{
int i;
char line[256];
}
-int ft2232_send_and_recv(jtag_command_t* first, jtag_command_t* last)
+static int ft2232_send_and_recv(jtag_command_t* first, jtag_command_t* last)
{
jtag_command_t* cmd;
u8* buffer;
timeval_subtract(&d_inter2, &inter2, &start);
timeval_subtract(&d_end, &end, &start);
- LOG_INFO("inter: %i.%06i, inter2: %i.%06i end: %i.%06i", d_inter.tv_sec, d_inter.tv_usec, d_inter2.tv_sec,
- d_inter2.tv_usec, d_end.tv_sec,
- d_end.tv_usec);
+ LOG_INFO("inter: %u.%06u, inter2: %u.%06u end: %u.%06u",
+ (unsigned)d_inter.tv_sec, (unsigned)d_inter.tv_usec,
+ (unsigned)d_inter2.tv_sec, (unsigned)d_inter2.tv_usec,
+ (unsigned)d_end.tv_sec, (unsigned)d_end.tv_usec);
#endif
ft2232_buffer_size = bytes_read;
}
-void ft2232_add_pathmove(pathmove_command_t* cmd)
+static void ft2232_add_pathmove(pathmove_command_t* cmd)
{
int num_states = cmd->num_states;
int state_count = 0;
}
-int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, u8* buffer, int scan_size)
+static int ft2232_large_scan(scan_command_t* cmd, enum scan_type type, u8* buffer, int scan_size)
{
int num_bytes = (scan_size + 7) / 8;
int bits_left = scan_size;
}
-int ft2232_predict_scan_out(int scan_size, enum scan_type type)
+static int ft2232_predict_scan_out(int scan_size, enum scan_type type)
{
int predicted_size = 3;
int num_bytes = (scan_size - 1) / 8;
}
-int ft2232_predict_scan_in(int scan_size, enum scan_type type)
+static int ft2232_predict_scan_in(int scan_size, enum scan_type type)
{
int predicted_size = 0;
}
-void usbjtag_reset(int trst, int srst)
+static void usbjtag_reset(int trst, int srst)
{
if (trst == 1)
{
}
-void jtagkey_reset(int trst, int srst)
+static void jtagkey_reset(int trst, int srst)
{
if (trst == 1)
{
}
-void olimex_jtag_reset(int trst, int srst)
+static void olimex_jtag_reset(int trst, int srst)
{
if (trst == 1)
{
}
-void axm0432_jtag_reset(int trst, int srst)
+static void axm0432_jtag_reset(int trst, int srst)
{
if (trst == 1)
{
}
-void flyswatter_reset(int trst, int srst)
+static void flyswatter_reset(int trst, int srst)
{
if (trst == 1)
{
}
-void turtle_reset(int trst, int srst)
+static void turtle_reset(int trst, int srst)
{
trst = trst;
}
-void comstick_reset(int trst, int srst)
+static void comstick_reset(int trst, int srst)
{
if (trst == 1)
{
}
-void stm32stick_reset(int trst, int srst)
+static void stm32stick_reset(int trst, int srst)
{
if (trst == 1)
{
-void sheevaplug_reset(int trst, int srst)
+static void sheevaplug_reset(int trst, int srst)
{
if (trst == 1)
high_output &= ~nTRST;
LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction);
}
-int ft2232_execute_queue()
+static int ft2232_execute_queue()
{
jtag_command_t* cmd = jtag_command_queue; /* currently processed command */
u8* buffer;
#endif /* BUILD_FT2232_LIBFTDI == 1 */
-int ft2232_init(void)
+static int ft2232_init(void)
{
u8 buf[1];
int retval;
}
-int usbjtag_init(void)
+static int usbjtag_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int axm0432_jtag_init(void)
+static int axm0432_jtag_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int jtagkey_init(void)
+static int jtagkey_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int olimex_jtag_init(void)
+static int olimex_jtag_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int flyswatter_init(void)
+static int flyswatter_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int turtle_init(void)
+static int turtle_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int comstick_init(void)
+static int comstick_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int stm32stick_init(void)
+static int stm32stick_init(void)
{
u8 buf[3];
u32 bytes_written;
}
-int sheevaplug_init(void)
+static int sheevaplug_init(void)
{
u8 buf[3];
u32 bytes_written;
return ERROR_OK;
}
-void olimex_jtag_blink(void)
+static void olimex_jtag_blink(void)
{
/* Olimex ARM-USB-OCD has a LED connected to ACBUS3
* ACBUS3 is bit 3 of the GPIOH port
}
-void flyswatter_jtag_blink(void)
+static void flyswatter_jtag_blink(void)
{
/*
* Flyswatter has two LEDs connected to ACBUS2 and ACBUS3
}
-void turtle_jtag_blink(void)
+static void turtle_jtag_blink(void)
{
/*
* Turtelizer2 has two LEDs connected to ACBUS2 and ACBUS3
}
-int ft2232_quit(void)
+static int ft2232_quit(void)
{
#if BUILD_FT2232_FTD2XX == 1
FT_STATUS status;
}
-int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+static int ft2232_handle_device_desc_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
{
char *cp;
char buf[200];
}
-int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+static int ft2232_handle_serial_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
{
if (argc == 1)
{
}
-int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+static int ft2232_handle_layout_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
{
if (argc == 0)
return ERROR_OK;
}
-int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+static int ft2232_handle_vid_pid_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
{
int i;
}
-int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
+static int ft2232_handle_latency_command(struct command_context_s* cmd_ctx, char* cmd, char** args, int argc)
{
if (argc == 1)
{