diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-03-02 15:55:13 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-03-02 15:55:13 +0000 |
commit | 43bb4bfedb2c8b2ed31adc4d3e262d3c975cbe66 (patch) | |
tree | 18a0fbabdad3a7b7722e088032bf07ddee2dc92e /os/hal/dox | |
parent | 4844936fde9fc060cd41e15bb354db7a160b4eb4 (diff) | |
download | ChibiOS-43bb4bfedb2c8b2ed31adc4d3e262d3c975cbe66.tar.gz ChibiOS-43bb4bfedb2c8b2ed31adc4d3e262d3c975cbe66.tar.bz2 ChibiOS-43bb4bfedb2c8b2ed31adc4d3e262d3c975cbe66.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2787 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/dox')
-rw-r--r-- | os/hal/dox/usb.dox | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/os/hal/dox/usb.dox b/os/hal/dox/usb.dox index 119a436eb..568272e13 100644 --- a/os/hal/dox/usb.dox +++ b/os/hal/dox/usb.dox @@ -110,7 +110,7 @@ * USB endpoints are the objects that the application uses to exchange
* data with the host. There are two kind of endpoints:
* - <b>IN</b> endpoints are used by the application to transmit data to
- * the host.
+ * the host.<br>
* - <b>OUT</b> endpoints are used by the application to receive data from
* the host.
* .
@@ -118,10 +118,98 @@ * - <b>Packet Mode</b>. In this mode the driver invokes a callback each
* time a packet has been received or transmitted. This mode is especially
* suited for those applications handling continuous streams of data.
+ * <br><br>
+ * States diagram for OUT endpoints in packet mode:
+ * @dot
+ digraph example {
+ rankdir="LR";
+ node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true",
+ width="0.9", height="0.9"];
+ edge [fontname=Helvetica, fontsize=8];
+
+ disabled [label="EP_DISABLED\nDisabled", style="bold"];
+ receiving [label="EP_BUSY\nReceiving Packet"];
+ idle [label="EP_IDLE\nPacket in Buffer"];
+
+ disabled -> receiving [label="\usbInitEndpointI()"];
+ receiving -> idle [label="\npacket received\n>out_cb<"];
+ idle -> receiving [label="\nusbReadPacketI()"];
+ receiving -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ }
+ * @enddot
+ * <br><br>
+ * States diagram for IN endpoints in packet mode:
+ * @dot
+ digraph example {
+ rankdir="LR";
+ node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true",
+ width="0.9", height="0.9"];
+ edge [fontname=Helvetica, fontsize=8];
+
+ disabled [label="EP_DISABLED\nDisabled", style="bold"];
+ transmitting [label="EP_BUSY\nSending Packet"];
+ idle [label="EP_IDLE\nBuffer Empty"];
+
+ disabled -> idle [label="\usbInitEndpointI()"];
+ idle -> transmitting [label="\nusbWritePacketI()"];
+ transmitting -> idle [label="\npacket sent\n>in_cb<"];
+ transmitting -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ }
+ * @enddot
+ * <br><br>
* - <b>Transaction Mode</b>. In this mode the driver invokes a callback
* only after a large, potentially multi-packet, transfer has been
* completed, a callback is invoked only at the end of the transfer.
+ * <br><br>
+ * States diagram for OUT endpoints in transaction mode:
+ * @dot
+ digraph example {
+ rankdir="LR";
+ node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true",
+ width="0.9", height="0.9"];
+ edge [fontname=Helvetica, fontsize=8];
+
+ disabled [label="EP_DISABLED\nDisabled", style="bold"];
+ receiving [label="EP_BUSY\nReceiving"];
+ idle [label="EP_IDLE\nReady"];
+
+ disabled -> idle [label="\usbInitEndpointI()"];
+ idle -> receiving [label="\usbStartReceiveI()"];
+ receiving -> receiving [label="\nmore packets"];
+ receiving -> idle [label="\nreception end\n>out_cb<"];
+ receiving -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ }
+ * @enddot
+ * <br><br>
+ * States diagram for IN endpoints in transaction mode:
+ * @dot
+ digraph example {
+ rankdir="LR";
+ node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true",
+ width="0.9", height="0.9"];
+ edge [fontname=Helvetica, fontsize=8];
+
+ disabled [label="EP_DISABLED\nDisabled", style="bold"];
+ transmitting [label="EP_BUSY\nTransmitting"];
+ idle [label="EP_IDLE\nReady"];
+
+ disabled -> idle [label="\usbInitEndpointI()"];
+ idle -> transmitting [label="\nusbStartTransmitI()"];
+ transmitting -> transmitting [label="\nmore packets"];
+ transmitting -> idle [label="\ntransmission end\n>in_cb<"];
+ transmitting -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ idle -> disabled [label="\nUSB RESET\nusbDisableEndpointsI()"];
+ }
+ * @enddot
+ * <br><br>
* .
+ * An important difference in the two modes is that there is a dedicated
+ * endpoint buffer in packet mode while in transaction mode the application
+ * specifies its own buffer for the whole transfer.
+ *
* @subsection usb_2_3 USB Callbacks
* The USB driver uses callbacks in order to interact with the application.
* There are several kind of callbacks to be handled:
|