stlink: remove unused assignment
[openocd.git] / src / jtag / drivers / bitbang.h
1 /***************************************************************************
2 * Copyright (C) 2005 by Dominic Rath *
3 * Dominic.Rath@gmx.de *
4 * *
5 * Copyright (C) 2007,2008 Øyvind Harboe *
6 * oyvind.harboe@zylin.com *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
20 ***************************************************************************/
21
22 #ifndef OPENOCD_JTAG_DRIVERS_BITBANG_H
23 #define OPENOCD_JTAG_DRIVERS_BITBANG_H
24
25 #include <jtag/swd.h>
26
27 typedef enum {
28 BB_LOW,
29 BB_HIGH,
30 BB_ERROR
31 } bb_value_t;
32
33 /** Low level callbacks (for bitbang).
34 *
35 * Either read(), or sample() and read_sample() must be implemented.
36 *
37 * The sample functions allow an interface to batch a number of writes and
38 * sample requests together. Not waiting for a value to come back can greatly
39 * increase throughput. */
40 struct bitbang_interface {
41 /** Sample TDO. */
42 bb_value_t (*read)(void);
43
44 /** The number of TDO samples that can be buffered up before the caller has
45 * to call read_sample. */
46 size_t buf_size;
47 /** Sample TDO and put the result in a buffer. */
48 int (*sample)(void);
49 /** Return the next unread value from the buffer. */
50 bb_value_t (*read_sample)(void);
51
52 /** Set TCK, TMS, and TDI to the given values. */
53 int (*write)(int tck, int tms, int tdi);
54 int (*reset)(int trst, int srst);
55 int (*blink)(int on);
56 int (*swdio_read)(void);
57 void (*swdio_drive)(bool on);
58 };
59
60 const struct swd_driver bitbang_swd;
61
62 extern bool swd_mode;
63
64 int bitbang_execute_queue(void);
65
66 extern struct bitbang_interface *bitbang_interface;
67 void bitbang_switch_to_swd(void);
68 int bitbang_swd_switch_seq(enum swd_special_seq seq);
69
70 #endif /* OPENOCD_JTAG_DRIVERS_BITBANG_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)