1 #ifndef OPENOCD_JTAG_DRIVERS_CMSIS_DAP_H
2 #define OPENOCD_JTAG_DRIVERS_CMSIS_DAP_H
6 struct cmsis_dap_backend;
7 struct cmsis_dap_backend_data;
8 struct command_registration;
11 struct cmsis_dap_backend_data *bdata;
12 const struct cmsis_dap_backend *backend;
15 uint8_t *packet_buffer;
16 uint16_t packet_buffer_size;
25 struct cmsis_dap_backend {
27 int (*open)(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], const char *serial);
28 void (*close)(struct cmsis_dap *dap);
29 int (*read)(struct cmsis_dap *dap, int timeout_ms);
30 int (*write)(struct cmsis_dap *dap, int len, int timeout_ms);
31 int (*packet_buffer_alloc)(struct cmsis_dap *dap, unsigned int pkt_sz);
34 extern const struct cmsis_dap_backend cmsis_dap_hid_backend;
35 extern const struct cmsis_dap_backend cmsis_dap_usb_backend;
36 extern const struct command_registration cmsis_dap_usb_subcommand_handlers[];
38 #define REPORT_ID_SIZE 1