130 new_pos = malloc(
sizeof(*new_pos));
154 uint16_t want_pos, uint16_t want_size, uint8_t *
buffer, uint8_t collect)
159 "versaloon pending data");
203 if (ret != 0 || transferred != out_len) {
214 *inlen = (uint16_t)transferred;
224 #define VERSALOON_RETRY_CNT 10
229 uint32_t timeout_tmp;
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
size_t size
Size of the control block search area.
char id[RTT_CB_MAX_ID_LENGTH]
Control block identifier.
struct versaloon_usb_setting_t usb_setting
struct versaloon_want_pos_t * pos
versaloon_callback_t callback
uint16_t actual_data_size
struct versaloon_want_pos_t * next
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
RESULT usbtogpio_init(uint8_t interface_index)
RESULT usbtogpio_config(uint8_t interface_index, uint32_t mask, uint32_t dir_mask, uint32_t pull_en_mask, uint32_t input_pull_mask)
RESULT usbtogpio_fini(uint8_t interface_index)
RESULT usbtogpio_in(uint8_t interface_index, uint32_t mask, uint32_t *value)
RESULT usbtogpio_out(uint8_t interface_index, uint32_t mask, uint32_t value)
RESULT usbtojtagraw_config(uint8_t interface_index, uint32_t khz)
RESULT usbtojtagraw_execute(uint8_t interface_index, uint8_t *tdi, uint8_t *tms, uint8_t *tdo, uint32_t bitlen)
RESULT usbtojtagraw_fini(uint8_t interface_index)
RESULT usbtojtagraw_init(uint8_t interface_index)
RESULT usbtopwr_init(uint8_t interface_index)
RESULT usbtopwr_fini(uint8_t interface_index)
RESULT usbtopwr_output(uint8_t interface_index, uint16_t millivolt)
RESULT usbtopwr_config(uint8_t interface_index)
RESULT usbtoswd_seqin(uint8_t interface_index, uint8_t *data, uint16_t bitlen)
RESULT usbtoswd_transact(uint8_t interface_index, uint8_t request, uint32_t *data, uint8_t *ack)
RESULT usbtoswd_config(uint8_t interface_index, uint8_t trn, uint16_t retry, uint16_t dly)
RESULT usbtoswd_init(uint8_t interface_index)
RESULT usbtoswd_fini(uint8_t interface_index)
RESULT usbtoswd_seqout(uint8_t interface_index, const uint8_t *data, uint16_t bitlen)
RESULT usbtoxxx_init(void)
RESULT usbtodelay_delay(uint16_t dly)
RESULT usbtoxxx_execute_command(void)
RESULT usbtoxxx_fini(void)
static RESULT versaloon_init(void)
void versaloon_set_callback(versaloon_callback_t callback)
void versaloon_free_want_pos(void)
void versaloon_set_pending_id(uint32_t id)
static versaloon_callback_t versaloon_callback
#define VERSALOON_RETRY_CNT
static RESULT versaloon_get_target_voltage(uint16_t *voltage)
static RESULT versaloon_delay_us(uint16_t us)
uint16_t versaloon_pending_idx
void versaloon_set_extra_data(void *p)
static struct versaloon_want_pos_t * versaloon_want_pos
struct libusb_device_handle * versaloon_usb_device_handle
struct versaloon_pending_t versaloon_pending[VERSALOON_MAX_PENDING_NUMBER]
uint8_t * versaloon_cmd_buf
static RESULT versaloon_delay_ms(uint16_t ms)
static RESULT versaloon_fini(void)
static uint32_t versaloon_usb_to
static RESULT versaloon_set_target_voltage(uint16_t voltage)
uint16_t versaloon_buf_size
RESULT versaloon_add_pending(uint8_t type, uint8_t cmd, uint16_t actual_szie, uint16_t want_pos, uint16_t want_size, uint8_t *buffer, uint8_t collect)
static uint32_t versaloon_pending_id
RESULT versaloon_send_command(uint16_t out_len, uint16_t *inlen)
RESULT versaloon_add_want_pos(uint16_t offset, uint16_t size, uint8_t *buff)
static void * versaloon_extra_data
struct versaloon_interface_t versaloon_interface
#define ERRCODE_NOT_ENOUGH_MEMORY
#define ERRCODE_INVALID_BUFFER
#define ERRMSG_INVALID_PARAMETER
#define ERRMSG_INVALID_INDEX
#define ERRCODE_FAILURE_OPERATION
#define ERRMSG_NOT_ENOUGH_MEMORY
#define ERRCODE_INVALID_PARAMETER
#define ERRMSG_FAILURE_OPERATION
#define ERRMSG_INVALID_BUFFER
#define VERSALOON_GET_INFO
RESULT(* versaloon_callback_t)(void *, uint8_t *, uint8_t *)
#define VERSALOON_GET_TVCC
#define VERSALOON_TIMEOUT
#define VERSALOON_MAX_PENDING_NUMBER