commands doc corrections.

Added a "script" directory for examples.
This commit is contained in:
François Dausseur
2025-02-18 15:40:58 +01:00
parent 5dfe5b123e
commit 9e0ca10a71
3 changed files with 18 additions and 16 deletions

View File

@@ -1129,7 +1129,7 @@ static int cmd_pause(script_ctx *ctx, char *line)
const char *cmd_help_help[] = { const char *cmd_help_help[] = {
"<command>(string)", "<command>(string)",
"if no args, it prints the list of commandsm,", "if no args, it prints the list of commands,",
"otherwise the help of the <command>.", "otherwise the help of the <command>.",
""}; ""};
static int cmd_help(script_ctx *ctx, char *line) static int cmd_help(script_ctx *ctx, char *line)
@@ -1192,7 +1192,8 @@ static int cmd_help(script_ctx *ctx, char *line)
const char *cmd_call_help[] = { const char *cmd_call_help[] = {
"<path>(string)", "<path>(string)",
"Executes a script located at <path>.", "Executes a script located at <path>.",
""}; ""
};
static int cmd_call(script_ctx *ctx, char *line) static int cmd_call(script_ctx *ctx, char *line)
{ {
int offs; int offs;
@@ -1719,6 +1720,7 @@ static int cmd_print_devs_list(script_ctx *ctx, char *line)
ctx->script_printf(ctx, MSG_INFO_0, "%s\n", ptr); ctx->script_printf(ctx, MSG_INFO_0, "%s\n", ptr);
free(ptr); free(ptr);
} }
return JTAG_CORE_NO_ERROR;
} }
return JTAG_CORE_NOT_FOUND; return JTAG_CORE_NOT_FOUND;
@@ -1792,9 +1794,8 @@ static int cmd_open_probe(script_ctx *ctx, char *line)
} }
const char *cmd_load_bsdl_help[] = { const char *cmd_load_bsdl_help[] = {
"", // Arguments "1<arg>(type) ..." "<file>(string) <device>(int)",
"explanations line one", // Explanations "Load/attach a bsdl file to a device into the chain.",
"explanations line two",
"" ""
}; };
static int cmd_load_bsdl(script_ctx *ctx, char *line) static int cmd_load_bsdl(script_ctx *ctx, char *line)
@@ -1829,9 +1830,9 @@ static int cmd_load_bsdl(script_ctx *ctx, char *line)
} }
const char *cmd_set_scan_mode_help[] = { const char *cmd_set_scan_mode_help[] = {
"", // Arguments "1<arg>(type) ..." "<device>(int) <mode>(string)",
"explanations line one", // Explanations "Set the scan mode for a particular device.",
"explanations line two", "mode to be chosen in EXTEST or SAMPLE",
"" ""
}; };
static int cmd_set_scan_mode(script_ctx *ctx, char *line) static int cmd_set_scan_mode(script_ctx *ctx, char *line)
@@ -1904,8 +1905,8 @@ static int cmd_push_and_pop(script_ctx *ctx, char *line)
} }
const char *cmd_set_pin_mode_help[] = { const char *cmd_set_pin_mode_help[] = {
"<device>(int) <pin>(string) <mode>(string)", "<device>(int) <pin>(string) <mode>(int)",
"Change the mode (input or output) of the pin of the given device.", "Change the mode (input: 0 or output: 1) of the pin of the given device.",
"" ""
}; };
static int cmd_set_pin_mode(script_ctx *ctx, char *line) static int cmd_set_pin_mode(script_ctx *ctx, char *line)
@@ -1990,7 +1991,7 @@ static int cmd_set_pin_state(script_ctx *ctx, char *line)
} }
const char *cmd_get_pin_state_help[] = { const char *cmd_get_pin_state_help[] = {
"<device>(int) <pin>(string) <mode>(string)", "<device>(int) <pin>(string)",
"Gets the state (0 or 1) of the pin of the given device.", "Gets the state (0 or 1) of the pin of the given device.",
"The mode is to be chosen between 'input' or 'output'.", "The mode is to be chosen between 'input' or 'output'.",
"" ""
@@ -2000,14 +2001,12 @@ static int cmd_get_pin_state(script_ctx *ctx, char *line)
int i, j, k, ret, id; int i, j, k, ret, id;
char dev_index[DEFAULT_BUFLEN]; char dev_index[DEFAULT_BUFLEN];
char pinname[DEFAULT_BUFLEN]; char pinname[DEFAULT_BUFLEN];
char mode[DEFAULT_BUFLEN];
jtag_core *jc; jtag_core *jc;
jc = (jtag_core *)ctx->app_ctx; jc = (jtag_core *)ctx->app_ctx;
i = get_param(ctx, line, 1, dev_index); i = get_param(ctx, line, 1, dev_index);
j = get_param(ctx, line, 2, pinname); j = get_param(ctx, line, 2, pinname);
k = get_param(ctx, line, 3, mode);
if (i >= 0 && j >= 0 && k >= 0) if (i >= 0 && j >= 0 && k >= 0)
{ {
@@ -2660,9 +2659,8 @@ static int cmd_spi_rd_wr(script_ctx *ctx, char *line)
} }
const char *cmd_get_pins_list_help[] = { const char *cmd_get_pins_list_help[] = {
"", // Arguments "1<arg>(type) ..." "<device>(int)",
"explanations line one", // Explanations "Lists the device pins and their properties",
"explanations line two",
"" ""
}; };
static int cmd_get_pins_list(script_ctx *ctx, char *line) static int cmd_get_pins_list(script_ctx *ctx, char *line)

View File

@@ -0,0 +1,4 @@
jtag_open_probe 1
jtag_autoinit
jtag_set_mode 0 EXTEST