1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef OPENOCD_JTAG_DRIVERS_CMSIS_DAP_H
4 #define OPENOCD_JTAG_DRIVERS_CMSIS_DAP_H
8 struct cmsis_dap_backend;
9 struct cmsis_dap_backend_data;
10 struct command_registration;
13 struct cmsis_dap_backend_data *bdata;
14 const struct cmsis_dap_backend *backend;
17 uint8_t *packet_buffer;
18 uint16_t packet_buffer_size;
27 struct cmsis_dap_backend {
29 int (*open)(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], const char *serial);
30 void (*close)(struct cmsis_dap *dap);
31 int (*read)(struct cmsis_dap *dap, int timeout_ms);
32 int (*write)(struct cmsis_dap *dap, int len, int timeout_ms);
33 int (*packet_buffer_alloc)(struct cmsis_dap *dap, unsigned int pkt_sz);
36 extern const struct cmsis_dap_backend cmsis_dap_hid_backend;
37 extern const struct cmsis_dap_backend cmsis_dap_usb_backend;
38 extern const struct command_registration cmsis_dap_usb_subcommand_handlers[];
40 #define REPORT_ID_SIZE 1