16 #define CHANNEL_NAME_SIZE 128
22 const char *DEFAULT_ID =
"SEGGER RTT";
23 const char *selected_id;
24 if (CMD_ARGC < 2 || CMD_ARGC > 3)
27 selected_id = DEFAULT_ID;
78 unsigned int interval;
90 unsigned int interval;
125 info.name = channel_name;
126 info.name_length =
sizeof(channel_name);
175 info.name = channel_name;
176 info.name_length =
sizeof(channel_name);
191 " size 0x%" PRIx32
"\n"
192 " flags 0x%" PRIx32
"\n"
210 " size 0x%" PRIx32
"\n"
211 " flags 0x%" PRIx32
"\n"
224 .handler = handle_rtt_setup_command,
227 .usage =
"<address> <size> [ID]"
231 .handler = handle_rtt_start_command,
238 .handler = handle_rtt_stop_command,
244 .name =
"polling_interval",
245 .handler = handle_rtt_polling_interval_command,
247 .help =
"show or set polling interval in ms",
248 .usage =
"[interval]"
252 .handler = handle_rtt_channels_command,
254 .help =
"list available channels",
258 .name =
"channellist",
259 .handler = handle_channel_list,
261 .help =
"list available channels",
271 .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
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