7 #ifndef OPENOCD_JTAG_DRIVERS_VERSALOON_VERSALOON_INTERNAL_H
8 #define OPENOCD_JTAG_DRIVERS_VERSALOON_VERSALOON_INTERNAL_H
10 #define VERSALOON_PRODUCTSTRING_INDEX 2
11 #define VERSALOON_SERIALSTRING_INDEX 3
13 #define VERSALOON_PRODUCTSTRING "Versaloon"
15 #define VERSALOON_VID 0x0483
16 #define VERSALOON_PID 0xA038
17 #define VERSALOON_INP 0x82
18 #define VERSALOON_OUTP 0x03
19 #define VERSALOON_IFACE 0x00
21 #define VERSALOON_FULL 1
22 #define VERSALOON_MINI 2
23 #define VERSALOON_NANO 3
25 #define VERSALOON_TIMEOUT 5000
26 #define VERSALOON_TIMEOUT_LONG 60000
30 #define VERSALOON_COMMON_CMD_START 0x00
31 #define VERSALOON_COMMON_CMD_END 0x0F
33 #define VERSALOON_GET_INFO 0x00
34 #define VERSALOON_GET_TVCC 0x01
35 #define VERSALOON_GET_HARDWARE 0x02
36 #define VERSALOON_GET_OFFLINE_SIZE 0x08
37 #define VERSALOON_ERASE_OFFLINE_DATA 0x09
38 #define VERSALOON_WRITE_OFFLINE_DATA 0x0A
39 #define VERSALOON_GET_OFFLINE_CHECKSUM 0x0B
40 #define VERSALOON_FW_UPDATE 0x0F
41 #define VERSALOON_FW_UPDATE_KEY 0xAA
44 #define VERSALOON_MCU_CMD_START 0x10
45 #define VERSALOON_MCU_CMD_END 0x1F
48 #define VERSALOON_USB_TO_XXX_CMD_START 0x20
49 #define VERSALOON_USB_TO_XXX_CMD_END 0x7F
52 #define VERSALOON_VSLLINK_CMD_START 0x80
53 #define VERSALOON_VSLLINK_CMD_END 0xFF
62 #define VERSALOON_MAX_PENDING_NUMBER 4096
91 uint16_t want_pos, uint16_t want_size, uint8_t *
buffer, uint8_t
collect);
size_t size
Size of the control block search area.
struct versaloon_want_pos_t * pos
versaloon_callback_t callback
uint16_t actual_data_size
struct versaloon_want_pos_t * next
RESULT(* versaloon_callback_t)(void *, uint8_t *, uint8_t *)
void versaloon_set_callback(versaloon_callback_t callback)
void versaloon_free_want_pos(void)
void versaloon_set_pending_id(uint32_t id)
uint16_t versaloon_pending_idx
void versaloon_set_extra_data(void *p)
struct versaloon_pending_t versaloon_pending[VERSALOON_MAX_PENDING_NUMBER]
uint8_t * versaloon_cmd_buf
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)
#define VERSALOON_MAX_PENDING_NUMBER
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)