summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-05-20 18:47:22 +0700
committerGitHub <[email protected]>2024-05-20 18:47:22 +0700
commita068b81674e8b47d6fb78ab6a06abb7decc2e644 (patch)
treec06d196aa384da214b4dc0062d61ce46a13982d6 /src/common
parentccc7a36043e055ded1f478a979a303e694123187 (diff)
parent10b1e38404c044345e9ea0f3e5c678af94eb0f0a (diff)
Merge pull request #2362 from dragonlock2/master
Add CH32V20x USB OTG/FS Driver
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_mcu.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/common/tusb_mcu.h b/src/common/tusb_mcu.h
index 1699867c8..abfed2835 100644
--- a/src/common/tusb_mcu.h
+++ b/src/common/tusb_mcu.h
@@ -404,12 +404,24 @@
//------------- WCH -------------//
#elif TU_CHECK_MCU(OPT_MCU_CH32V307)
- #define TUP_DCD_ENDPOINT_MAX 16
- #define TUP_RHPORT_HIGHSPEED 1
+ // v307 support both FS and HS
+ #define TUP_USBIP_WCH_USBHS
+ #define TUP_USBIP_WCH_USBFS
+
+ #define TUP_RHPORT_HIGHSPEED 1 // default to highspeed
+ #define TUP_DCD_ENDPOINT_MAX (CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED ? 16 : 8)
#elif TU_CHECK_MCU(OPT_MCU_CH32F20X)
- #define TUP_DCD_ENDPOINT_MAX 16
- #define TUP_RHPORT_HIGHSPEED 1
+ #define TUP_USBIP_WCH_USBHS
+ #define TUP_USBIP_WCH_USBFS
+
+ #define TUP_RHPORT_HIGHSPEED 1 // default to highspeed
+ #define TUP_DCD_ENDPOINT_MAX (CFG_TUD_MAX_SPEED == OPT_MODE_HIGH_SPEED ? 16 : 8)
+
+#elif TU_CHECK_MCU(OPT_MCU_CH32V20X)
+ #define TUP_USBIP_WCH_USBFS
+ #define TUP_DCD_ENDPOINT_MAX 8
+
#endif