7 #ifndef OPENOCD_RTT_RTT_H
8 #define OPENOCD_RTT_RTT_H
19 #define RTT_CB_MAX_ID_LENGTH 16
22 #define RTT_CB_SIZE (RTT_CB_MAX_ID_LENGTH + 2 * sizeof(uint32_t))
25 #define RTT_CHANNEL_SIZE 24
28 #define RTT_CHANNEL_BUFFER_MIN_SIZE 2
81 size_t length,
void *user_data);
116 const uint8_t *
buffer,
size_t *
length,
void *user_data);
struct rtt_control ctrl
Control block.
size_t size
Size of the control block search area.
char id[RTT_CB_MAX_ID_LENGTH]
Control block identifier.
int rtt_stop(void)
Stop Real-Time Transfer (RTT).
#define RTT_CB_MAX_ID_LENGTH
Control block ID length in bytes, including the trailing null-terminator.
int rtt_start(void)
Start Real-Time Transfer (RTT).
int(* rtt_source_read)(struct target *target, const struct rtt_control *ctrl, struct rtt_sink_list **sinks, size_t num_channels, void *user_data)
int rtt_register_sink(unsigned int channel_index, rtt_sink_read read, void *user_data)
Register an RTT sink.
int(* rtt_source_start)(struct target *target, const struct rtt_control *ctrl, void *user_data)
bool rtt_configured(void)
Get whether RTT is configured.
int(* rtt_source_read_ctrl_block)(struct target *target, target_addr_t address, struct rtt_control *ctrl_block, void *user_data)
bool rtt_found_cb(void)
Get whether RTT control block was found.
int(* rtt_source_find_ctrl_block)(struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data)
int rtt_set_polling_interval(unsigned int interval)
Set the polling interval.
int(* rtt_source_write)(struct target *target, struct rtt_control *ctrl, unsigned int channel, const uint8_t *buffer, size_t *length, void *user_data)
int rtt_unregister_sink(unsigned int channel_index, rtt_sink_read read, void *user_data)
Unregister an RTT sink.
int(* rtt_sink_read)(unsigned int channel, const uint8_t *buffer, size_t length, void *user_data)
int(* rtt_source_read_channel_info)(struct target *target, const struct rtt_control *ctrl, unsigned int channel, enum rtt_channel_type type, struct rtt_channel_info *info, void *user_data)
int rtt_init(void)
Initialize Real-Time Transfer (RTT).
bool rtt_started(void)
Get whether RTT is started.
int rtt_register_source(const struct rtt_source source, struct target *target)
Register an RTT source for a target.
int rtt_exit(void)
Shutdown Real-Time Transfer (RTT).
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.
const struct command_registration rtt_target_command_handlers[]
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
Channel type.
@ RTT_CHANNEL_TYPE_UP
Up channel (target to host).
@ RTT_CHANNEL_TYPE_DOWN
Down channel (host to target).
int(* rtt_source_stop)(struct target *target, void *user_data)
int rtt_write_channel(unsigned int channel_index, const uint8_t *buffer, size_t *length)
Write to an RTT channel.
uint32_t size
Buffer size in bytes.
size_t name_length
Length of the name in bytes, including the trailing null-terminator.
uint32_t flags
Buffer flags.
uint32_t read_pos
Read position within the buffer in bytes.
uint32_t name_addr
Channel name address on the target.
target_addr_t address
Channel structure address on the target.
uint32_t write_pos
Write position within the buffer in bytes.
uint32_t size
Channel buffer size in bytes.
uint32_t flags
Buffer flags.
uint32_t buffer_addr
Buffer address on the target.
target_addr_t address
Control block address on the target.
uint32_t num_up_channels
Maximum number of up-channels.
uint32_t num_down_channels
Maximum number of down-channels.
struct rtt_sink_list * next
rtt_source_find_ctrl_block find_cb
rtt_source_read_ctrl_block read_cb
rtt_source_read_channel_info read_channel_info
static struct ublast_lowlevel_priv info