The vendor ID and product ID of the device.
@end deffn
+@deffn {Command} {hla_command} command
+Execute a custom adapter-specific command. The @var{command} string is
+passed as is to the underlying adapter layout handler.
+@end deffn
+
@deffn {Config Command} {trace} source_clock_hz [output_file_path]
Enable SWO tracing (if supported). The source clock rate for the
trace port must be specified, this is typically the CPU clock rate. If
.write_mem = icdi_usb_write_mem,
.write_debug_reg = icdi_usb_write_debug_reg,
.override_target = icdi_usb_override_target,
+ .custom_command = icdi_send_remote_cmd,
};
return ERROR_OK;
}
+COMMAND_HANDLER(interface_handle_hla_command)
+{
+ if (CMD_ARGC != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ if (!hl_if.layout->api->custom_command) {
+ LOG_ERROR("The selected adapter doesn't support custom commands");
+ return ERROR_FAIL;
+ }
+
+ hl_if.layout->api->custom_command(hl_if.handle, CMD_ARGV[0]);
+
+ return ERROR_OK;
+}
+
static const struct command_registration hl_interface_command_handlers[] = {
{
.name = "hla_device_desc",
.help = "configure trace reception",
.usage = "source_lock_hz [destination_path]",
},
+ {
+ .name = "hla_command",
+ .handler = &interface_handle_hla_command,
+ .mode = COMMAND_EXEC,
+ .help = "execute a custom adapter-specific command",
+ .usage = "hla_command <command>",
+ },
COMMAND_REGISTRATION_DONE
};
/** */
int (*override_target) (const char *targetname);
/** */
+ int (*custom_command) (void *handle, const char *command);
+ /** */
enum target_state (*state) (void *fd);
};