script: shorten jtag_* command names
Drop the get_/set_/_pin/_list noise from the JTAG commands (e.g. jtag_get_probes_list -> jtag_probes, jtag_set_spi_cs_pin -> jtag_spi_cs, jtag_spi_rd_wr -> jtag_spi_xfer). jtag_open_probe -> jtag_open (not jtag_probe, which would clash with jtag_probes under tab-completion). Hard rename, no aliases. Updates the state-dump emitter, help text, example script and docs accordingly.
This commit is contained in:
@@ -1736,7 +1736,7 @@ const char *cmd_print_probes_list_help[] = {
|
||||
"Displays the list of detected probes.", // Explanations
|
||||
""
|
||||
};
|
||||
/* Map the flat index shown by jtag_get_probes_list (0, 1, 2, ...) to the
|
||||
/* Map the flat index shown by jtag_probes (0, 1, 2, ...) to the
|
||||
* encoded (drv << 8 | probe) id, walking drivers/probes in the same order
|
||||
* the list prints them. Returns -1 if the index is out of range. */
|
||||
static int resolve_flat_probe_index(jtag_core *jc, int flat)
|
||||
@@ -1776,7 +1776,7 @@ static int cmd_print_probes_list(script_ctx *ctx, char *line)
|
||||
while (i < nb_of_probes)
|
||||
{
|
||||
jtagcore_get_probe_name(jc, PROBE_ID(j, i), probe_list);
|
||||
// [flat index] is what to pass to jtag_open_probe; the
|
||||
// [flat index] is what to pass to jtag_open; the
|
||||
// 0x id after it is the raw form, also accepted.
|
||||
ctx->script_printf(ctx, MSG_INFO_0, " [%d] 0x%.8X %s\n", flat, PROBE_ID(j, i), probe_list);
|
||||
flat++;
|
||||
@@ -1790,7 +1790,7 @@ static int cmd_print_probes_list(script_ctx *ctx, char *line)
|
||||
|
||||
const char *cmd_open_probe_help[] = {
|
||||
"<probe>(int)", // Arguments "1<arg>(type) ..."
|
||||
"Open a probe by its index from jtag_get_probes_list (0, 1, 2, ...).",
|
||||
"Open a probe by its index from jtag_probes (0, 1, 2, ...).",
|
||||
"A raw 0x-prefixed probe id (as printed after the index) also works.",
|
||||
""
|
||||
};
|
||||
@@ -1812,12 +1812,12 @@ static int cmd_open_probe(script_ctx *ctx, char *line)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Sequential index from jtag_get_probes_list.
|
||||
// Sequential index from jtag_probes.
|
||||
id = resolve_flat_probe_index(jc, (int)strtoul(probe_id, NULL, 10));
|
||||
if (id < 0)
|
||||
{
|
||||
ctx->script_printf(ctx, MSG_ERROR,
|
||||
"No probe at index %s. Run jtag_get_probes_list first.\n", probe_id);
|
||||
"No probe at index %s. Run jtag_probes first.\n", probe_id);
|
||||
return JTAG_CORE_BAD_PARAMETER;
|
||||
}
|
||||
}
|
||||
@@ -2657,7 +2657,7 @@ static int cmd_spi_rd_wr(script_ctx *ctx, char *line)
|
||||
|
||||
jc = (jtag_core *)ctx->app_ctx;
|
||||
|
||||
// jtag_spi_rd_wr 00123344 1 (DATA LSBFirst)
|
||||
// jtag_spi_xfer 00123344 1 (DATA LSBFirst)
|
||||
i = get_param(ctx, line, 1, data_out_txt);
|
||||
j = get_param(ctx, line, 2, lsbfirst);
|
||||
|
||||
@@ -2803,7 +2803,7 @@ static int cmd_fpga_list(script_ctx *ctx, char *line)
|
||||
const char *cmd_fpga_info_help[] = {
|
||||
"",
|
||||
"Reports, for each device on the JTAG chain, whether its IDCODE",
|
||||
"matches a known FPGA target. Requires jtag_init_scan or jtag_autoinit first.",
|
||||
"matches a known FPGA target. Requires jtag_scan or jtag_autoinit first.",
|
||||
""};
|
||||
static int cmd_fpga_info(script_ctx *ctx, char *line)
|
||||
{
|
||||
@@ -2967,32 +2967,32 @@ cmd_list script_commands_list[] =
|
||||
{"return", cmd_return, cmd_return_help},
|
||||
{"rand", cmd_rand, cmd_rand_help},
|
||||
{"init_array", cmd_initarray, cmd_initarray_help},
|
||||
{"jtag_get_probes_list", cmd_print_probes_list, cmd_print_probes_list_help},
|
||||
{"jtag_open_probe", cmd_open_probe, cmd_open_probe_help},
|
||||
{"jtag_probes", cmd_print_probes_list, cmd_print_probes_list_help},
|
||||
{"jtag_open", cmd_open_probe, cmd_open_probe_help},
|
||||
{"jtag_autoinit", cmd_autoinit, cmd_autoinit_help},
|
||||
{"jtag_init_scan", cmd_init_and_scan, cmd_init_and_scan_help},
|
||||
{"jtag_get_nb_of_devices", cmd_print_nb_dev, cmd_print_nb_dev_help},
|
||||
{"jtag_get_devices_list", cmd_print_devs_list, cmd_print_devs_list_help},
|
||||
{"jtag_load_bsdl", cmd_load_bsdl, cmd_load_bsdl_help},
|
||||
{"jtag_set_mode", cmd_set_scan_mode, cmd_set_scan_mode_help},
|
||||
{"jtag_scan", cmd_init_and_scan, cmd_init_and_scan_help},
|
||||
{"jtag_ndev", cmd_print_nb_dev, cmd_print_nb_dev_help},
|
||||
{"jtag_devices", cmd_print_devs_list, cmd_print_devs_list_help},
|
||||
{"jtag_bsdl", cmd_load_bsdl, cmd_load_bsdl_help},
|
||||
{"jtag_mode", cmd_set_scan_mode, cmd_set_scan_mode_help},
|
||||
{"jtag_push_pop", cmd_push_and_pop, cmd_push_and_pop_help},
|
||||
{"jtag_get_pins_list", cmd_get_pins_list, cmd_get_pins_list_help},
|
||||
{"jtag_set_pin_dir", cmd_set_pin_mode, cmd_set_pin_mode_help},
|
||||
{"jtag_set_pin_state", cmd_set_pin_state, cmd_set_pin_state_help},
|
||||
{"jtag_get_pin_state", cmd_get_pin_state, cmd_get_pin_state_help},
|
||||
{"jtag_set_i2c_scl_pin", cmd_set_i2c_scl_pin, cmd_set_i2c_scl_help},
|
||||
{"jtag_set_i2c_sda_pin", cmd_set_i2c_sda_pin, cmd_set_i2c_sda_help},
|
||||
{"jtag_pins", cmd_get_pins_list, cmd_get_pins_list_help},
|
||||
{"jtag_pin_dir", cmd_set_pin_mode, cmd_set_pin_mode_help},
|
||||
{"jtag_pin_set", cmd_set_pin_state, cmd_set_pin_state_help},
|
||||
{"jtag_pin_get", cmd_get_pin_state, cmd_get_pin_state_help},
|
||||
{"jtag_i2c_scl", cmd_set_i2c_scl_pin, cmd_set_i2c_scl_help},
|
||||
{"jtag_i2c_sda", cmd_set_i2c_sda_pin, cmd_set_i2c_sda_help},
|
||||
{"jtag_i2c_rd", cmd_do_i2c_rd, cmd_do_i2c_wr_help},
|
||||
{"jtag_i2c_wr", cmd_do_i2c_wr, cmd_do_i2c_rd_help},
|
||||
{"jtag_set_mdio_mdc_pin", cmd_set_mdio_mdc_pin, cmd_set_mdio_mdc_pin_help},
|
||||
{"jtag_set_mdio_mdio_pin", cmd_set_mdio_mdio_pin, cmd_set_mdio_mdio_pin_help},
|
||||
{"jtag_mdio_mdc", cmd_set_mdio_mdc_pin, cmd_set_mdio_mdc_pin_help},
|
||||
{"jtag_mdio_io", cmd_set_mdio_mdio_pin, cmd_set_mdio_mdio_pin_help},
|
||||
{"jtag_mdio_rd", cmd_do_mdio_rd, cmd_do_mdio_rd_help},
|
||||
{"jtag_mdio_wr", cmd_do_mdio_wr, cmd_do_mdio_wr_help},
|
||||
{"jtag_set_spi_cs_pin", cmd_set_spi_cs_pin, cmd_set_spi_cs_pin_help},
|
||||
{"jtag_set_spi_mosi_pin", cmd_set_spi_mosi_pin, cmd_set_spi_mosi_pin_help},
|
||||
{"jtag_set_spi_miso_pin", cmd_set_spi_miso_pin, cmd_set_spi_miso_pin_help},
|
||||
{"jtag_set_spi_clk_pin", cmd_set_spi_clk_pin, cmd_set_spi_clk_pin_help},
|
||||
{"jtag_spi_rd_wr", cmd_spi_rd_wr, cmd_spi_rd_wr_help},
|
||||
{"jtag_spi_cs", cmd_set_spi_cs_pin, cmd_set_spi_cs_pin_help},
|
||||
{"jtag_spi_mosi", cmd_set_spi_mosi_pin, cmd_set_spi_mosi_pin_help},
|
||||
{"jtag_spi_miso", cmd_set_spi_miso_pin, cmd_set_spi_miso_pin_help},
|
||||
{"jtag_spi_clk", cmd_set_spi_clk_pin, cmd_set_spi_clk_pin_help},
|
||||
{"jtag_spi_xfer", cmd_spi_rd_wr, cmd_spi_rd_wr_help},
|
||||
{"fpga_list", cmd_fpga_list, cmd_fpga_list_help},
|
||||
{"fpga_info", cmd_fpga_info, cmd_fpga_info_help},
|
||||
{"bscan_set_ir", cmd_bscan_set_ir, cmd_bscan_set_ir_help},
|
||||
@@ -3041,7 +3041,7 @@ int jtagcore_savePinsStateScript(jtag_core *jc, int device, char *script_path)
|
||||
{
|
||||
state = jtagcore_get_pin_state(jc, device, i, JTAG_CORE_OE);
|
||||
fprintf(f, "print Pin %s direction : %d\n", pin_name, state);
|
||||
fprintf(f, "jtag_set_pin_dir %d %s %d\n", device, pin_name, state);
|
||||
fprintf(f, "jtag_pin_dir %d %s %d\n", device, pin_name, state);
|
||||
}
|
||||
|
||||
// output data
|
||||
@@ -3049,7 +3049,7 @@ int jtagcore_savePinsStateScript(jtag_core *jc, int device, char *script_path)
|
||||
{
|
||||
state = jtagcore_get_pin_state(jc, device, i, JTAG_CORE_OUTPUT);
|
||||
fprintf(f, "print Pin %s state : %d\n", pin_name, state);
|
||||
fprintf(f, "jtag_set_pin_state %d %s %d\n", device, pin_name, state);
|
||||
fprintf(f, "jtag_pin_set %d %s %d\n", device, pin_name, state);
|
||||
}
|
||||
|
||||
// input data
|
||||
|
||||
Reference in New Issue
Block a user