OpenOCD
|
Go to the source code of this file.
Macros | |
#define | LSB_FIRST 0x08 |
#define | MSB_FIRST 0x00 |
#define | NEG_EDGE_IN 0x04 |
#define | NEG_EDGE_OUT 0x01 |
#define | POS_EDGE_IN 0x00 |
#define | POS_EDGE_OUT 0x00 |
Enumerations | |
enum | ftdi_chip_type { TYPE_FT2232C , TYPE_FT2232H , TYPE_FT4232H , TYPE_FT232H } |
Functions | |
void | mpsse_clock_data (struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in, unsigned in_offset, unsigned length, uint8_t mode) |
void | mpsse_clock_data_in (struct mpsse_ctx *ctx, uint8_t *in, unsigned in_offset, unsigned length, uint8_t mode) |
void | mpsse_clock_data_out (struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, unsigned length, uint8_t mode) |
void | mpsse_clock_tms_cs (struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, uint8_t *in, unsigned in_offset, unsigned length, bool tdi, uint8_t mode) |
void | mpsse_clock_tms_cs_out (struct mpsse_ctx *ctx, const uint8_t *out, unsigned out_offset, unsigned length, bool tdi, uint8_t mode) |
void | mpsse_close (struct mpsse_ctx *ctx) |
int | mpsse_divide_by_5_config (struct mpsse_ctx *ctx, bool enable) |
int | mpsse_flush (struct mpsse_ctx *ctx) |
bool | mpsse_is_high_speed (struct mpsse_ctx *ctx) |
void | mpsse_loopback_config (struct mpsse_ctx *ctx, bool enable) |
struct mpsse_ctx * | mpsse_open (const uint16_t *vid, const uint16_t *pid, const char *description, const char *serial, const char *location, int channel) |
void | mpsse_purge (struct mpsse_ctx *ctx) |
void | mpsse_read_data_bits_high_byte (struct mpsse_ctx *ctx, uint8_t *data) |
void | mpsse_read_data_bits_low_byte (struct mpsse_ctx *ctx, uint8_t *data) |
int | mpsse_rtck_config (struct mpsse_ctx *ctx, bool enable) |
void | mpsse_set_data_bits_high_byte (struct mpsse_ctx *ctx, uint8_t data, uint8_t dir) |
void | mpsse_set_data_bits_low_byte (struct mpsse_ctx *ctx, uint8_t data, uint8_t dir) |
void | mpsse_set_divisor (struct mpsse_ctx *ctx, uint16_t divisor) |
int | mpsse_set_frequency (struct mpsse_ctx *ctx, int frequency) |
enum ftdi_chip_type |
void mpsse_clock_data | ( | struct mpsse_ctx * | ctx, |
const uint8_t * | out, | ||
unsigned | out_offset, | ||
uint8_t * | in, | ||
unsigned | in_offset, | ||
unsigned | length, | ||
uint8_t | mode | ||
) |
Definition at line 483 of file mpsse.c.
References buffer_add_read(), buffer_read_space(), buffer_write(), buffer_write_byte(), buffer_write_space(), ERROR_OK, length, LOG_DEBUG_IO, mode, mpsse_flush(), and mpsse_ctx::retval.
Referenced by ftdi_execute_scan(), mpsse_clock_data_in(), and mpsse_clock_data_out().
void mpsse_clock_data_in | ( | struct mpsse_ctx * | ctx, |
uint8_t * | in, | ||
unsigned | in_offset, | ||
unsigned | length, | ||
uint8_t | mode | ||
) |
Definition at line 477 of file mpsse.c.
References length, mode, and mpsse_clock_data().
Referenced by ftdi_swd_queue_cmd().
void mpsse_clock_data_out | ( | struct mpsse_ctx * | ctx, |
const uint8_t * | out, | ||
unsigned | out_offset, | ||
unsigned | length, | ||
uint8_t | mode | ||
) |
Definition at line 471 of file mpsse.c.
References length, mode, and mpsse_clock_data().
Referenced by ftdi_swd_queue_cmd(), and ftdi_swd_run_queue().
void mpsse_clock_tms_cs | ( | struct mpsse_ctx * | ctx, |
const uint8_t * | out, | ||
unsigned | out_offset, | ||
uint8_t * | in, | ||
unsigned | in_offset, | ||
unsigned | length, | ||
bool | tdi, | ||
uint8_t | mode | ||
) |
Definition at line 560 of file mpsse.c.
References bit_copy(), buffer_add_read(), buffer_read_space(), buffer_write_byte(), buffer_write_space(), ERROR_OK, length, LOG_DEBUG_IO, mode, mpsse_flush(), and mpsse_ctx::retval.
Referenced by ftdi_execute_scan(), and mpsse_clock_tms_cs_out().
void mpsse_clock_tms_cs_out | ( | struct mpsse_ctx * | ctx, |
const uint8_t * | out, | ||
unsigned | out_offset, | ||
unsigned | length, | ||
bool | tdi, | ||
uint8_t | mode | ||
) |
Definition at line 554 of file mpsse.c.
References length, mode, and mpsse_clock_tms_cs().
Referenced by ftdi_execute_pathmove(), ftdi_execute_runtest(), ftdi_execute_scan(), ftdi_execute_stableclocks(), ftdi_execute_tms(), and move_to_state().
void mpsse_close | ( | struct mpsse_ctx * | ctx | ) |
Definition at line 390 of file mpsse.c.
References bit_copy_discard(), mpsse_ctx::read_buffer, mpsse_ctx::read_chunk, mpsse_ctx::read_queue, mpsse_ctx::usb_ctx, mpsse_ctx::usb_dev, and mpsse_ctx::write_buffer.
Referenced by ftdi_quit(), and mpsse_open().
int mpsse_divide_by_5_config | ( | struct mpsse_ctx * | ctx, |
bool | enable | ||
) |
Definition at line 714 of file mpsse.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, mpsse_is_high_speed(), and single_byte_boolean_helper().
Referenced by mpsse_set_frequency().
int mpsse_flush | ( | struct mpsse_ctx * | ctx | ) |
Definition at line 833 of file mpsse.c.
References bit_copy_discard(), bit_copy_execute(), buffer_write_byte(), transfer_result::ctx, transfer_result::done, ERROR_FAIL, ERROR_OK, mpsse_ctx::in_ep, keep_alive(), LOG_DEBUG_IO, LOG_ERROR, LOG_WARNING, mpsse_purge(), NULL, mpsse_ctx::out_ep, read_cb(), mpsse_ctx::read_chunk, mpsse_ctx::read_chunk_size, mpsse_ctx::read_count, mpsse_ctx::read_queue, mpsse_ctx::retval, start, timeval_ms(), transfer_result::transferred, timeval::tv_sec, timeval::tv_usec, mpsse_ctx::usb_ctx, mpsse_ctx::usb_dev, mpsse_ctx::usb_read_timeout, mpsse_ctx::usb_write_timeout, mpsse_ctx::write_buffer, write_cb(), and mpsse_ctx::write_count.
Referenced by COMMAND_HANDLER(), ftdi_execute_queue(), ftdi_execute_sleep(), ftdi_get_signal(), ftdi_initialize(), ftdi_reset(), ftdi_swd_run_queue(), mpsse_clock_data(), mpsse_clock_tms_cs(), mpsse_read_data_bits_high_byte(), mpsse_read_data_bits_low_byte(), mpsse_set_data_bits_high_byte(), mpsse_set_data_bits_low_byte(), mpsse_set_divisor(), and single_byte_boolean_helper().
bool mpsse_is_high_speed | ( | struct mpsse_ctx * | ctx | ) |
Definition at line 404 of file mpsse.c.
References mpsse_ctx::type, and TYPE_FT2232C.
Referenced by ftdi_khz(), mpsse_divide_by_5_config(), and mpsse_rtck_config().
void mpsse_loopback_config | ( | struct mpsse_ctx * | ctx, |
bool | enable | ||
) |
Definition at line 691 of file mpsse.c.
References LOG_DEBUG, and single_byte_boolean_helper().
Referenced by ftdi_initialize().
struct mpsse_ctx* mpsse_open | ( | const uint16_t * | vid, |
const uint16_t * | pid, | ||
const char * | description, | ||
const char * | serial, | ||
const char * | location, | ||
int | channel | ||
) |
Definition at line 310 of file mpsse.c.
References bit_copy_queue_init(), BITMODE_MPSSE, description, FTDI_DEVICE_OUT_REQTYPE, mpsse_ctx::index, mpsse_ctx::interface, LOG_ERROR, mpsse_close(), mpsse_purge(), NULL, open_matching_device(), mpsse_ctx::read_buffer, mpsse_ctx::read_chunk, mpsse_ctx::read_chunk_size, mpsse_ctx::read_queue, mpsse_ctx::read_size, serial, SIO_SET_BITMODE_REQUEST, SIO_SET_LATENCY_TIMER_REQUEST, mpsse_ctx::usb_ctx, mpsse_ctx::usb_dev, mpsse_ctx::usb_read_timeout, mpsse_ctx::usb_write_timeout, mpsse_ctx::write_buffer, and mpsse_ctx::write_size.
Referenced by ftdi_initialize().
void mpsse_purge | ( | struct mpsse_ctx * | ctx | ) |
Definition at line 409 of file mpsse.c.
References bit_copy_discard(), ERROR_OK, FTDI_DEVICE_OUT_REQTYPE, mpsse_ctx::index, LOG_DEBUG, LOG_ERROR, NULL, mpsse_ctx::read_count, mpsse_ctx::read_queue, mpsse_ctx::retval, SIO_RESET_PURGE_RX, SIO_RESET_PURGE_TX, SIO_RESET_REQUEST, mpsse_ctx::usb_dev, mpsse_ctx::usb_write_timeout, and mpsse_ctx::write_count.
Referenced by mpsse_flush(), and mpsse_open().
void mpsse_read_data_bits_high_byte | ( | struct mpsse_ctx * | ctx, |
uint8_t * | data | ||
) |
Definition at line 661 of file mpsse.c.
References buffer_add_read(), buffer_read_space(), buffer_write_byte(), buffer_write_space(), ERROR_OK, LOG_DEBUG_IO, mpsse_flush(), and mpsse_ctx::retval.
Referenced by ftdi_get_signal().
void mpsse_read_data_bits_low_byte | ( | struct mpsse_ctx * | ctx, |
uint8_t * | data | ||
) |
Definition at line 645 of file mpsse.c.
References buffer_add_read(), buffer_read_space(), buffer_write_byte(), buffer_write_space(), ERROR_OK, LOG_DEBUG_IO, mpsse_flush(), and mpsse_ctx::retval.
Referenced by ftdi_get_signal().
int mpsse_rtck_config | ( | struct mpsse_ctx * | ctx, |
bool | enable | ||
) |
Definition at line 725 of file mpsse.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, mpsse_is_high_speed(), and single_byte_boolean_helper().
Referenced by mpsse_set_frequency().
void mpsse_set_data_bits_high_byte | ( | struct mpsse_ctx * | ctx, |
uint8_t | data, | ||
uint8_t | dir | ||
) |
Definition at line 628 of file mpsse.c.
References buffer_write_byte(), buffer_write_space(), ERROR_OK, LOG_DEBUG_IO, mpsse_flush(), and mpsse_ctx::retval.
Referenced by ftdi_initialize(), and ftdi_set_signal().
void mpsse_set_data_bits_low_byte | ( | struct mpsse_ctx * | ctx, |
uint8_t | data, | ||
uint8_t | dir | ||
) |
Definition at line 611 of file mpsse.c.
References buffer_write_byte(), buffer_write_space(), ERROR_OK, LOG_DEBUG_IO, mpsse_flush(), and mpsse_ctx::retval.
Referenced by ftdi_initialize(), ftdi_set_signal(), and ftdi_swd_swdio_en().
void mpsse_set_divisor | ( | struct mpsse_ctx * | ctx, |
uint16_t | divisor | ||
) |
Definition at line 697 of file mpsse.c.
References buffer_write_byte(), buffer_write_space(), ERROR_OK, LOG_DEBUG, LOG_DEBUG_IO, mpsse_flush(), and mpsse_ctx::retval.
Referenced by mpsse_set_frequency().
int mpsse_set_frequency | ( | struct mpsse_ctx * | ctx, |
int | frequency | ||
) |
Definition at line 736 of file mpsse.c.
References ERROR_OK, LOG_DEBUG, mpsse_divide_by_5_config(), mpsse_rtck_config(), and mpsse_set_divisor().
Referenced by ftdi_initialize(), and ftdi_speed().