summaryrefslogtreecommitdiff
path: root/src/device/dcd.h
diff options
context:
space:
mode:
authorNathan Conrad <[email protected]>2020-04-12 21:07:17 -0400
committerNathan Conrad <[email protected]>2020-04-12 21:27:27 -0400
commit0eeaccaf46c28444cc0830895559652cf5638c60 (patch)
tree2a31a54dd03a0ff7a413427e3cee6a9036bd85e4 /src/device/dcd.h
parent2ff3f765db7e62201d0491093111b0d649446046 (diff)
Skeleton, and initial stm32fsdev implementation (that leaks memory)
Diffstat (limited to 'src/device/dcd.h')
-rw-r--r--src/device/dcd.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h
index 487ddb3b6..f48530227 100644
--- a/src/device/dcd.h
+++ b/src/device/dcd.h
@@ -66,7 +66,7 @@ typedef struct TU_ATTR_ALIGNED(4)
// USBD_EVT_XFER_COMPLETE
struct {
- uint8_t ep_addr;
+ uint8_t ep_addr; ///< 0xFF signifies that the transfer was aborted.
uint8_t result;
uint32_t len;
}xfer_complete;
@@ -123,6 +123,10 @@ void dcd_edpt0_status_complete(uint8_t rhport, tusb_control_request_t const * re
// Configure endpoint's registers according to descriptor
bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
+// Close an endpoint.
+// Since it is weak, caller must TU_ASSERT this function's existence before calling it.
+void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr) TU_ATTR_WEAK;
+
// 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);