summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/usb_common.h13
-rw-r--r--components/drivers/include/drivers/usb_device.h9
2 files changed, 22 insertions, 0 deletions
diff --git a/components/drivers/include/drivers/usb_common.h b/components/drivers/include/drivers/usb_common.h
index 7398fc3814..764dcd5612 100644
--- a/components/drivers/include/drivers/usb_common.h
+++ b/components/drivers/include/drivers/usb_common.h
@@ -216,6 +216,19 @@ extern "C" {
#define HID_REPORT_ID_GENERAL 5
#define HID_REPORT_ID_MOUSE 6
+/*
+ * Time of usb timeout
+ */
+#ifndef USB_TIMEOUT_BASIC
+#define USB_TIMEOUT_BASIC (RT_TICK_PER_SECOND) /* 1s */
+#endif
+#ifndef USB_TIMEOUT_LONG
+#define USB_TIMEOUT_LONG (RT_TICK_PER_SECOND * 5) /* 5s */
+#endif
+#ifndf USB_DEBOUNCE_TIME
+#define USB_DEBOUNCE_TIME (RT_TICK_PER_SECOND / 5) /* 0.2s */
+#endif
+
#define uswap_32(x) \
((((x) & 0xff000000) >> 24) | \
(((x) & 0x00ff0000) >> 8) | \
diff --git a/components/drivers/include/drivers/usb_device.h b/components/drivers/include/drivers/usb_device.h
index cb4122fdaf..26f0c4cf4a 100644
--- a/components/drivers/include/drivers/usb_device.h
+++ b/components/drivers/include/drivers/usb_device.h
@@ -17,6 +17,10 @@
#include <rtthread.h>
#include "drivers/usb_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Vendor ID */
#ifdef USB_VENDOR_ID
#define _VENDOR_ID USB_VENDOR_ID
@@ -453,4 +457,9 @@ rt_inline void usbd_os_proerty_descriptor_send(ufunction_t func, ureq_t setup, u
}
rt_usbd_ep0_write(func->device, data, setup->wLength);
}
+
+#ifdef __cplusplus
+}
+#endif
+
#endif