summaryrefslogtreecommitdiff
path: root/src/device/usbd_pvt.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-29 16:55:15 +0700
committerhathach <[email protected]>2019-05-29 16:55:15 +0700
commita0307bafdaa97628bb5e4d5e476db54cbc028d33 (patch)
treebb2ff6a94e5229fffd1725c9e2e905ce333f110c /src/device/usbd_pvt.h
parentdfdae7a4d28a7c45535e9d709eade45c1a88a9f2 (diff)
added usbd_edpt_xfer/usbd_edpt_busy to replace dcd_edpt_transfer/dcd_edpt_busy()
- improve fifo write/read_n with only one lock - use usbd_edpt_xfer/usbd_edpt_busy for hid/cdc/msc class driver - replace cdc read's pending_read_from_host by usbd_edpt_busy()
Diffstat (limited to 'src/device/usbd_pvt.h')
-rw-r--r--src/device/usbd_pvt.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h
index f20532627..706857d45 100644
--- a/src/device/usbd_pvt.h
+++ b/src/device/usbd_pvt.h
@@ -33,10 +33,11 @@
extern "C" {
#endif
+bool usbd_init (void);
+
//--------------------------------------------------------------------+
-// INTERNAL API for stack management
+// USBD Endpoint API
//--------------------------------------------------------------------+
-bool usbd_init (void);
// Carry out Data and Status stage of control transfer
// - If len = 0, it is equivalent to sending status only
@@ -46,6 +47,12 @@ bool usbd_control_xfer(uint8_t rhport, tusb_control_request_t const * request, v
// Send STATUS (zero length) packet
bool usbd_control_status(uint8_t rhport, tusb_control_request_t const * request);
+// Submit a usb transfer
+bool usbd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);
+
+// Check if endpoint transferring is complete
+bool usbd_edpt_busy (uint8_t rhport, uint8_t ep_addr);
+
void usbd_edpt_stall(uint8_t rhport, uint8_t ep_addr);
void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr);
bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr);