16 #define CHANNEL_NAME_SIZE 128
72 unsigned int interval;
84 unsigned int interval;
119 info.name = channel_name;
120 info.name_length =
sizeof(channel_name);
154 Jim_Obj *
const *argv)
157 Jim_Obj *channel_list;
163 Jim_SetResultFormatted(interp,
"rtt: Control block not available");
169 info.name = channel_name;
170 info.name_length =
sizeof(channel_name);
172 list = Jim_NewListObj(interp,
NULL, 0);
173 channel_list = Jim_NewListObj(interp,
NULL, 0);
187 tmp = Jim_NewListObj(interp,
NULL, 0);
189 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
191 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
194 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
196 Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
199 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
201 Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
204 Jim_ListAppendElement(interp, channel_list, tmp);
207 Jim_ListAppendElement(interp, list, channel_list);
209 channel_list = Jim_NewListObj(interp,
NULL, 0);
223 tmp = Jim_NewListObj(interp,
NULL, 0);
225 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
227 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
230 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
232 Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
235 Jim_ListAppendElement(interp, tmp, Jim_NewStringObj(interp,
237 Jim_ListAppendElement(interp, tmp, Jim_NewIntObj(interp,
240 Jim_ListAppendElement(interp, channel_list, tmp);
243 Jim_ListAppendElement(interp, list, channel_list);
244 Jim_SetResult(interp, list);
252 .handler = handle_rtt_setup_command,
255 .usage =
"<address> <size> <ID>"
259 .handler = handle_rtt_start_command,
266 .handler = handle_rtt_stop_command,
272 .name =
"polling_interval",
273 .handler = handle_rtt_polling_interval_command,
275 .help =
"show or set polling interval in ms",
276 .usage =
"[interval]"
280 .handler = handle_rtt_channels_command,
282 .help =
"list available channels",
286 .name =
"channellist",
289 .help =
"list available channels",
299 .help =
"RTT target commands",
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
int rtt_stop(void)
Stop Real-Time Transfer (RTT).
int rtt_start(void)
Start Real-Time Transfer (RTT).
struct rtt_control ctrl
Control block.
bool rtt_configured(void)
Get whether RTT is configured.
bool rtt_found_cb(void)
Get whether RTT control block was found.
int rtt_set_polling_interval(unsigned int interval)
Set the polling interval.
size_t size
Size of the control block search area.
int rtt_register_source(const struct rtt_source source, struct target *target)
Register an RTT source for a target.
const struct rtt_control * rtt_get_control(void)
Get the RTT control block.
int rtt_get_polling_interval(unsigned int *interval)
Get the polling interval.
int rtt_setup(target_addr_t address, size_t size, const char *id)
Setup RTT.
int rtt_read_channel_info(unsigned int channel_index, enum rtt_channel_type type, struct rtt_channel_info *info)
Read channel information.
@ RTT_CHANNEL_TYPE_UP
Up channel (target to host).
@ RTT_CHANNEL_TYPE_DOWN
Down channel (host to target).
static const struct command_registration rtt_subcommand_handlers[]
COMMAND_HANDLER(handle_rtt_setup_command)
#define CHANNEL_NAME_SIZE
static int jim_channel_list(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
const struct command_registration rtt_target_command_handlers[]
uint32_t num_up_channels
Maximum number of up-channels.
uint32_t num_down_channels
Maximum number of down-channels.
rtt_source_find_ctrl_block find_cb
rtt_source_read_ctrl_block read_cb
rtt_source_read_channel_info read_channel_info
int target_rtt_read_control_block(struct target *target, target_addr_t address, struct rtt_control *ctrl, void *user_data)
int target_rtt_read_callback(struct target *target, const struct rtt_control *ctrl, struct rtt_sink_list **sinks, size_t num_channels, void *user_data)
int target_rtt_find_control_block(struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data)
int target_rtt_stop(struct target *target, void *user_data)
int target_rtt_start(struct target *target, const struct rtt_control *ctrl, void *user_data)
int target_rtt_write_callback(struct target *target, struct rtt_control *ctrl, unsigned int channel_index, const uint8_t *buffer, size_t *length, void *user_data)
int target_rtt_read_channel_info(struct target *target, const struct rtt_control *ctrl, unsigned int channel_index, enum rtt_channel_type type, struct rtt_channel_info *info, void *user_data)
struct target * get_current_target(struct command_context *cmd_ctx)
static struct ublast_lowlevel_priv info