Commit ed9bd66b413f152bf79798886f1ef9d3e56539e1

Kano 2014-03-02T00:34:09

AntS1 - add detection information to usbutils

diff --git a/usbutils.c b/usbutils.c
index ecb5aca..204dd6b 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -60,6 +60,9 @@ static cgtimer_t usb11_cgt;
 #define DRILLBIT_TIMEOUT_MS 999
 #define ICARUS_TIMEOUT_MS 999
 
+// There is no windows version
+#define ANT_S1_TIMEOUT_MS 200
+
 #ifdef WIN32
 #define BFLSC_TIMEOUT_MS 999
 #define BITFORCE_TIMEOUT_MS 999
@@ -323,6 +326,17 @@ static struct usb_intinfo cointerra_ints[] = {
 };
 #endif
 
+#ifdef USE_ANT_S1
+static struct usb_epinfo ants1_epinfos[] = {
+	{ LIBUSB_TRANSFER_TYPE_BULK,	64,	EPI(1), 0, 0 },
+	{ LIBUSB_TRANSFER_TYPE_BULK,	64,	EPO(1), 0, 0 }
+};
+
+static struct usb_intinfo ants1_ints[] = {
+	USB_EPS(0, ants1_epinfos)
+};
+#endif
+
 #define IDVENDOR_FTDI 0x0403
 
 #define INTINFO(_ints) \
@@ -589,6 +603,18 @@ static struct usb_find_devices find_dev[] = {
 		.latency = LATENCY_STD,
 		INTINFO(cointerra_ints) },
 #endif
+#ifdef USE_ANT_S1
+	{
+		.drv = DRIVER_ants1,
+		.name = "ANT",
+		.ident = IDENT_ANT,
+		.idVendor = 0x4254,
+		.idProduct = 0x4153,
+		.config = 1,
+		.timeout = ANT_S1_TIMEOUT_MS,
+		.latency = LATENCY_ANTS1,
+		INTINFO(ants1_ints) },
+#endif
 	{ DRIVER_MAX, NULL, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, NULL }
 };
 
diff --git a/usbutils.h b/usbutils.h
index 4a40475..db360d0 100644
--- a/usbutils.h
+++ b/usbutils.h
@@ -135,6 +135,7 @@ struct usb_intinfo {
 enum sub_ident {
 	IDENT_UNK = 0,
 	IDENT_AMU,
+	IDENT_ANT,
 	IDENT_ANU,
 	IDENT_AVA,
 	IDENT_BAJ,
@@ -179,6 +180,7 @@ struct usb_find_devices {
  * baud rate, to avoid status bytes being interleaved in larger transfers. */
 #define LATENCY_UNUSED 0
 #define LATENCY_STD 32
+#define LATENCY_ANTS1 10
 
 enum usb_types {
 	USB_TYPE_STD = 0,