OpenOCD
bitbang.h
Go to the documentation of this file.
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 
16 typedef enum {
19  BB_ERROR
21 
31  bb_value_t (*read)(void);
32 
35  size_t buf_size;
36 
38  int (*sample)(void);
39 
42 
44  int (*write)(int tck, int tms, int tdi);
45 
47  int (*blink)(int on);
48 
50  int (*swdio_read)(void);
51 
53  void (*swdio_drive)(bool on);
54 
56  int (*swd_write)(int swclk, int swdio);
57 };
58 
59 extern const struct swd_driver bitbang_swd;
60 
61 int bitbang_execute_queue(void);
62 
64 
65 #endif /* OPENOCD_JTAG_DRIVERS_BITBANG_H */
struct bitbang_interface * bitbang_interface
Definition: bitbang.c:34
int bitbang_execute_queue(void)
Definition: bitbang.c:281
const struct swd_driver bitbang_swd
Definition: bitbang.c:569
bb_value_t
Definition: bitbang.h:16
@ BB_LOW
Definition: bitbang.h:17
@ BB_HIGH
Definition: bitbang.h:18
@ BB_ERROR
Definition: bitbang.h:19
Low level callbacks (for bitbang).
Definition: bitbang.h:29
int(* swdio_read)(void)
Sample SWDIO and return the value.
Definition: bitbang.h:50
int(* swd_write)(int swclk, int swdio)
Set SWCLK and SWDIO to the given value.
Definition: bitbang.h:56
int(* sample)(void)
Sample TDO and put the result in a buffer.
Definition: bitbang.h:38
bb_value_t(* read)(void)
Sample TDO and return the value.
Definition: bitbang.h:31
bb_value_t(* read_sample)(void)
Return the next unread value from the buffer.
Definition: bitbang.h:41
int(* write)(int tck, int tms, int tdi)
Set TCK, TMS, and TDI to the given values.
Definition: bitbang.h:44
void(* swdio_drive)(bool on)
Set direction of SWDIO.
Definition: bitbang.h:53
size_t buf_size
The number of TDO samples that can be buffered up before the caller has to call read_sample.
Definition: bitbang.h:35
int(* blink)(int on)
Blink led (optional).
Definition: bitbang.h:47