OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | kitprog |
struct | pending_transfer_result |
Functions | |
COMMAND_HANDLER (kitprog_handle_acquire_psoc_command) | |
COMMAND_HANDLER (kitprog_handle_info_command) | |
COMMAND_HANDLER (kitprog_handle_init_acquire_psoc_command) | |
static int | kitprog_acquire_psoc (uint8_t psoc_type, uint8_t acquire_mode, uint8_t max_attempts) |
static int | kitprog_generic_acquire (void) |
static int | kitprog_get_info (void) |
static int | kitprog_get_millivolts (void) |
static int | kitprog_get_status (void) |
static int | kitprog_get_usb_serial (void) |
static int | kitprog_get_version (void) |
static int | kitprog_hid_command (uint8_t *command, size_t command_length, uint8_t *data, size_t data_length) |
static int | kitprog_init (void) |
static int | kitprog_quit (void) |
static int | kitprog_reset (int trst, int srst) |
static int | kitprog_reset_target (void) |
static int | kitprog_set_protocol (uint8_t protocol) |
static int | kitprog_set_unknown (void) |
static int | kitprog_swd_init (void) |
static void | kitprog_swd_queue_cmd (uint8_t cmd, uint32_t *dst, uint32_t data) |
static void | kitprog_swd_read_reg (uint8_t cmd, uint32_t *value, uint32_t ap_delay_clk) |
static int | kitprog_swd_run_queue (void) |
static int | kitprog_swd_seq (uint8_t seq_type) |
static int | kitprog_swd_switch_seq (enum swd_special_seq seq) |
static int | kitprog_swd_sync (void) |
static void | kitprog_swd_write_reg (uint8_t cmd, uint32_t value, uint32_t ap_delay_clk) |
static void | kitprog_usb_close (void) |
static int | kitprog_usb_open (void) |
static int | mm_to_version (uint8_t major, uint8_t minor) |
Variables | |
struct adapter_driver | kitprog_adapter_driver |
static const struct command_registration | kitprog_command_handlers [] |
static struct kitprog * | kitprog_handle |
static bool | kitprog_init_acquire_psoc |
static const struct command_registration | kitprog_subcommand_handlers [] |
static const struct swd_driver | kitprog_swd |
static const char *const | kitprog_transports [] = { "swd", NULL } |
static int | pending_queue_len |
static int | pending_transfer_count |
static struct pending_transfer_result * | pending_transfers |
static int | queued_retval |
COMMAND_HANDLER | ( | kitprog_handle_acquire_psoc_command | ) |
Definition at line 853 of file kitprog.c.
References kitprog_generic_acquire().
COMMAND_HANDLER | ( | kitprog_handle_info_command | ) |
Definition at line 845 of file kitprog.c.
References kitprog_get_info().
COMMAND_HANDLER | ( | kitprog_handle_init_acquire_psoc_command | ) |
Definition at line 860 of file kitprog.c.
References ERROR_OK, and kitprog_init_acquire_psoc.
|
static |
Definition at line 488 of file kitprog.c.
References CONTROL_COMMAND_PROGRAM, CONTROL_MODE_ACQUIRE_SWD_TARGET, CONTROL_TYPE_WRITE, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_generic_acquire().
|
static |
Definition at line 585 of file kitprog.c.
References ACQUIRE_MODE_RESET, DEVICE_PSOC3, DEVICE_PSOC4, DEVICE_PSOC5, devices, ERROR_FAIL, ERROR_OK, jtag_sleep(), kitprog_acquire_psoc(), kitprog_get_status(), and LOG_DEBUG.
Referenced by COMMAND_HANDLER(), and kitprog_init().
|
static |
Definition at line 387 of file kitprog.c.
References ERROR_FAIL, ERROR_OK, kitprog::hardware_version, kitprog_get_millivolts(), kitprog_get_version(), kitprog_handle, LOG_ERROR, LOG_INFO, kitprog::major_version, kitprog::millivolts, and kitprog::minor_version.
Referenced by COMMAND_HANDLER(), and kitprog_init().
|
static |
Definition at line 371 of file kitprog.c.
References ERROR_OK, HID_COMMAND_POWER, HID_TYPE_READ, HID_TYPE_START, kitprog_handle, kitprog_hid_command(), and kitprog::millivolts.
Referenced by kitprog_get_info().
|
static |
Definition at line 436 of file kitprog.c.
References CONTROL_COMMAND_PROGRAM, CONTROL_MODE_POLL_PROGRAMMER_STATUS, CONTROL_TYPE_READ, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), jtag_sleep(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_generic_acquire().
|
static |
Definition at line 244 of file kitprog.c.
References ERROR_FAIL, ERROR_OK, kitprog_handle, LOG_ERROR, kitprog::serial, and kitprog::usb_handle.
Referenced by kitprog_usb_open().
|
static |
Definition at line 353 of file kitprog.c.
References ERROR_OK, kitprog::hardware_version, HID_COMMAND_VERSION, HID_TYPE_START, HID_TYPE_WRITE, kitprog_handle, kitprog_hid_command(), kitprog::major_version, and kitprog::minor_version.
Referenced by kitprog_get_info().
|
static |
Definition at line 329 of file kitprog.c.
References ERROR_FAIL, ERROR_OK, ERROR_TIMEOUT_REACHED, kitprog::hid_handle, kitprog_handle, LIBUSB_TIMEOUT_MS, LOG_DEBUG, and LOG_ERROR.
Referenced by kitprog_get_millivolts(), and kitprog_get_version().
|
static |
Definition at line 160 of file kitprog.c.
References ERROR_FAIL, ERROR_JTAG_INIT_FAILED, ERROR_OK, kitprog_generic_acquire(), kitprog_get_info(), kitprog_handle, kitprog_init_acquire_psoc, kitprog_set_protocol(), kitprog_set_unknown(), kitprog_swd_seq(), kitprog_swd_sync(), kitprog_usb_open(), LOG_ERROR, LOG_WARNING, kitprog::major_version, kitprog::minor_version, mm_to_version(), kitprog::packet_buffer, kitprog::packet_size, pending_queue_len, pending_transfers, PROTOCOL_SWD, SEQUENCE_LINE_RESET, kitprog::supports_jtag_to_swd, and SWD_MAX_BUFFER_LENGTH.
|
static |
Definition at line 230 of file kitprog.c.
References ERROR_OK, kitprog_handle, kitprog_usb_close(), kitprog::packet_buffer, pending_transfers, and kitprog::serial.
|
static |
Definition at line 820 of file kitprog.c.
References ERROR_FAIL, ERROR_OK, kitprog_reset_target(), and LOG_ERROR.
|
static |
Definition at line 513 of file kitprog.c.
References CONTROL_COMMAND_PROGRAM, CONTROL_MODE_RESET_TARGET, CONTROL_TYPE_WRITE, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_reset().
|
static |
Definition at line 412 of file kitprog.c.
References CONTROL_COMMAND_PROGRAM, CONTROL_MODE_SET_PROGRAMMER_PROTOCOL, CONTROL_TYPE_WRITE, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_init().
|
static |
Definition at line 464 of file kitprog.c.
References CONTROL_TYPE_WRITE, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_init().
|
static |
|
static |
Definition at line 799 of file kitprog.c.
References pending_transfer_result::buffer, pending_transfer_result::cmd, cmd, pending_transfer_result::data, ERROR_OK, kitprog_swd_run_queue(), pending_queue_len, pending_transfer_count, pending_transfers, queued_retval, and SWD_CMD_RNW.
Referenced by kitprog_swd_read_reg(), and kitprog_swd_write_reg().
|
static |
Definition at line 638 of file kitprog.c.
References cmd, kitprog_swd_queue_cmd(), and SWD_CMD_RNW.
|
static |
Definition at line 673 of file kitprog.c.
References buffer, BULK_EP_IN, BULK_EP_OUT, pending_transfer_result::cmd, cmd, CORUNDETECT, pending_transfer_result::data, DP_CTRL_STAT, ERROR_FAIL, ERROR_OK, jtag_libusb_bulk_read(), jtag_libusb_bulk_write(), kitprog_handle, le_to_h_u32(), LOG_DEBUG, LOG_DEBUG_IO, LOG_ERROR, kitprog::packet_buffer, pending_transfer_count, pending_transfers, queued_retval, SWD_ACK_FAULT, SWD_ACK_OK, swd_ack_to_error_code(), SWD_ACK_WAIT, SWD_CMD_A32, SWD_CMD_APNDP, SWD_CMD_PARK, SWD_CMD_RNW, SWD_CMD_START, SWD_CMD_STOP, SWD_MAX_BUFFER_LENGTH, and kitprog::usb_handle.
Referenced by kitprog_swd_queue_cmd().
|
static |
Definition at line 561 of file kitprog.c.
References CONTROL_COMMAND_PROGRAM, CONTROL_MODE_SEND_SWD_SEQUENCE, CONTROL_TYPE_WRITE, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_init(), and kitprog_swd_switch_seq().
|
static |
Definition at line 646 of file kitprog.c.
References ERROR_FAIL, ERROR_OK, JTAG_TO_SWD, kitprog_handle, kitprog_swd_seq(), LINE_RESET, LOG_DEBUG, LOG_ERROR, SEQUENCE_JTAG_TO_SWD, SEQUENCE_LINE_RESET, and kitprog::supports_jtag_to_swd.
|
static |
Definition at line 537 of file kitprog.c.
References CONTROL_COMMAND_PROGRAM, CONTROL_MODE_SYNCHRONIZE_TRANSFER, CONTROL_TYPE_WRITE, ERROR_FAIL, ERROR_OK, jtag_libusb_control_transfer(), kitprog_handle, LOG_DEBUG, PROGRAMMER_NOK_NACK, PROGRAMMER_OK_ACK, status, and kitprog::usb_handle.
Referenced by kitprog_init().
|
static |
Definition at line 632 of file kitprog.c.
References cmd, kitprog_swd_queue_cmd(), NULL, and SWD_CMD_RNW.
|
static |
Definition at line 317 of file kitprog.c.
References kitprog::hid_handle, jtag_libusb_close(), kitprog_handle, and kitprog::usb_handle.
Referenced by kitprog_quit().
|
static |
Definition at line 273 of file kitprog.c.
References ERROR_FAIL, ERROR_OK, kitprog::hid_handle, jtag_libusb_open(), kitprog_get_usb_serial(), kitprog_handle, LOG_ERROR, LOG_WARNING, NULL, PID, kitprog::serial, kitprog::usb_handle, and VID.
Referenced by kitprog_init().
|
inlinestatic |
Definition at line 155 of file kitprog.c.
Referenced by kitprog_init().
struct adapter_driver kitprog_adapter_driver |
|
static |
|
static |
Definition at line 129 of file kitprog.c.
Referenced by kitprog_acquire_psoc(), kitprog_get_info(), kitprog_get_millivolts(), kitprog_get_status(), kitprog_get_usb_serial(), kitprog_get_version(), kitprog_hid_command(), kitprog_init(), kitprog_quit(), kitprog_reset_target(), kitprog_set_protocol(), kitprog_set_unknown(), kitprog_swd_run_queue(), kitprog_swd_seq(), kitprog_swd_switch_seq(), kitprog_swd_sync(), kitprog_usb_close(), and kitprog_usb_open().
|
static |
Definition at line 122 of file kitprog.c.
Referenced by COMMAND_HANDLER(), and kitprog_init().
|
static |
|
static |
|
static |
|
static |
Definition at line 124 of file kitprog.c.
Referenced by kitprog_init(), and kitprog_swd_queue_cmd().
|
static |
Definition at line 124 of file kitprog.c.
Referenced by kitprog_swd_queue_cmd(), and kitprog_swd_run_queue().
|
static |
Definition at line 125 of file kitprog.c.
Referenced by kitprog_init(), kitprog_quit(), kitprog_swd_queue_cmd(), and kitprog_swd_run_queue().
|
static |
Definition at line 127 of file kitprog.c.
Referenced by kitprog_swd_queue_cmd(), and kitprog_swd_run_queue().