OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | rtt_channel |
RTT channel. More... | |
struct | rtt_channel_info |
RTT channel information. More... | |
struct | rtt_control |
RTT control block. More... | |
struct | rtt_sink_list |
struct | rtt_source |
RTT source. More... | |
Macros | |
#define | RTT_CB_MAX_ID_LENGTH 16 |
Control block ID length in bytes, including the trailing null-terminator. More... | |
#define | RTT_CB_SIZE (RTT_CB_MAX_ID_LENGTH + 2 * sizeof(uint32_t)) |
#define | RTT_CHANNEL_BUFFER_MIN_SIZE 2 |
#define | RTT_CHANNEL_SIZE 24 |
Typedefs | |
typedef int(* | rtt_sink_read) (unsigned int channel, const uint8_t *buffer, size_t length, void *user_data) |
typedef int(* | rtt_source_find_ctrl_block) (struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data) |
typedef int(* | rtt_source_read) (struct target *target, const struct rtt_control *ctrl, struct rtt_sink_list **sinks, size_t num_channels, void *user_data) |
typedef 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) |
typedef int(* | rtt_source_read_ctrl_block) (struct target *target, target_addr_t address, struct rtt_control *ctrl_block, void *user_data) |
typedef int(* | rtt_source_start) (struct target *target, const struct rtt_control *ctrl, void *user_data) |
typedef int(* | rtt_source_stop) (struct target *target, void *user_data) |
typedef int(* | rtt_source_write) (struct target *target, struct rtt_control *ctrl, unsigned int channel, const uint8_t *buffer, size_t *length, void *user_data) |
Enumerations | |
enum | rtt_channel_type { RTT_CHANNEL_TYPE_UP , RTT_CHANNEL_TYPE_DOWN } |
Channel type. More... | |
Functions | |
bool | rtt_configured (void) |
Get whether RTT is configured. More... | |
int | rtt_exit (void) |
Shutdown Real-Time Transfer (RTT). More... | |
bool | rtt_found_cb (void) |
Get whether RTT control block was found. More... | |
const struct rtt_control * | rtt_get_control (void) |
Get the RTT control block. More... | |
int | rtt_get_polling_interval (unsigned int *interval) |
Get the polling interval. More... | |
int | rtt_init (void) |
Initialize Real-Time Transfer (RTT). More... | |
int | rtt_read_channel_info (unsigned int channel_index, enum rtt_channel_type type, struct rtt_channel_info *info) |
Read channel information. More... | |
int | rtt_register_sink (unsigned int channel_index, rtt_sink_read read, void *user_data) |
Register an RTT sink. More... | |
int | rtt_register_source (const struct rtt_source source, struct target *target) |
Register an RTT source for a target. More... | |
int | rtt_set_polling_interval (unsigned int interval) |
Set the polling interval. More... | |
int | rtt_setup (target_addr_t address, size_t size, const char *id) |
Setup RTT. More... | |
int | rtt_start (void) |
Start Real-Time Transfer (RTT). More... | |
bool | rtt_started (void) |
Get whether RTT is started. More... | |
int | rtt_stop (void) |
Stop Real-Time Transfer (RTT). More... | |
int | rtt_unregister_sink (unsigned int channel_index, rtt_sink_read read, void *user_data) |
Unregister an RTT sink. More... | |
int | rtt_write_channel (unsigned int channel_index, const uint8_t *buffer, size_t *length) |
Write to an RTT channel. More... | |
Variables | |
const struct command_registration | rtt_target_command_handlers [] |
#define RTT_CB_MAX_ID_LENGTH 16 |
#define RTT_CB_SIZE (RTT_CB_MAX_ID_LENGTH + 2 * sizeof(uint32_t)) |
typedef int(* rtt_source_find_ctrl_block) (struct target *target, target_addr_t *address, size_t size, const char *id, bool *found, void *user_data) |
typedef int(* rtt_source_read) (struct target *target, const struct rtt_control *ctrl, struct rtt_sink_list **sinks, size_t num_channels, void *user_data) |
typedef 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) |
typedef int(* rtt_source_read_ctrl_block) (struct target *target, target_addr_t address, struct rtt_control *ctrl_block, void *user_data) |
typedef int(* rtt_source_start) (struct target *target, const struct rtt_control *ctrl, void *user_data) |
enum rtt_channel_type |
bool rtt_configured | ( | void | ) |
Get whether RTT is configured.
Definition at line 305 of file rtt/rtt.c.
References rtt.
Referenced by COMMAND_HANDLER().
int rtt_exit | ( | void | ) |
Shutdown Real-Time Transfer (RTT).
Definition at line 65 of file rtt/rtt.c.
Referenced by openocd_main().
bool rtt_found_cb | ( | void | ) |
Get whether RTT control block was found.
Definition at line 310 of file rtt/rtt.c.
References rtt.
Referenced by COMMAND_HANDLER(), and jim_channel_list().
const struct rtt_control* rtt_get_control | ( | void | ) |
Get the RTT control block.
Definition at line 315 of file rtt/rtt.c.
References rtt.
Referenced by COMMAND_HANDLER(), and jim_channel_list().
int rtt_get_polling_interval | ( | unsigned int * | interval | ) |
Get the polling interval.
[out] | interval | Polling interval in milliseconds. |
Definition at line 262 of file rtt/rtt.c.
References ERROR_FAIL, ERROR_OK, and rtt.
Referenced by COMMAND_HANDLER().
int rtt_init | ( | void | ) |
Initialize Real-Time Transfer (RTT).
Definition at line 48 of file rtt/rtt.c.
References ERROR_FAIL, ERROR_OK, NULL, and rtt.
Referenced by openocd_main().
int rtt_read_channel_info | ( | unsigned int | channel_index, |
enum rtt_channel_type | type, | ||
struct rtt_channel_info * | info | ||
) |
Read channel information.
[in] | channel_index | Channel index. |
[in] | type | Channel type. |
[out] | info | Channel information. |
Definition at line 320 of file rtt/rtt.c.
Referenced by COMMAND_HANDLER(), and jim_channel_list().
int rtt_register_sink | ( | unsigned int | channel_index, |
rtt_sink_read | read, | ||
void * | user_data | ||
) |
Register an RTT sink.
[in] | channel_index | Channel index. |
[in] | read | Read callback function. |
[in,out] | user_data | User data to be passed to the callback function. |
Definition at line 206 of file rtt/rtt.c.
References adjust_sink_list(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, rtt_sink_list::next, rtt_sink_list::read, rtt, and rtt_sink_list::user_data.
Referenced by rtt_new_connection().
int rtt_register_source | ( | const struct rtt_source | source, |
struct target * | target | ||
) |
Register an RTT source for a target.
[in] | source | RTT source. |
[in,out] | target | Target. |
Definition at line 106 of file rtt/rtt.c.
References ERROR_FAIL, ERROR_OK, rtt_source::find_cb, rtt_source::read, rtt_source::read_cb, rtt_source::read_channel_info, rtt, source, rtt_source::start, rtt_source::stop, target, and rtt_source::write.
Referenced by COMMAND_HANDLER().
int rtt_set_polling_interval | ( | unsigned int | interval | ) |
Set the polling interval.
[in] | interval | Polling interval in milliseconds. |
Definition at line 272 of file rtt/rtt.c.
References ERROR_FAIL, ERROR_OK, NULL, read_channel_callback(), rtt, target_register_timer_callback(), and target_unregister_timer_callback().
Referenced by COMMAND_HANDLER().
int rtt_setup | ( | target_addr_t | address, |
size_t | size, | ||
const char * | id | ||
) |
Setup RTT.
[in] | address | Start address to search for the control block. |
[in] | size | Size of the control block search area. |
[in] | id | Identifier of the control block. Must be null-terminated. |
Definition at line 88 of file rtt/rtt.c.
References ERROR_COMMAND_ARGUMENT_INVALID, ERROR_OK, LOG_ERROR, rtt, RTT_CB_MAX_ID_LENGTH, and size.
Referenced by COMMAND_HANDLER().
int rtt_start | ( | void | ) |
Start Real-Time Transfer (RTT).
Definition at line 124 of file rtt/rtt.c.
References addr, ERROR_OK, LOG_INFO, NULL, read_channel_callback(), rtt, TARGET_PRIxADDR, and target_register_timer_callback().
Referenced by COMMAND_HANDLER().
bool rtt_started | ( | void | ) |
int rtt_stop | ( | void | ) |
Stop Real-Time Transfer (RTT).
Definition at line 165 of file rtt/rtt.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, NULL, read_channel_callback(), rtt, and target_unregister_timer_callback().
Referenced by COMMAND_HANDLER().
int rtt_unregister_sink | ( | unsigned int | channel_index, |
rtt_sink_read | read, | ||
void * | user_data | ||
) |
Unregister an RTT sink.
[in] | channel_index | Channel index. |
[in] | read | Read callback function. |
[in,out] | user_data | User data to be passed to the callback function. |
Definition at line 232 of file rtt/rtt.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, rtt_sink_list::next, rtt_sink_list::read, rtt, and rtt_sink_list::user_data.
Referenced by rtt_connection_closed().
int rtt_write_channel | ( | unsigned int | channel_index, |
const uint8_t * | buffer, | ||
size_t * | length | ||
) |
Write to an RTT channel.
[in] | channel_index | Channel index. |
[in] | buffer | Buffer with data that should be written to the channel. |
[in,out] | length | Number of bytes to write. On success, the argument gets updated with the actual number of written bytes. |
Definition at line 288 of file rtt/rtt.c.
References buffer, ERROR_OK, length, LOG_WARNING, NULL, and rtt.
Referenced by rtt_input().
|
extern |