summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2025-06-12 21:35:51 +0800
committersakumisu <[email protected]>2025-06-12 21:35:51 +0800
commit6a226e3e3ca654e0c9d43ae4a8add794381dcce3 (patch)
treea7906780e6d6aaef6e1a8578ef51275216b0fe64
parent8b63acd46c70d0f65c5d3b66b2955203f82aa713 (diff)
refactor(port/ch32): classify ch32 port
Signed-off-by: sakumisu <[email protected]>
-rw-r--r--README.md2
-rw-r--r--README_zh.md2
-rw-r--r--port/ch32/README.md13
-rw-r--r--port/ch32/ch32fs/usb_ch32_usbfs_reg.h (renamed from port/ch32/usb_ch32_usbfs_reg.h)0
-rw-r--r--port/ch32/ch32fs/usb_dc_usbfs.c (renamed from port/ch32/usb_dc_usbfs.c)4
-rw-r--r--port/ch32/ch32hs/usb_ch32_usbhs_reg.h (renamed from port/ch32/usb_ch32_usbhs_reg.h)0
-rw-r--r--port/ch32/ch32hs/usb_dc_usbhs.c (renamed from port/ch32/usb_dc_usbhs.c)0
-rw-r--r--port/ch32/ch58x/usb_ch585_usbhs_dc.c (renamed from port/ch32/ch585_usbhs_dc.c)4
-rw-r--r--port/ch32/ch58x/usb_ch585_usbhs_reg.h (renamed from port/ch32/ch585_usbhs_reg.h)5
-rw-r--r--port/ch32/ch58x/usb_ch58x_dc_usbfs.c (renamed from port/ch32/usb_ch58x_dc_usbfs.c)0
-rw-r--r--port/ch32/ch58x/usb_ch58x_usbfs_reg.h (renamed from port/ch32/usb_ch58x_usbfs_reg.h)0
11 files changed, 23 insertions, 7 deletions
diff --git a/README.md b/README.md
index 8d434602..fcb6f13c 100644
--- a/README.md
+++ b/README.md
@@ -204,7 +204,7 @@ TODO
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |
-|WCH | CH32V307/ch58x | ch32_usbfs/ch32_usbhs/ch58x |[wch_repo](https://github.com/CherryUSB/cherryusb_wch)|<= v0.10.2 | TBD |
+|WCH | CH32V307/ch58x | ch32_usbfs/ch32_usbhs/ch58x |[wch_repo](https://github.com/CherryUSB/cherryusb_wch)|<= v0.10.2/>=v1.5.0 | TBD |
## Package Support
diff --git a/README_zh.md b/README_zh.md
index 2c12ce55..c0ff9133 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -204,7 +204,7 @@ TODO
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |
-|WCH | CH32V307/ch58x | ch32_usbfs/ch32_usbhs/ch58x |[wch_repo](https://github.com/CherryUSB/cherryusb_wch)|<= v0.10.2 | TBD |
+|WCH | CH32V307/ch58x | ch32_usbfs/ch32_usbhs/ch58x |[wch_repo](https://github.com/CherryUSB/cherryusb_wch)|<= v0.10.2/>=v1.5.0 | TBD |
## 软件包支持
diff --git a/port/ch32/README.md b/port/ch32/README.md
index a625d04c..68a1ab76 100644
--- a/port/ch32/README.md
+++ b/port/ch32/README.md
@@ -2,4 +2,15 @@
## Support Chip List
-- CH32V30x
+## CH32FS
+
+- CH32V30X/CH32V20X/CH32V10X/CH32X035
+
+## CH32HS
+
+- CH32V30X
+
+## CH58X
+
+- CH57X/CH58X(usbfs)
+- CH585(usbhs)
diff --git a/port/ch32/usb_ch32_usbfs_reg.h b/port/ch32/ch32fs/usb_ch32_usbfs_reg.h
index 34a96072..34a96072 100644
--- a/port/ch32/usb_ch32_usbfs_reg.h
+++ b/port/ch32/ch32fs/usb_ch32_usbfs_reg.h
diff --git a/port/ch32/usb_dc_usbfs.c b/port/ch32/ch32fs/usb_dc_usbfs.c
index 65f5ca8c..8047d42d 100644
--- a/port/ch32/usb_dc_usbfs.c
+++ b/port/ch32/ch32fs/usb_dc_usbfs.c
@@ -404,8 +404,8 @@ void USBD_IRQHandler(uint8_t busid)
}
}
-void OTG_FS_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
-void OTG_FS_IRQHandler(void)
+void USBFS_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
+void USBFS_IRQHandler(void)
{
extern void USBD_IRQHandler(uint8_t busid);
USBD_IRQHandler(0);
diff --git a/port/ch32/usb_ch32_usbhs_reg.h b/port/ch32/ch32hs/usb_ch32_usbhs_reg.h
index 1dca5d1b..1dca5d1b 100644
--- a/port/ch32/usb_ch32_usbhs_reg.h
+++ b/port/ch32/ch32hs/usb_ch32_usbhs_reg.h
diff --git a/port/ch32/usb_dc_usbhs.c b/port/ch32/ch32hs/usb_dc_usbhs.c
index b882baf6..b882baf6 100644
--- a/port/ch32/usb_dc_usbhs.c
+++ b/port/ch32/ch32hs/usb_dc_usbhs.c
diff --git a/port/ch32/ch585_usbhs_dc.c b/port/ch32/ch58x/usb_ch585_usbhs_dc.c
index e066ffb9..2e6724c2 100644
--- a/port/ch32/ch585_usbhs_dc.c
+++ b/port/ch32/ch58x/usb_ch585_usbhs_dc.c
@@ -1,5 +1,5 @@
#include "usbd_core.h"
-#include "ch585_usbhs_reg.h"
+#include "usb_ch585_usbhs_reg.h"
/**
* @brief Related register macro
@@ -507,7 +507,7 @@ void USBD_IRQHandler(uint8_t busid)
R8_U2EP0_RX_CTRL = USBHS_UEP_R_RES_ACK;
CH585_USBHS_DEV->INT_FG = USBHS_UDIF_BUS_RST;
} else if (intflag & USBHS_UDIF_SUSPEND) {
- if (CH585_USBHS_DEV->MIS_ST & 0x04) {
+ if (CH585_USBHS_DEV->MIS_ST & USBHS_UDMS_SUSPEND) {
/* Suspend */
} else {
/* Wake up */
diff --git a/port/ch32/ch585_usbhs_reg.h b/port/ch32/ch58x/usb_ch585_usbhs_reg.h
index 29ed6db0..cfec7f75 100644
--- a/port/ch32/ch585_usbhs_reg.h
+++ b/port/ch32/ch58x/usb_ch585_usbhs_reg.h
@@ -1,3 +1,8 @@
+/*
+ * Copyright (c) 2024, sakumisu
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
#pragma once
/**********************************/
diff --git a/port/ch32/usb_ch58x_dc_usbfs.c b/port/ch32/ch58x/usb_ch58x_dc_usbfs.c
index c7efb84e..c7efb84e 100644
--- a/port/ch32/usb_ch58x_dc_usbfs.c
+++ b/port/ch32/ch58x/usb_ch58x_dc_usbfs.c
diff --git a/port/ch32/usb_ch58x_usbfs_reg.h b/port/ch32/ch58x/usb_ch58x_usbfs_reg.h
index f7fda8c6..f7fda8c6 100644
--- a/port/ch32/usb_ch58x_usbfs_reg.h
+++ b/port/ch32/ch58x/usb_ch58x_usbfs_reg.h