X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstlink-usb.h;fp=src%2Fstlink-usb.h;h=747d54c7480bdfb1d815c13657099d833b0299fa;hb=6fe3a02c18ccfc8d5d9b15b6de1ac01f40fdaf33;hp=801cafad3232b9f333b9fec5ac2e453584d74183;hpb=17e3571a93284410ae96e8e4b227ca93bd87e065;p=fw%2Fstlink diff --git a/src/stlink-usb.h b/src/stlink-usb.h index 801cafa..747d54c 100644 --- a/src/stlink-usb.h +++ b/src/stlink-usb.h @@ -6,14 +6,17 @@ */ #ifndef STLINK_USB_H -#define STLINK_USB_H - -#ifdef __cplusplus -extern "C" { -#endif +#define STLINK_USB_H +#include #include + #include "stlink-common.h" +#include "uglylogging.h" + +#ifdef __cplusplus +extern "C" { +#endif #define STLINK_SG_SIZE 31 #define STLINK_CMD_SIZE 16 @@ -28,13 +31,21 @@ extern "C" { unsigned int cmd_len; }; - stlink_t* stlink_open_usb(const int verbose, int reset, char *p_usb_iserial); + /** + * Open a stlink + * @param verbose Verbosity loglevel + * @param reset Reset stlink programmer + * @param serial Serial number to search for, when NULL the first stlink found is opened (binary format) + * @retval NULL Error while opening the stlink + * @retval !NULL Stlink found and ready to use + */ + stlink_t *stlink_open_usb(enum ugly_loglevel verbose, bool reset, char serial[16]); size_t stlink_probe_usb(stlink_t **stdevs[]); void stlink_probe_usb_free(stlink_t **stdevs[], size_t size); -#ifdef __cplusplus +#ifdef __cplusplus } #endif -#endif /* STLINK_USB_H */ +#endif /* STLINK_USB_H */