OpenOCD
cmsis_dap.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef OPENOCD_JTAG_DRIVERS_CMSIS_DAP_H
4 #define OPENOCD_JTAG_DRIVERS_CMSIS_DAP_H
5 
6 #include <stdint.h>
7 
8 struct cmsis_dap_backend;
11 
12 struct cmsis_dap {
14  const struct cmsis_dap_backend *backend;
15  uint16_t packet_size;
17  uint8_t *packet_buffer;
19  uint8_t *command;
20  uint8_t *response;
21  uint16_t caps;
22  uint8_t mode;
23  uint32_t swo_buf_sz;
25 };
26 
28  const char *name;
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);
34 };
35 
36 extern const struct cmsis_dap_backend cmsis_dap_hid_backend;
37 extern const struct cmsis_dap_backend cmsis_dap_usb_backend;
39 
40 #define REPORT_ID_SIZE 1
41 
42 #endif
char * serial
Definition: adapter.c:47
const struct cmsis_dap_backend cmsis_dap_usb_backend
const struct command_registration cmsis_dap_usb_subcommand_handlers[]
const struct cmsis_dap_backend cmsis_dap_hid_backend
const char * name
Definition: cmsis_dap.h:28
int(* read)(struct cmsis_dap *dap, int timeout_ms)
Definition: cmsis_dap.h:31
int(* packet_buffer_alloc)(struct cmsis_dap *dap, unsigned int pkt_sz)
Definition: cmsis_dap.h:33
void(* close)(struct cmsis_dap *dap)
Definition: cmsis_dap.h:30
int(* open)(struct cmsis_dap *dap, uint16_t vids[], uint16_t pids[], const char *serial)
Definition: cmsis_dap.h:29
int(* write)(struct cmsis_dap *dap, int len, int timeout_ms)
Definition: cmsis_dap.h:32
uint16_t caps
Definition: cmsis_dap.h:21
struct cmsis_dap_backend_data * bdata
Definition: cmsis_dap.h:13
uint8_t mode
Definition: cmsis_dap.h:22
bool trace_enabled
Definition: cmsis_dap.h:24
uint8_t * response
Definition: cmsis_dap.h:20
uint16_t packet_size
Definition: cmsis_dap.h:15
uint8_t * command
Definition: cmsis_dap.h:19
uint8_t * packet_buffer
Definition: cmsis_dap.h:17
int packet_count
Definition: cmsis_dap.h:16
const struct cmsis_dap_backend * backend
Definition: cmsis_dap.h:14
uint32_t swo_buf_sz
Definition: cmsis_dap.h:23
uint16_t packet_buffer_size
Definition: cmsis_dap.h:18