summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2020-04-16 23:10:36 +0700
committerGitHub <[email protected]>2020-04-16 23:10:36 +0700
commit33610751d7d0157c68a799961b6a7cacfa4c9b38 (patch)
tree50e5d93811bee232b9166c7e578885fa0c9510d2 /docs
parentbfec3b44795e92469f5d4ff16f1caf131114d54f (diff)
parent2994d100cd6198a4c90dce667f52fde07fe4a073 (diff)
Merge pull request #336 from pigrew/edpt_close
> If you notice my chain of events above, the bulk transfer was started BEFORE the SET_INTERFACE call. The USB device hardware swaps the order of them being delivered. On STM32, it gives priority to the lower-numbered EP index. It shouldn't be a matter, control is 2+ stage, before sending the setup. Host should stop all communication to the endpoint that It wants to close.
Diffstat (limited to 'docs')
-rw-r--r--docs/porting.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/porting.md b/docs/porting.md
index f80245014..83b08da27 100644
--- a/docs/porting.md
+++ b/docs/porting.md
@@ -134,6 +134,14 @@ Opening an endpoint is done for all non-control endpoints once the host picks a
Also make sure to enable endpoint specific interrupts.
+##### dcd_edpt_close
+
+Close an endpoint. his function is used for implementing alternate settings.
+
+After calling this, the device should not respond to any packets directed towards this endpoint. When called, this function must abort any transfers in progress through this endpoint, before returning.
+
+Implementation is optional. Must be called from the USB task. Interrupts could be disabled or enabled during the call.
+
##### dcd_edpt_xfer
`dcd_edpt_xfer` is responsible for configuring the peripheral to send or receive data from the host. "xfer" is short for "transfer". **This is one of the core methods you must implement for TinyUSB to work (one other is the interrupt handler).** Data from the host is the OUT direction and data to the host is IN. It is used for all endpoints including the control endpoint 0. Make sure to handle the zero-length packet STATUS packet on endpoint 0 correctly. It may be a special transaction to the peripheral.