static int jlink_speed(int speed);
static int jlink_speed_div(int speed, int* khz);
static int jlink_khz(int khz, int *jtag_speed);
-static int jlink_register_commands(struct command_context_s *cmd_ctx);
+static int jlink_register_commands(struct command_context *cmd_ctx);
static int jlink_init(void);
static int jlink_quit(void);
-/* CLI command handler functions */
-static int jlink_handle_jlink_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-static int jlink_handle_jlink_hw_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
/* Queue command functions */
static void jlink_end_state(tap_state_t state);
static void jlink_state_move(void);
.quit = jlink_quit
};
-static void jlink_execute_runtest(jtag_command_t *cmd)
+static void jlink_execute_runtest(struct jtag_command *cmd)
{
DEBUG_JTAG_IO("runtest %i cycles, end in %i",
cmd->cmd.runtest->num_cycles,
jlink_runtest(cmd->cmd.runtest->num_cycles);
}
-static void jlink_execute_statemove(jtag_command_t *cmd)
+static void jlink_execute_statemove(struct jtag_command *cmd)
{
DEBUG_JTAG_IO("statemove end in %i", cmd->cmd.statemove->end_state);
jlink_state_move();
}
-static void jlink_execute_pathmove(jtag_command_t *cmd)
+static void jlink_execute_pathmove(struct jtag_command *cmd)
{
DEBUG_JTAG_IO("pathmove: %i states, end in %i",
cmd->cmd.pathmove->num_states,
cmd->cmd.pathmove->path);
}
-static void jlink_execute_scan(jtag_command_t *cmd)
+static void jlink_execute_scan(struct jtag_command *cmd)
{
int scan_size;
enum scan_type type;
type, buffer, scan_size, cmd->cmd.scan);
}
-static void jlink_execute_reset(jtag_command_t *cmd)
+static void jlink_execute_reset(struct jtag_command *cmd)
{
DEBUG_JTAG_IO("reset trst: %i srst %i",
cmd->cmd.reset->trst, cmd->cmd.reset->srst);
jlink_tap_execute();
}
-static void jlink_execute_sleep(jtag_command_t *cmd)
+static void jlink_execute_sleep(struct jtag_command *cmd)
{
DEBUG_JTAG_IO("sleep %i", cmd->cmd.sleep->us);
jlink_tap_execute();
jtag_sleep(cmd->cmd.sleep->us);
}
-static void jlink_execute_command(jtag_command_t *cmd)
+static void jlink_execute_command(struct jtag_command *cmd)
{
switch (cmd->type)
{
static int jlink_execute_queue(void)
{
- jtag_command_t *cmd = jtag_command_queue;
+ struct jtag_command *cmd = jtag_command_queue;
while (cmd != NULL)
{
return ERROR_OK;
}
-static int jlink_register_commands(struct command_context_s *cmd_ctx)
-{
-
- register_command(cmd_ctx, NULL, "jlink_info",
- &jlink_handle_jlink_info_command, COMMAND_EXEC,
- "query jlink info");
- register_command(cmd_ctx, NULL, "jlink_hw_jtag",
- &jlink_handle_jlink_hw_jtag_command, COMMAND_EXEC,
- "set/get jlink hw jtag command version [2 | 3]");
- return ERROR_OK;
-}
-
static int jlink_init(void)
{
int i;
return ERROR_OK;
}
-static int jlink_handle_jlink_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(jlink_handle_jlink_info_command)
{
if (jlink_get_version_info() == ERROR_OK)
{
return ERROR_OK;
}
-static int jlink_handle_jlink_hw_jtag_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(jlink_handle_jlink_hw_jtag_command)
{
switch (argc) {
case 0:
return ERROR_OK;
}
+static int jlink_register_commands(struct command_context *cmd_ctx)
+{
+
+ register_command(cmd_ctx, NULL, "jlink_info",
+ &jlink_handle_jlink_info_command, COMMAND_EXEC,
+ "query jlink info");
+ register_command(cmd_ctx, NULL, "jlink_hw_jtag",
+ &jlink_handle_jlink_hw_jtag_command, COMMAND_EXEC,
+ "set/get jlink hw jtag command version [2 | 3]");
+ return ERROR_OK;
+}
+
/***************************************************************************/
/* J-Link tap functions */