5 * Created on October 1, 2011, 11:29 PM
14 #include "stlink-common.h"
15 #include "uglylogging.h"
21 #define STLINK_SG_SIZE 31
22 #define STLINK_CMD_SIZE 16
24 struct stlink_libusb {
25 libusb_context* libusb_ctx;
26 libusb_device_handle* usb_handle;
30 unsigned int sg_transfer_idx;
36 * @param verbose Verbosity loglevel
37 * @param reset Reset stlink programmer
38 * @param serial Serial number to search for, when NULL the first stlink found is opened (binary format)
39 * @retval NULL Error while opening the stlink
40 * @retval !NULL Stlink found and ready to use
42 stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[16]);
43 size_t stlink_probe_usb(stlink_t **stdevs[]);
44 void stlink_probe_usb_free(stlink_t **stdevs[], size_t size);
50 #endif /* STLINK_USB_H */