OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | usbtoxxx_context_t |
Macros | |
#define | N_A "n/a" |
#define | usbtoxxx_get_type_name(type) |
Functions | |
RESULT | usbtodelay_delay (uint16_t dly) |
RESULT | usbtodelay_delayms (uint16_t ms) |
RESULT | usbtodelay_delayus (uint16_t us) |
RESULT | usbtoinfo_get_abilities (uint8_t abilities[USB_TO_XXX_ABILITIES_LEN]) |
RESULT | usbtopoll_checkfail (uint8_t equ, uint16_t offset, uint8_t size, uint32_t mask, uint32_t value) |
RESULT | usbtopoll_checkok (uint8_t equ, uint16_t offset, uint8_t size, uint32_t mask, uint32_t value) |
RESULT | usbtopoll_end (void) |
RESULT | usbtopoll_start (uint16_t retry_cnt, uint16_t interval_us) |
RESULT | usbtopoll_verifybuff (uint16_t offset, uint16_t size, uint8_t *buff) |
RESULT | usbtoxxx_add_command (uint8_t type, uint8_t cmd, uint8_t *cmdbuf, uint16_t cmdlen, uint16_t retlen, uint8_t *wantbuf, uint16_t wantpos, uint16_t wantlen, uint8_t collect) |
static RESULT | usbtoxxx_ensure_buffer_size (uint16_t cmdlen) |
RESULT | usbtoxxx_execute_command (void) |
RESULT | usbtoxxx_fini (void) |
RESULT | usbtoxxx_init (void) |
bool | usbtoxxx_interface_supported (uint8_t cmd) |
static void | usbtoxxx_pop_context (struct usbtoxxx_context_t *c) |
static void | usbtoxxx_save_context (struct usbtoxxx_context_t *c) |
static RESULT | usbtoxxx_validate_current_command_type (void) |
Variables | |
static uint8_t | collect_cmd |
static uint16_t | collect_index |
static struct usbtoxxx_context_t | poll_context |
static uint8_t | poll_nesting |
static uint8_t | type_pre |
static const char * | types_name [96] |
uint8_t | usbtoxxx_abilities [USB_TO_XXX_ABILITIES_LEN] |
static uint8_t * | usbtoxxx_buffer |
static uint16_t | usbtoxxx_buffer_index |
static uint16_t | usbtoxxx_current_cmd_index |
#define N_A "n/a" |
Definition at line 19 of file usbtoxxx.c.
#define usbtoxxx_get_type_name | ( | type | ) |
Definition at line 38 of file usbtoxxx.c.
RESULT usbtodelay_delay | ( | uint16_t | dly | ) |
Definition at line 517 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERROR_FAIL, ERROR_OK, LOG_BUG, NULL, SET_LE_U16, type_pre, USB_TO_DELAY, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), usbtoxxx_validate_current_command_type(), and versaloon_add_pending().
Referenced by usbtodelay_delayms(), usbtodelay_delayus(), versaloon_delay_ms(), and versaloon_delay_us().
RESULT usbtodelay_delayms | ( | uint16_t | ms | ) |
Definition at line 534 of file usbtoxxx.c.
References usbtodelay_delay().
RESULT usbtodelay_delayus | ( | uint16_t | us | ) |
Definition at line 539 of file usbtoxxx.c.
References usbtodelay_delay().
RESULT usbtoinfo_get_abilities | ( | uint8_t | abilities[USB_TO_XXX_ABILITIES_LEN] | ) |
Definition at line 358 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERROR_FAIL, ERROR_OK, LOG_BUG, type_pre, USB_TO_INFO, USB_TO_XXX_ABILITIES_LEN, usbtoxxx_ensure_buffer_size(), usbtoxxx_validate_current_command_type(), and versaloon_add_pending().
Referenced by usbtoxxx_init().
RESULT usbtopoll_checkfail | ( | uint8_t | equ, |
uint16_t | offset, | ||
uint8_t | size, | ||
uint32_t | mask, | ||
uint32_t | value | ||
) |
Definition at line 454 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRCODE_INVALID_PARAMETER, ERRMSG_FAILURE_OPERATION, ERRMSG_INVALID_PARAMETER, ERROR_FAIL, ERROR_OK, LOG_BUG, mask, offset, poll_nesting, SET_LE_U16, size, type_pre, USB_TO_POLL, USB_TO_POLL_CHECKFAIL, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), and usbtoxxx_validate_current_command_type().
RESULT usbtopoll_checkok | ( | uint8_t | equ, |
uint16_t | offset, | ||
uint8_t | size, | ||
uint32_t | mask, | ||
uint32_t | value | ||
) |
Definition at line 418 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRCODE_INVALID_PARAMETER, ERRMSG_FAILURE_OPERATION, ERRMSG_INVALID_PARAMETER, ERROR_FAIL, ERROR_OK, LOG_BUG, mask, offset, poll_nesting, SET_LE_U16, size, type_pre, USB_TO_POLL, USB_TO_POLL_CHECKOK, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), and usbtoxxx_validate_current_command_type().
RESULT usbtopoll_end | ( | void | ) |
Definition at line 396 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERROR_FAIL, ERROR_OK, LOG_BUG, NULL, poll_nesting, type_pre, USB_TO_POLL, USB_TO_POLL_END, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), usbtoxxx_validate_current_command_type(), and versaloon_add_pending().
RESULT usbtopoll_start | ( | uint16_t | retry_cnt, |
uint16_t | interval_us | ||
) |
Definition at line 373 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERROR_FAIL, ERROR_OK, LOG_BUG, NULL, poll_context, poll_nesting, SET_LE_U16, type_pre, USB_TO_POLL, USB_TO_POLL_START, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), usbtoxxx_save_context(), usbtoxxx_validate_current_command_type(), and versaloon_add_pending().
RESULT usbtopoll_verifybuff | ( | uint16_t | offset, |
uint16_t | size, | ||
uint8_t * | buff | ||
) |
Definition at line 490 of file usbtoxxx.c.
References ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERROR_FAIL, ERROR_OK, LOG_BUG, offset, poll_nesting, SET_LE_U16, size, type_pre, USB_TO_POLL, USB_TO_POLL_VERIFYBUFF, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), and usbtoxxx_validate_current_command_type().
RESULT usbtoxxx_add_command | ( | uint8_t | type, |
uint8_t | cmd, | ||
uint8_t * | cmdbuf, | ||
uint16_t | cmdlen, | ||
uint16_t | retlen, | ||
uint8_t * | wantbuf, | ||
uint16_t | wantpos, | ||
uint16_t | wantlen, | ||
uint8_t | collect | ||
) |
Definition at line 313 of file usbtoxxx.c.
References cmd, collect_cmd, collect_index, ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERROR_FAIL, ERROR_OK, GET_LE_U16, LOG_BUG, SET_LE_U16, type, type_pre, usbtoxxx_buffer, usbtoxxx_current_cmd_index, usbtoxxx_ensure_buffer_size(), usbtoxxx_validate_current_command_type(), and versaloon_add_pending().
|
static |
Definition at line 264 of file usbtoxxx.c.
References ERROR_FAIL, ERROR_OK, LOG_BUG, poll_context, poll_nesting, usbtoxxx_context_t::type_pre, usbtoxxx_context_t::usbtoxxx_buffer, usbtoxxx_buffer_index, usbtoxxx_context_t::usbtoxxx_buffer_index, usbtoxxx_current_cmd_index, usbtoxxx_context_t::usbtoxxx_current_cmd_index, usbtoxxx_execute_command(), usbtoxxx_pop_context(), usbtoxxx_save_context(), versaloon_buf, versaloon_buf_size, VERSALOON_MAX_PENDING_NUMBER, versaloon_pending, usbtoxxx_context_t::versaloon_pending_idx, and versaloon_pending_idx.
Referenced by usbtodelay_delay(), usbtoinfo_get_abilities(), usbtopoll_checkfail(), usbtopoll_checkok(), usbtopoll_end(), usbtopoll_start(), usbtopoll_verifybuff(), and usbtoxxx_add_command().
RESULT usbtoxxx_execute_command | ( | void | ) |
Definition at line 106 of file usbtoxxx.c.
References versaloon_pending_t::actual_data_size, versaloon_want_pos_t::buff, versaloon_pending_t::callback, cmd, collect_cmd, collect_index, ERRCODE_FAILURE_OPERATION, ERRMSG_FAILURE_OPERATION, ERRMSG_INVALID_TARGET, ERRMSG_INVALID_USAGE, ERRMSG_NOT_SUPPORT_BY, ERROR_FAIL, ERROR_OK, LOG_BUG, LOG_ERROR, versaloon_want_pos_t::next, NULL, versaloon_want_pos_t::offset, poll_nesting, versaloon_pending_t::pos, RESULT, SET_LE_U16, versaloon_want_pos_t::size, sleep_ms, type, type_pre, USB_TO_ALL, USB_TO_XXX_CMD_NOT_SUPPORT, USB_TO_XXX_OK, usbtoxxx_buffer_index, usbtoxxx_get_type_name, usbtoxxx_validate_current_command_type(), versaloon_buf, versaloon_free_want_pos(), versaloon_pending, versaloon_pending_idx, and versaloon_send_command().
Referenced by usbtoxxx_ensure_buffer_size(), usbtoxxx_init(), and versaloon_set_target_voltage().
RESULT usbtoxxx_fini | ( | void | ) |
Definition at line 247 of file usbtoxxx.c.
References ERROR_OK, NULL, type_pre, and usbtoxxx_buffer.
Referenced by versaloon_fini().
RESULT usbtoxxx_init | ( | void | ) |
Definition at line 233 of file usbtoxxx.c.
References ERROR_FAIL, ERROR_OK, GET_LE_U32, LOG_INFO, usbtoinfo_get_abilities(), usbtoxxx_abilities, usbtoxxx_execute_command(), and versaloon_pending_idx.
Referenced by versaloon_init().
bool usbtoxxx_interface_supported | ( | uint8_t | cmd | ) |
Definition at line 254 of file usbtoxxx.c.
References cmd, usbtoxxx_abilities, VERSALOON_USB_TO_XXX_CMD_END, and VERSALOON_USB_TO_XXX_CMD_START.
|
static |
Definition at line 69 of file usbtoxxx.c.
References type_pre, usbtoxxx_context_t::type_pre, usbtoxxx_buffer, usbtoxxx_context_t::usbtoxxx_buffer, usbtoxxx_buffer_index, usbtoxxx_context_t::usbtoxxx_buffer_index, usbtoxxx_current_cmd_index, usbtoxxx_context_t::usbtoxxx_current_cmd_index, usbtoxxx_context_t::versaloon_pending_idx, and versaloon_pending_idx.
Referenced by usbtoxxx_ensure_buffer_size().
|
static |
Definition at line 60 of file usbtoxxx.c.
References type_pre, usbtoxxx_context_t::type_pre, usbtoxxx_buffer, usbtoxxx_context_t::usbtoxxx_buffer, usbtoxxx_buffer_index, usbtoxxx_context_t::usbtoxxx_buffer_index, usbtoxxx_current_cmd_index, usbtoxxx_context_t::usbtoxxx_current_cmd_index, usbtoxxx_context_t::versaloon_pending_idx, and versaloon_pending_idx.
Referenced by usbtopoll_start(), and usbtoxxx_ensure_buffer_size().
|
static |
Definition at line 78 of file usbtoxxx.c.
References collect_cmd, collect_index, ERRCODE_INVALID_BUFFER, ERRMSG_INVALID_BUFFER, ERROR_OK, LOG_BUG, SET_LE_U16, TO_STR, type_pre, usbtoxxx_buffer, usbtoxxx_buffer_index, usbtoxxx_current_cmd_index, and versaloon_buf.
Referenced by usbtodelay_delay(), usbtoinfo_get_abilities(), usbtopoll_checkfail(), usbtopoll_checkok(), usbtopoll_end(), usbtopoll_start(), usbtopoll_verifybuff(), usbtoxxx_add_command(), and usbtoxxx_execute_command().
|
static |
Definition at line 48 of file usbtoxxx.c.
Referenced by usbtoxxx_add_command(), usbtoxxx_execute_command(), and usbtoxxx_validate_current_command_type().
|
static |
Definition at line 47 of file usbtoxxx.c.
Referenced by usbtoxxx_add_command(), usbtoxxx_execute_command(), and usbtoxxx_validate_current_command_type().
|
static |
Definition at line 49 of file usbtoxxx.c.
Referenced by usbtopoll_start(), and usbtoxxx_ensure_buffer_size().
|
static |
Definition at line 49 of file usbtoxxx.c.
Referenced by usbtopoll_checkfail(), usbtopoll_checkok(), usbtopoll_end(), usbtopoll_start(), usbtopoll_verifybuff(), usbtoxxx_ensure_buffer_size(), and usbtoxxx_execute_command().
|
static |
Definition at line 42 of file usbtoxxx.c.
Referenced by usbtodelay_delay(), usbtoinfo_get_abilities(), usbtopoll_checkfail(), usbtopoll_checkok(), usbtopoll_end(), usbtopoll_start(), usbtopoll_verifybuff(), usbtoxxx_add_command(), usbtoxxx_execute_command(), usbtoxxx_fini(), usbtoxxx_pop_context(), usbtoxxx_save_context(), and usbtoxxx_validate_current_command_type().
|
static |
Definition at line 21 of file usbtoxxx.c.
uint8_t usbtoxxx_abilities[USB_TO_XXX_ABILITIES_LEN] |
Definition at line 36 of file usbtoxxx.c.
Referenced by usbtoxxx_init(), and usbtoxxx_interface_supported().
|
static |
Definition at line 45 of file usbtoxxx.c.
Referenced by usbtodelay_delay(), usbtopoll_checkfail(), usbtopoll_checkok(), usbtopoll_end(), usbtopoll_start(), usbtopoll_verifybuff(), usbtoxxx_add_command(), usbtoxxx_fini(), usbtoxxx_pop_context(), usbtoxxx_save_context(), and usbtoxxx_validate_current_command_type().
|
static |
Definition at line 43 of file usbtoxxx.c.
Referenced by usbtoxxx_ensure_buffer_size(), usbtoxxx_execute_command(), usbtoxxx_pop_context(), usbtoxxx_save_context(), and usbtoxxx_validate_current_command_type().
|
static |
Definition at line 44 of file usbtoxxx.c.
Referenced by usbtodelay_delay(), usbtopoll_checkfail(), usbtopoll_checkok(), usbtopoll_end(), usbtopoll_start(), usbtopoll_verifybuff(), usbtoxxx_add_command(), usbtoxxx_ensure_buffer_size(), usbtoxxx_pop_context(), usbtoxxx_save_context(), and usbtoxxx_validate_current_command_type().