summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2022-07-02 19:40:00 +0800
committersakumisu <[email protected]>2022-07-02 19:40:00 +0800
commitf7ceacdc7955bbf42a9f79d7a252ecf4a23abad2 (patch)
treeaedb466a9c7c33882b754a51e9d40afa3ba04614 /common
parent5289b777803774f60896acac88f2bf66b1267ea7 (diff)
add some dcd api
Diffstat (limited to 'common')
-rw-r--r--common/usb_dc.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/common/usb_dc.h b/common/usb_dc.h
index 20cabb55..51627a6b 100644
--- a/common/usb_dc.h
+++ b/common/usb_dc.h
@@ -209,7 +209,7 @@ int usbd_ep_read(const uint8_t ep, uint8_t *data, uint32_t max_data_len, uint32_
int usbd_ep_write_async(const uint8_t ep, const uint8_t *data, uint32_t data_len);
/**
- * @brief Read data from the specified endpoint with async mode.
+ * @brief Read data from the specified endpoint with async mode.Actually,this function is used for these endpoint transferring with dma mode.
*
* @param[in] ep Endpoint address corresponding to the one
* listed in the device configuration table
@@ -221,6 +221,33 @@ int usbd_ep_write_async(const uint8_t ep, const uint8_t *data, uint32_t data_len
int usbd_ep_read_async(const uint8_t ep, uint8_t *data, uint32_t data_len);
/**
+ * @brief Get actual read len when ep transfers completely by usbd_ep_read_async.
+ *
+ * @param[in] ep Endpoint address corresponding to the one
+ * listed in the device configuration table
+ * @return Actual read len.
+ */
+uint32_t usbd_ep_get_read_len(const uint8_t ep);
+
+/**
+ * @brief Check if in ep transfers done.
+ *
+ * @param[in] ep Endpoint address corresponding to the one
+ * listed in the device configuration table
+ * @return true means transfer completely.Otherwise not.
+ */
+bool usbd_ep_is_complete(const uint8_t ep);
+
+/**
+ * @brief Get endpoint max packet size.
+ *
+ * @param[in] ep Endpoint address corresponding to the one
+ * listed in the device configuration table
+ * @return endpoint max packet size.
+ */
+uint16_t usbd_ep_get_mps(const uint8_t ep);
+
+/**
* @}
*/