OpenOCD
|
Transport abstraction layer (USB). More...
Go to the source code of this file.
Macros | |
#define | CHUNK_SIZE 2048 |
Chunk size in bytes in which data is transferred. More... | |
#define | NUM_TIMEOUTS 2 |
Number of consecutive timeouts before an USB transfer will be treated as timed out. More... | |
#define | USB_TIMEOUT 1000 |
Timeout of an USB transfer in milliseconds. More... | |
Transport abstraction layer (USB).
Definition in file transport_usb.c.
#define CHUNK_SIZE 2048 |
Chunk size in bytes in which data is transferred.
Definition at line 44 of file transport_usb.c.
Referenced by adjust_buffer(), initialize_handle(), transport_usb_read(), transport_usb_write(), usb_recv(), and usb_send().
#define NUM_TIMEOUTS 2 |
Number of consecutive timeouts before an USB transfer will be treated as timed out.
Definition at line 41 of file transport_usb.c.
Referenced by usb_recv(), and usb_send().
#define USB_TIMEOUT 1000 |
Timeout of an USB transfer in milliseconds.
Definition at line 35 of file transport_usb.c.
Referenced by usb_recv(), and usb_send().
|
static |
Definition at line 367 of file transport_usb.c.
References jaylink_device_handle::buffer, buffer, jaylink_device_handle::buffer_size, CHUNK_SIZE, jaylink_device::ctx, jaylink_device_handle::dev, log_dbg(), log_err(), and size.
Referenced by transport_usb_write().
|
static |
Definition at line 148 of file transport_usb.c.
References jaylink_device_handle::buffer.
Referenced by transport_usb_close(), and transport_usb_open().
|
static |
Definition at line 46 of file transport_usb.c.
References jaylink_device_handle::buffer, jaylink_device_handle::buffer_size, jaylink_device_handle::bytes_available, CHUNK_SIZE, config, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR, JAYLINK_ERR_MALLOC, JAYLINK_OK, log_dbg(), log_err(), jaylink_device_handle::read_length, jaylink_device_handle::read_pos, jaylink_device_handle::write_length, and jaylink_device_handle::write_pos.
Referenced by transport_usb_open().
JAYLINK_PRIV int transport_usb_close | ( | struct jaylink_device_handle * | devh | ) |
Definition at line 200 of file transport_usb.c.
References cleanup_handle(), jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR, JAYLINK_OK, log_dbg(), and log_err().
Referenced by transport_close().
JAYLINK_PRIV int transport_usb_open | ( | struct jaylink_device_handle * | devh | ) |
Definition at line 153 of file transport_usb.c.
References cleanup_handle(), jaylink_device::ctx, jaylink_device_handle::dev, initialize_handle(), JAYLINK_ERR, JAYLINK_OK, log_dbg(), and log_err().
Referenced by transport_open().
JAYLINK_PRIV int transport_usb_read | ( | struct jaylink_device_handle * | devh, |
uint8_t * | buffer, | ||
size_t | length | ||
) |
Definition at line 526 of file transport_usb.c.
References jaylink_device_handle::buffer, jaylink_device_handle::bytes_available, CHUNK_SIZE, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, length, log_dbgio(), log_err(), MIN, jaylink_device_handle::read_length, jaylink_device_handle::read_pos, and usb_recv().
Referenced by transport_read().
JAYLINK_PRIV int transport_usb_start_read | ( | struct jaylink_device_handle * | devh, |
size_t | length | ||
) |
Definition at line 256 of file transport_usb.c.
References jaylink_device_handle::bytes_available, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, length, log_dbg(), log_dbgio(), log_warn(), and jaylink_device_handle::read_length.
Referenced by transport_start_read().
JAYLINK_PRIV int transport_usb_start_write | ( | struct jaylink_device_handle * | devh, |
size_t | length, | ||
bool | has_command | ||
) |
Definition at line 229 of file transport_usb.c.
References jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, length, log_dbgio(), log_warn(), jaylink_device_handle::write_length, and jaylink_device_handle::write_pos.
Referenced by transport_start_write().
JAYLINK_PRIV int transport_usb_start_write_read | ( | struct jaylink_device_handle * | devh, |
size_t | write_length, | ||
size_t | read_length, | ||
bool | has_command | ||
) |
Definition at line 282 of file transport_usb.c.
References jaylink_device_handle::bytes_available, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_OK, log_dbgio(), log_warn(), jaylink_device_handle::read_length, jaylink_device_handle::read_pos, jaylink_device_handle::write_length, and jaylink_device_handle::write_pos.
Referenced by transport_start_write_read().
JAYLINK_PRIV int transport_usb_write | ( | struct jaylink_device_handle * | devh, |
const uint8_t * | buffer, | ||
size_t | length | ||
) |
Definition at line 441 of file transport_usb.c.
References adjust_buffer(), jaylink_device_handle::buffer, jaylink_device_handle::buffer_size, CHUNK_SIZE, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR_ARG, JAYLINK_ERR_MALLOC, JAYLINK_OK, length, log_dbgio(), log_err(), MIN, usb_send(), jaylink_device_handle::write_length, and jaylink_device_handle::write_pos.
Referenced by transport_write().
|
static |
Definition at line 323 of file transport_usb.c.
References CHUNK_SIZE, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR, JAYLINK_ERR_TIMEOUT, JAYLINK_OK, log_dbgio(), log_err(), log_warn(), NUM_TIMEOUTS, and USB_TIMEOUT.
Referenced by transport_usb_read().
|
static |
Definition at line 398 of file transport_usb.c.
References CHUNK_SIZE, jaylink_device::ctx, jaylink_device_handle::dev, JAYLINK_ERR, JAYLINK_ERR_TIMEOUT, JAYLINK_OK, log_dbgio(), log_err(), log_warn(), MIN, NUM_TIMEOUTS, and USB_TIMEOUT.
Referenced by transport_usb_write().