4b6949e42f100d3a7c367813bd6fd519a018625d
[fw/openocd] / src / jtag / stlink / stlink_interface.h
1 /***************************************************************************
2  *   Copyright (C) 2011 by Mathias Kuester                                 *
3  *   Mathias Kuester <kesmtp@freenet.de>                                   *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19  ***************************************************************************/
20
21 #ifndef _STLINK_INTERFACE_
22 #define _STLINK_INTERFACE_
23
24 /** */
25 struct target;
26 /** */
27 enum e_stlink_transports;
28 /** */
29 extern const char *stlink_transports[];
30
31 struct stlink_interface_param_s {
32         /** */
33         char *device_desc;
34         /** */
35         char *serial;
36         /** */
37         uint16_t vid;
38         /** */
39         uint16_t pid;
40         /** */
41         enum stlink_transports transport;
42 };
43
44 struct stlink_interface_s {
45         /** */
46         struct stlink_interface_param_s param;
47         /** */
48         const struct stlink_layout *layout;
49         /** */
50         void *fd;
51 };
52
53 /** */
54 int stlink_interface_open(enum stlink_transports tr);
55 /** */
56 int stlink_interface_init_target(struct target *t);
57
58 #endif