|
@@ -24,16 +24,16 @@
|
|
|
* This file is part of the TinyUSB stack.
|
|
* This file is part of the TinyUSB stack.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-#ifndef TUSB_DCD_ATTR_H_
|
|
|
|
|
-#define TUSB_DCD_ATTR_H_
|
|
|
|
|
-
|
|
|
|
|
-#include "tusb_option.h"
|
|
|
|
|
-
|
|
|
|
|
-// Attribute includes
|
|
|
|
|
-// - ENDPOINT_MAX: max (logical) number of endpoint
|
|
|
|
|
-// - ENDPOINT_EXCLUSIVE_NUMBER: endpoint number with different direction IN and OUT aren't allowed,
|
|
|
|
|
-// e.g EP1 OUT & EP1 IN cannot exist together
|
|
|
|
|
-// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
|
|
|
|
|
|
|
+#ifndef TUSB_MCU_ATTR_H_
|
|
|
|
|
+#define TUSB_MCU_ATTR_H_
|
|
|
|
|
+
|
|
|
|
|
+/* USB Controller Attributes for Device, Host or MCU (both)
|
|
|
|
|
+ * - ENDPOINT_MAX: max (logical) number of endpoint
|
|
|
|
|
+ * - ENDPOINT_EXCLUSIVE_NUMBER: endpoint number with different direction IN and OUT aren't allowed,
|
|
|
|
|
+ * e.g EP1 OUT & EP1 IN cannot exist together
|
|
|
|
|
+ * - RHPORT_HIGHSPEED: mask to indicate which port support highspeed mode (without external PHY)
|
|
|
|
|
+ * bit0 for port0 and so on.
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
//------------- NXP -------------//
|
|
//------------- NXP -------------//
|
|
|
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
|
|
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
|
|
@@ -41,11 +41,15 @@
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
|
#elif TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
|
|
|
|
+ #define HCD_ATTR_OHCI
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
|
|
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
|
|
|
// TODO USB0 has 6, USB1 has 4
|
|
// TODO USB0 has 6, USB1 has 4
|
|
|
- #define DCD_ATTR_CONTROLLER_CHIPIDEA_HS
|
|
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 6
|
|
|
|
|
|
|
+ #define MCU_ATTR_CONTROLLER_CHIPIDEA_HS
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 6
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01 // Port0 HS, Port1 FS
|
|
|
|
|
+
|
|
|
|
|
+ #define HCD_ATTR_EHCI
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_LPC51UXX)
|
|
#elif TU_CHECK_MCU(OPT_MCU_LPC51UXX)
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 5
|
|
#define DCD_ATTR_ENDPOINT_MAX 5
|
|
@@ -59,8 +63,11 @@
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX)
|
|
#elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX)
|
|
|
- #define DCD_ATTR_CONTROLLER_CHIPIDEA_HS
|
|
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
|
|
|
|
+ #define MCU_ATTR_CONTROLLER_CHIPIDEA_HS
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x03 // Port0 HS, Port1 HS
|
|
|
|
|
+
|
|
|
|
|
+ #define HCD_ATTR_EHCI
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX, OPT_MCU_K32L2BXX)
|
|
#elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX, OPT_MCU_K32L2BXX)
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
|
@@ -83,7 +90,8 @@
|
|
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_SAMX7X)
|
|
#elif TU_CHECK_MCU(OPT_MCU_SAMX7X)
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 10
|
|
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 10
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
|
|
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_PIC32MZ)
|
|
#elif TU_CHECK_MCU(OPT_MCU_PIC32MZ)
|
|
@@ -145,7 +153,8 @@
|
|
|
|
|
|
|
|
//------------- Sony -------------//
|
|
//------------- Sony -------------//
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
|
|
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 7
|
|
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 7
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
|
|
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
|
|
|
|
|
|
|
//------------- TI -------------//
|
|
//------------- TI -------------//
|
|
@@ -167,7 +176,8 @@
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_NUC505)
|
|
#elif TU_CHECK_MCU(OPT_MCU_NUC505)
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 12
|
|
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 12
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
|
|
|
|
|
|
|
|
//------------- Espressif -------------//
|
|
//------------- Espressif -------------//
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
|
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
|
@@ -195,7 +205,8 @@
|
|
|
|
|
|
|
|
//------------- Broadcom -------------//
|
|
//------------- Broadcom -------------//
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
|
|
#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
|
|
|
|
|
|
|
|
//------------- Broadcom -------------//
|
|
//------------- Broadcom -------------//
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_XMC4000)
|
|
#elif TU_CHECK_MCU(OPT_MCU_XMC4000)
|
|
@@ -203,23 +214,31 @@
|
|
|
|
|
|
|
|
//------------- BridgeTek -------------//
|
|
//------------- BridgeTek -------------//
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_FT90X)
|
|
#elif TU_CHECK_MCU(OPT_MCU_FT90X)
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
|
|
|
|
|
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_FT93X)
|
|
#elif TU_CHECK_MCU(OPT_MCU_FT93X)
|
|
|
- #define DCD_ATTR_ENDPOINT_MAX 16
|
|
|
|
|
|
|
+ #define DCD_ATTR_ENDPOINT_MAX 16
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x01
|
|
|
|
|
|
|
|
//------------ Allwinner -------------//
|
|
//------------ Allwinner -------------//
|
|
|
#elif TU_CHECK_MCU(OPT_MCU_F1C100S)
|
|
#elif TU_CHECK_MCU(OPT_MCU_F1C100S)
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 4
|
|
#define DCD_ATTR_ENDPOINT_MAX 4
|
|
|
|
|
|
|
|
-#else
|
|
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+//--------------------------------------------------------------------+
|
|
|
|
|
+// Default Values
|
|
|
|
|
+//--------------------------------------------------------------------+
|
|
|
|
|
+
|
|
|
|
|
+#ifndef DCD_ATTR_ENDPOINT_MAX
|
|
|
#warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
|
|
#warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
|
|
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
// Default to fullspeed if not defined
|
|
// Default to fullspeed if not defined
|
|
|
-//#ifndef PORT_HIGHSPEED
|
|
|
|
|
-// #define DCD_ATTR_PORT_HIGHSPEED 0x00
|
|
|
|
|
-//#endif
|
|
|
|
|
|
|
+#ifndef DCD_ATTR_RHPORT_HIGHSPEED
|
|
|
|
|
+ #define DCD_ATTR_RHPORT_HIGHSPEED 0x00
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|