Fix stm32l readmem32.
[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 #include "stlink-common.h"
17     
18 #define STLINK_CMD_SIZE 16
19
20 #if defined(CONFIG_USE_LIBUSB)
21     struct stlink_libusb {
22         libusb_context* libusb_ctx;
23         libusb_device_handle* usb_handle;
24         struct libusb_transfer* req_trans;
25         struct libusb_transfer* rep_trans;
26         unsigned int ep_req;
27         unsigned int ep_rep;
28     };
29 #else
30 #error "it's all bad!"
31     struct stlink_libusb {};
32 #endif
33
34     
35     stlink_t* stlink_open_usb(const char *dev_name, const int verbose);
36
37
38 #ifdef  __cplusplus
39 }
40 #endif
41
42 #endif  /* STLINK_USB_H */
43