Initial commit of workable stm32l debug
[fw/stlink] / src / stlink-usb.h
1 /* 
2  * File:   stlink-usb.h
3  * Author: karl
4  *
5  * Created on October 1, 2011, 11:29 PM
6  */
7
8 #ifndef STLINK_USB_H
9 #define STLINK_USB_H
10
11 #ifdef  __cplusplus
12 extern "C" {
13 #endif
14
15 #include <libusb-1.0/libusb.h>
16
17 #if defined(CONFIG_USE_LIBUSB)
18     struct stlink_libusb {
19         libusb_context* libusb_ctx;
20         libusb_device_handle* usb_handle;
21         struct libusb_transfer* req_trans;
22         struct libusb_transfer* rep_trans;
23         unsigned int ep_req;
24         unsigned int ep_rep;
25     };
26 #else
27 #error "it's all bad!"
28     struct stlink_libusb {};
29 #endif
30
31     
32     stlink_t* stlink_open_usb(const char *dev_name, const int verbose);
33
34
35 #ifdef  __cplusplus
36 }
37 #endif
38
39 #endif  /* STLINK_USB_H */
40