jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / jtag / drivers / bitbang.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4 * Copyright (C) 2005 by Dominic Rath *
5 * Dominic.Rath@gmx.de *
6 * *
7 * Copyright (C) 2007,2008 Øyvind Harboe *
8 * oyvind.harboe@zylin.com *
9 ***************************************************************************/
10
11 #ifndef OPENOCD_JTAG_DRIVERS_BITBANG_H
12 #define OPENOCD_JTAG_DRIVERS_BITBANG_H
13
14 #include <jtag/swd.h>
15 #include <jtag/commands.h>
16
17 typedef enum {
18 BB_LOW,
19 BB_HIGH,
20 BB_ERROR
21 } bb_value_t;
22
23 /** Low level callbacks (for bitbang).
24 *
25 * Either read(), or sample() and read_sample() must be implemented.
26 *
27 * The sample functions allow an interface to batch a number of writes and
28 * sample requests together. Not waiting for a value to come back can greatly
29 * increase throughput. */
30 struct bitbang_interface {
31 /** Sample TDO and return the value. */
32 bb_value_t (*read)(void);
33
34 /** The number of TDO samples that can be buffered up before the caller has
35 * to call read_sample. */
36 size_t buf_size;
37
38 /** Sample TDO and put the result in a buffer. */
39 int (*sample)(void);
40
41 /** Return the next unread value from the buffer. */
42 bb_value_t (*read_sample)(void);
43
44 /** Set TCK, TMS, and TDI to the given values. */
45 int (*write)(int tck, int tms, int tdi);
46
47 /** Blink led (optional). */
48 int (*blink)(int on);
49
50 /** Sample SWDIO and return the value. */
51 int (*swdio_read)(void);
52
53 /** Set direction of SWDIO. */
54 void (*swdio_drive)(bool on);
55
56 /** Set SWCLK and SWDIO to the given value. */
57 int (*swd_write)(int swclk, int swdio);
58
59 /** Sleep for some number of microseconds. **/
60 int (*sleep)(unsigned int microseconds);
61
62 /** Force a flush. */
63 int (*flush)(void);
64 };
65
66 extern const struct swd_driver bitbang_swd;
67
68 int bitbang_execute_queue(struct jtag_command *cmd_queue);
69
70 extern struct bitbang_interface *bitbang_interface;
71
72 #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)