drivers/linuxgpiod: Migrate to adapter gpio commands
[fw/openocd] / src / jtag / minidriver.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  *   Copyright (C) 2009 Zachary T Welch                                    *
11  *   zw@superlucidity.net                                                  *
12  ***************************************************************************/
13
14 #ifndef OPENOCD_JTAG_MINIDRIVER_H
15 #define OPENOCD_JTAG_MINIDRIVER_H
16
17 /**
18  * @page jtagminidriver JTAG Mini-Driver
19  *
20  * The JTAG minidriver interface allows the definition of alternate
21  * interface functions, instead of the built-in asynchronous driver
22  * module that is used by the standard JTAG interface drivers.
23  *
24  * In addition to the functions defined in the @c minidriver.h file, the
25  * @c jtag_minidriver.h file must declare the following functions (or
26  * define static inline versions of them):
27  * - jtag_add_callback
28  * - jtag_add_callback4
29  *
30  * The following core functions are declared in this file for use by
31  * the minidriver and do @b not need to be defined by an implementation:
32  * - default_interface_jtag_execute_queue()
33  */
34
35 /* this header will be provided by the minidriver implementation, */
36 /* and it may provide additional declarations that must be defined. */
37 #include <jtag/drivers/minidriver_imp.h>
38
39 int interface_jtag_add_ir_scan(struct jtag_tap *active,
40                 const struct scan_field *fields,
41                 tap_state_t endstate);
42 int interface_jtag_add_plain_ir_scan(
43                 int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
44                 tap_state_t endstate);
45
46 int interface_jtag_add_dr_scan(struct jtag_tap *active,
47                 int num_fields, const struct scan_field *fields,
48                 tap_state_t endstate);
49 int interface_jtag_add_plain_dr_scan(
50                 int num_bits, const uint8_t *out_bits, uint8_t *in_bits,
51                 tap_state_t endstate);
52
53 int interface_jtag_add_tlr(void);
54 int interface_jtag_add_pathmove(int num_states, const tap_state_t *path);
55 int interface_jtag_add_runtest(int num_cycles, tap_state_t endstate);
56
57 int interface_add_tms_seq(unsigned num_bits,
58                 const uint8_t *bits, enum tap_state state);
59
60 /**
61  * This drives the actual srst and trst pins. srst will always be 0
62  * if jtag_reset_config & RESET_SRST_PULLS_TRST != 0 and ditto for
63  * trst.
64  *
65  * the higher level jtag_add_reset will invoke jtag_add_tlr() if
66  * appropriate
67  */
68 int interface_jtag_add_reset(int trst, int srst);
69 int interface_jtag_add_sleep(uint32_t us);
70 int interface_jtag_add_clocks(int num_cycles);
71 int interface_jtag_execute_queue(void);
72
73 /**
74  * Calls the interface callback to execute the queue.  This routine
75  * is used by the JTAG driver layer and should not be called directly.
76  */
77 int default_interface_jtag_execute_queue(void);
78
79 #endif /* OPENOCD_JTAG_MINIDRIVER_H */