OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | adapter_gpio_config |
Configuration options for a single GPIO. More... | |
Macros | |
#define | ADAPTER_GPIO_NOT_SET UINT_MAX |
Functions | |
int | adapter_config_khz (unsigned int khz) |
Attempt to configure the adapter for the specified kHz. More... | |
int | adapter_config_rclk (unsigned int fallback_speed_khz) |
Attempt to enable RTCK/RCLK. More... | |
const char * | adapter_get_required_serial (void) |
Retrieves the serial number set with command 'adapter serial'. More... | |
int | adapter_get_speed (int *speed) |
unsigned int | adapter_get_speed_khz (void) |
Retrieves the clock speed of the adapter in kHz. More... | |
int | adapter_get_speed_readable (int *speed) |
Given a speed setting, use the interface speed_div callback to adjust the setting. More... | |
const struct adapter_gpio_config * | adapter_gpio_get_config (void) |
Retrieves gpio configuration set with command "adapter gpio <signal_name>". More... | |
const char * | adapter_gpio_get_name (enum adapter_gpio_config_index idx) |
Retrieves gpio name. More... | |
int | adapter_init (struct command_context *cmd_ctx) |
Initialize debug adapter upon startup. More... | |
int | adapter_quit (void) |
Shutdown the debug adapter upon program exit. More... | |
int | adapter_register_commands (struct command_context *ctx) |
Register the adapter's commands. More... | |
const char * | adapter_usb_get_location (void) |
bool | adapter_usb_location_equal (uint8_t dev_bus, uint8_t *port_path, size_t path_len) |
bool | is_adapter_initialized (void) |
enum adapter_gpio_pull |
int adapter_config_khz | ( | unsigned int | khz | ) |
Attempt to configure the adapter for the specified kHz.
Definition at line 248 of file adapter.c.
References adapter_config, adapter_khz_to_speed(), adapter_set_speed(), CLOCK_MODE_KHZ, ERROR_OK, and LOG_DEBUG.
Referenced by adapter_init(), and COMMAND_HANDLER().
int adapter_config_rclk | ( | unsigned int | fallback_speed_khz | ) |
Attempt to enable RTCK/RCLK.
If that fails, fallback to the specified frequency.
Definition at line 257 of file adapter.c.
References adapter_config, adapter_rclk_to_speed(), adapter_set_speed(), CLOCK_MODE_RCLK, ERROR_OK, and LOG_DEBUG.
Referenced by COMMAND_HANDLER().
const char* adapter_get_required_serial | ( | void | ) |
Retrieves the serial number set with command 'adapter serial'.
Definition at line 298 of file adapter.c.
References adapter_config.
Referenced by cmsis_dap_open(), ft232r_init(), ftdi_initialize(), jlink_init(), jtag_libusb_open(), presto_jtag_init(), stlink_open(), usb_connect(), vsllink_check_usb_strings(), and xds110_show_info().
int adapter_get_speed | ( | int * | speed | ) |
Definition at line 267 of file adapter.c.
References adapter_config, adapter_get_speed_khz(), adapter_khz_to_speed(), adapter_rclk_to_speed(), CLOCK_MODE_KHZ, CLOCK_MODE_RCLK, ERROR_FAIL, ERROR_OK, and LOG_ERROR.
Referenced by adapter_get_speed_readable(), adapter_init(), amt_jtagaccel_scan(), amt_jtagaccel_state_move(), and COMMAND_HANDLER().
unsigned int adapter_get_speed_khz | ( | void | ) |
Retrieves the clock speed of the adapter in kHz.
Definition at line 207 of file adapter.c.
References adapter_config.
Referenced by adapter_get_speed(), adapter_init(), adapter_khz_to_speed(), cmsis_dap_init(), cmsis_dap_swd_switch_seq(), COMMAND_HANDLER(), ftdi_initialize(), gowin_runtest_idle(), intel_load(), jlink_init(), mips32_pracc_fastdata_xfer(), mips32_pracc_queue_exec(), mips64_pracc_fastdata_xfer(), and vsllink_init().
int adapter_get_speed_readable | ( | int * | speed | ) |
Given a speed setting, use the interface speed_div
callback to adjust the setting.
speed | The speed setting to convert back to readable kHz. |
speed_div
callback. Definition at line 283 of file adapter.c.
References adapter_get_speed(), ERROR_FAIL, ERROR_OK, is_adapter_initialized(), LOG_ERROR, and adapter_driver::speed_div.
Referenced by adapter_init(), and COMMAND_HANDLER().
const struct adapter_gpio_config* adapter_gpio_get_config | ( | void | ) |
Retrieves gpio configuration set with command "adapter gpio <signal_name>".
Definition at line 1221 of file adapter.c.
References adapter_config.
Referenced by am335xgpio_init(), bcm2835gpio_init(), and linuxgpiod_init().
const char* adapter_gpio_get_name | ( | enum adapter_gpio_config_index | idx | ) |
Retrieves gpio name.
Definition at line 1215 of file adapter.c.
References gpio_map::name.
Referenced by helper_get_line(), and initialize_gpio().
int adapter_init | ( | struct command_context * | cmd_ctx | ) |
Initialize debug adapter upon startup.
Initialize debug adapter upon startup.
Definition at line 120 of file adapter.c.
References adapter_config, adapter_config_khz(), adapter_driver_gpios_init(), adapter_get_speed(), adapter_get_speed_khz(), adapter_get_speed_readable(), CLOCK_MODE_KHZ, CLOCK_MODE_RCLK, CLOCK_MODE_UNSELECTED, DEFAULT_CLOCK_SPEED_KHZ, ERROR_JTAG_INIT_FAILED, ERROR_JTAG_INVALID_INTERFACE, ERROR_OK, adapter_driver::init, is_adapter_initialized(), LOG_ERROR, LOG_INFO, LOG_WARNING, adapter_driver::name, and adapter_driver::speed.
Referenced by COMMAND_HANDLER(), jtag_init(), jtag_init_reset(), and swd_init_reset().
int adapter_quit | ( | void | ) |
Shutdown the debug adapter upon program exit.
Definition at line 185 of file adapter.c.
References adapter_config, ERROR_OK, is_adapter_initialized(), jtag_all_taps(), jtag_tap_free(), LOG_ERROR, jtag_tap::next_tap, and adapter_driver::quit.
Referenced by openocd_main().
int adapter_register_commands | ( | struct command_context * | ctx | ) |
Register the adapter's commands.
Register the adapter's commands.
Definition at line 1210 of file adapter.c.
References interface_command_handlers, NULL, and register_commands().
Referenced by setup_command_handler().
const char* adapter_usb_get_location | ( | void | ) |
Definition at line 324 of file adapter.c.
References adapter_config.
Referenced by adapter_usb_location_equal(), ftdi_initialize(), jlink_open_device(), and jtag_libusb_open().
bool adapter_usb_location_equal | ( | uint8_t | dev_bus, |
uint8_t * | port_path, | ||
size_t | path_len | ||
) |
Definition at line 329 of file adapter.c.
References adapter_usb_get_location(), LOG_WARNING, NULL, strndup(), strnlen(), and USB_MAX_LOCATION_LENGTH.
Referenced by jlink_usb_location_equal().
bool is_adapter_initialized | ( | void | ) |
Definition at line 69 of file adapter.c.
References adapter_config.
Referenced by adapter_get_speed_readable(), adapter_init(), adapter_khz_to_speed(), adapter_quit(), adapter_set_speed(), default_interface_jtag_execute_queue(), and jtag_power_dropout().