jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / jtag / hla / hla_layout.h
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
17 /** */
18 struct hl_interface_s;
19 struct hl_interface_param_s;
20
21 /** */
22 extern struct hl_layout_api_s stlink_usb_layout_api;
23 extern struct hl_layout_api_s icdi_usb_layout_api;
24 extern struct hl_layout_api_s nulink_usb_layout_api;
25
26 /** */
27 struct hl_layout_api_s {
28 /** */
29 int (*open)(struct hl_interface_param_s *param, void **handle);
30 /** */
31 int (*close)(void *handle);
32 /** */
33 int (*reset)(void *handle);
34 /** */
35 int (*assert_srst)(void *handle, int srst);
36 /** */
37 int (*run)(void *handle);
38 /** */
39 int (*halt)(void *handle);
40 /** */
41 int (*step)(void *handle);
42 /** */
43 int (*read_regs)(void *handle);
44 /**
45 * Read one register from the target
46 *
47 * @param handle A pointer to the device-specific handle
48 * @param regsel Register selection index compatible with all the
49 * values allowed by armv7m DCRSR.REGSEL
50 * @param val A pointer to retrieve the register value
51 * @returns ERROR_OK on success, or an error code on failure.
52 */
53 int (*read_reg)(void *handle, unsigned int regsel, uint32_t *val);
54 /**
55 * Write one register to the target
56 * @param handle A pointer to the device-specific handle
57 * @param regsel Register selection index compatible with all the
58 * values allowed by armv7m DCRSR.REGSEL
59 * @param val The value to be written in the register
60 * @returns ERROR_OK on success, or an error code on failure.
61 */
62 int (*write_reg)(void *handle, unsigned int regsel, uint32_t val);
63 /** */
64 int (*read_mem)(void *handle, uint32_t addr, uint32_t size,
65 uint32_t count, uint8_t *buffer);
66 /** */
67 int (*write_mem)(void *handle, uint32_t addr, uint32_t size,
68 uint32_t count, const uint8_t *buffer);
69 /** */
70 int (*write_debug_reg)(void *handle, uint32_t addr, uint32_t val);
71 /**
72 * Read the idcode of the target connected to the adapter
73 *
74 * If the adapter doesn't support idcode retrieval, this callback should
75 * store 0 to indicate a wildcard match.
76 *
77 * @param handle A pointer to the device-specific handle
78 * @param idcode Storage for the detected idcode
79 * @returns ERROR_OK on success, or an error code on failure.
80 */
81 int (*idcode)(void *handle, uint32_t *idcode);
82 /** */
83 int (*override_target)(const char *targetname);
84 /** */
85 int (*custom_command)(void *handle, const char *command);
86 /** */
87 int (*speed)(void *handle, int khz, bool query);
88 /**
89 * Configure trace parameters for the adapter
90 *
91 * @param handle A handle to adapter
92 * @param enabled Whether to enable trace
93 * @param pin_protocol Configured pin protocol
94 * @param port_size Trace port width for sync mode
95 * @param trace_freq A pointer to the configured trace
96 * frequency; if it points to 0, the adapter driver must write
97 * its maximum supported rate there
98 * @returns ERROR_OK on success, an error code on failure.
99 */
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);
104 /**
105 * Poll for new trace data
106 *
107 * @param handle A handle to adapter
108 * @param buf A pointer to buffer to store received data
109 * @param size A pointer to buffer size; must be filled with
110 * the actual amount of bytes written
111 *
112 * @returns ERROR_OK on success, an error code on failure.
113 */
114 int (*poll_trace)(void *handle, uint8_t *buf, size_t *size);
115 /** */
116 enum target_state (*state)(void *fd);
117 };
118
119 /** */
120 struct hl_layout {
121 /** */
122 char *name;
123 /** */
124 int (*open)(struct hl_interface_s *adapter);
125 /** */
126 int (*close)(struct hl_interface_s *adapter);
127 /** */
128 struct hl_layout_api_s *api;
129 };
130
131 /** */
132 const struct hl_layout *hl_layout_get_list(void);
133 /** */
134 int hl_layout_init(struct hl_interface_s *adapter);
135
136 #endif /* OPENOCD_JTAG_HLA_HLA_LAYOUT_H */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)