diff options
| author | hathach <[email protected]> | 2019-05-29 16:55:15 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-05-29 16:55:15 +0700 |
| commit | a0307bafdaa97628bb5e4d5e476db54cbc028d33 (patch) | |
| tree | bb2ff6a94e5229fffd1725c9e2e905ce333f110c /src/device/dcd.h | |
| parent | dfdae7a4d28a7c45535e9d709eade45c1a88a9f2 (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/dcd.h')
| -rw-r--r-- | src/device/dcd.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index 35164ac62..bd7088fe4 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -100,25 +100,28 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num); // Wake up host
void dcd_remote_wakeup(uint8_t rhport);
-/*------------------------------------------------------------------*/
-/* Endpoint API
- * - open : Configure endpoint's registers
- * - xfer : Submit a transfer. When complete dcd_event_xfer_complete
- * must be called to notify the stack
- * - busy : Check if endpoint transferring is complete (TODO remove)
- * - stall : stall endpoint
- * - clear_stall : clear stall, data toggle is also reset to DATA0
- *------------------------------------------------------------------*/
+//--------------------------------------------------------------------+
+// Endpoint API
+//--------------------------------------------------------------------+
+
+// Configure endpoint's registers according to descriptor
bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
+
+// Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack
bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);
+
+// Check if endpoint transferring is complete (TODO remove)
bool dcd_edpt_busy (uint8_t rhport, uint8_t ep_addr);
+// Stall endpoint
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr);
+
+// clear stall, data toggle is also reset to DATA0
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr);
/*------------------------------------------------------------------*/
/* Event Function
- * Called by DCD to notify USBD
+ * Called by DCD to notify device stack
*------------------------------------------------------------------*/
void dcd_event_handler(dcd_event_t const * event, bool in_isr);
|
