extern "C" {
#endif
+#include <libusb-1.0/libusb.h>
#include "stlink-common.h"
// device access
-#if defined(CONFIG_USE_LIBUSB)
struct stlink_libsg {
+ libusb_context* libusb_ctx;
+ libusb_device_handle *handle;
+
int sg_fd;
int do_scsi_pt_err;
// Sense (error information) data
unsigned char sense_buf[SENSE_BUF_LEN];
- uint32_t st_vid;
- uint32_t stlink_pid;
- uint32_t stlink_v;
- uint32_t jtag_v;
- uint32_t swim_v;
- uint32_t core_id;
-
reg reg;
};
-#else
- struct stlink_libsg {};
-#endif
+ stlink_t* stlink_v1_open(const char *dev_name, const int verbose);
#ifdef __cplusplus
}