OpenOCD
hla_layout.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2011 by Mathias Kuester *
5  * Mathias Kuester <kesmtp@freenet.de> *
6  * *
7  * Copyright (C) 2012 by Spencer Oliver *
8  * spen@spen-soft.co.uk *
9  ***************************************************************************/
10 
11 #ifndef OPENOCD_JTAG_HLA_HLA_LAYOUT_H
12 #define OPENOCD_JTAG_HLA_HLA_LAYOUT_H
13 
14 #include <target/armv7m_trace.h>
15 #include <target/arm_tpiu_swo.h>
16 
18 struct hl_interface_s;
20 
25 
29  int (*open)(struct hl_interface_param_s *param, void **handle);
31  int (*close)(void *handle);
33  int (*reset)(void *handle);
35  int (*assert_srst)(void *handle, int srst);
37  int (*run)(void *handle);
39  int (*halt)(void *handle);
41  int (*step)(void *handle);
43  int (*read_regs)(void *handle);
53  int (*read_reg)(void *handle, unsigned int regsel, uint32_t *val);
62  int (*write_reg)(void *handle, unsigned int regsel, uint32_t val);
64  int (*read_mem)(void *handle, uint32_t addr, uint32_t size,
65  uint32_t count, uint8_t *buffer);
67  int (*write_mem)(void *handle, uint32_t addr, uint32_t size,
68  uint32_t count, const uint8_t *buffer);
70  int (*write_debug_reg)(void *handle, uint32_t addr, uint32_t val);
81  int (*idcode)(void *handle, uint32_t *idcode);
83  int (*override_target)(const char *targetname);
85  int (*custom_command)(void *handle, const char *command);
87  int (*speed)(void *handle, int khz, bool query);
100  int (*config_trace)(void *handle, bool enabled,
101  enum tpiu_pin_protocol pin_protocol, uint32_t port_size,
102  unsigned int *trace_freq, unsigned int traceclkin_freq,
103  uint16_t *prescaler);
114  int (*poll_trace)(void *handle, uint8_t *buf, size_t *size);
116  enum target_state (*state)(void *fd);
117 };
118 
120 struct hl_layout {
122  char *name;
124  int (*open)(struct hl_interface_s *adapter);
126  int (*close)(struct hl_interface_s *adapter);
129 };
130 
132 const struct hl_layout *hl_layout_get_list(void);
135 
136 #endif /* OPENOCD_JTAG_HLA_HLA_LAYOUT_H */
static struct aice_port_param_s param
tpiu_pin_protocol
Definition: arm_tpiu_swo.h:7
Holds the interface to ITM and DWT configuration functions.
static struct libusb_device_handle * adapter
Definition: ft232r.c:63
const struct hl_layout * hl_layout_get_list(void)
Definition: hla_layout.c:77
struct hl_layout_api_s stlink_usb_layout_api
Definition: stlink_usb.c:3997
struct hl_layout_api_s nulink_usb_layout_api
Definition: nulink_usb.c:1157
int hl_layout_init(struct hl_interface_s *adapter)
Definition: hla_layout.c:82
struct hl_layout_api_s icdi_usb_layout_api
Definition: ti_icdi_usb.c:746
uint32_t addr
Definition: nuttx.c:65
size_t size
Size of the control block search area.
Definition: rtt/rtt.c:30
int(* run)(void *handle)
Definition: hla_layout.h:37
int(* write_debug_reg)(void *handle, uint32_t addr, uint32_t val)
Definition: hla_layout.h:70
int(* poll_trace)(void *handle, uint8_t *buf, size_t *size)
Poll for new trace data.
Definition: hla_layout.h:114
enum target_state(* state)(void *fd)
Definition: hla_layout.h:116
int(* speed)(void *handle, int khz, bool query)
Definition: hla_layout.h:87
int(* halt)(void *handle)
Definition: hla_layout.h:39
int(* read_regs)(void *handle)
Definition: hla_layout.h:43
int(* override_target)(const char *targetname)
Definition: hla_layout.h:83
int(* custom_command)(void *handle, const char *command)
Definition: hla_layout.h:85
int(* write_reg)(void *handle, unsigned int regsel, uint32_t val)
Write one register to the target.
Definition: hla_layout.h:62
int(* idcode)(void *handle, uint32_t *idcode)
Read the idcode of the target connected to the adapter.
Definition: hla_layout.h:81
int(* read_mem)(void *handle, uint32_t addr, uint32_t size, uint32_t count, uint8_t *buffer)
Definition: hla_layout.h:64
int(* write_mem)(void *handle, uint32_t addr, uint32_t size, uint32_t count, const uint8_t *buffer)
Definition: hla_layout.h:67
int(* read_reg)(void *handle, unsigned int regsel, uint32_t *val)
Read one register from the target.
Definition: hla_layout.h:53
int(* config_trace)(void *handle, bool enabled, enum tpiu_pin_protocol pin_protocol, uint32_t port_size, unsigned int *trace_freq, unsigned int traceclkin_freq, uint16_t *prescaler)
Configure trace parameters for the adapter.
Definition: hla_layout.h:100
int(* close)(void *handle)
Definition: hla_layout.h:31
int(* open)(struct hl_interface_param_s *param, void **handle)
Definition: hla_layout.h:29
int(* step)(void *handle)
Definition: hla_layout.h:41
int(* reset)(void *handle)
Definition: hla_layout.h:33
int(* assert_srst)(void *handle, int srst)
Definition: hla_layout.h:35
struct hl_layout_api_s * api
Definition: hla_layout.h:128
char * name
Definition: hla_layout.h:122
int(* close)(struct hl_interface_s *adapter)
Definition: hla_layout.h:126
int(* open)(struct hl_interface_s *adapter)
Definition: hla_layout.h:124
target_state
Definition: target.h:52
uint8_t count[4]
Definition: vdebug.c:22