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 #include <jtag/commands.h>
16 
17 typedef enum {
20  BB_ERROR
22 
32  bb_value_t (*read)(void);
33 
36  size_t buf_size;
37 
39  int (*sample)(void);
40 
43 
45  int (*write)(int tck, int tms, int tdi);
46 
48  int (*blink)(bool on);
49 
51  int (*swdio_read)(void);
52 
54  void (*swdio_drive)(bool on);
55 
57  int (*swd_write)(int swclk, int swdio);
58 
60  int (*sleep)(unsigned int microseconds);
61 
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 
71 
72 #endif /* OPENOCD_JTAG_DRIVERS_BITBANG_H */
struct bitbang_interface * bitbang_interface
Definition: bitbang.c:40
int bitbang_execute_queue(struct jtag_command *cmd_queue)
Definition: bitbang.c:293
const struct swd_driver bitbang_swd
Definition: bitbang.c:614
bb_value_t
Definition: bitbang.h:17
@ BB_LOW
Definition: bitbang.h:18
@ BB_HIGH
Definition: bitbang.h:19
@ BB_ERROR
Definition: bitbang.h:20
Low level callbacks (for bitbang).
Definition: bitbang.h:30
int(* sleep)(unsigned int microseconds)
Sleep for some number of microseconds.
Definition: bitbang.h:60
int(* swdio_read)(void)
Sample SWDIO and return the value.
Definition: bitbang.h:51
int(* swd_write)(int swclk, int swdio)
Set SWCLK and SWDIO to the given value.
Definition: bitbang.h:57
int(* sample)(void)
Sample TDO and put the result in a buffer.
Definition: bitbang.h:39
bb_value_t(* read)(void)
Sample TDO and return the value.
Definition: bitbang.h:32
bb_value_t(* read_sample)(void)
Return the next unread value from the buffer.
Definition: bitbang.h:42
int(* flush)(void)
Force a flush.
Definition: bitbang.h:63
int(* write)(int tck, int tms, int tdi)
Set TCK, TMS, and TDI to the given values.
Definition: bitbang.h:45
void(* swdio_drive)(bool on)
Set direction of SWDIO.
Definition: bitbang.h:54
int(* blink)(bool on)
Blink led (optional).
Definition: bitbang.h:48
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:36