
EZ-USB FX2 Technical Reference Manual
Page 9-22 EZ-USB FX2 Technical Reference Manual v2.1
9.3.4 Auto-In / Auto-Out Modes
The FX2 FIFOs can be configured to commit packets to/from USB automatically. For IN endpoints,
Auto-In Mode allows the external logic to stream data into a FIFO continuously, with no need for it
or the FX2 firmware to packetize the data or explicitly signal the FX2 to send it to the host. For
OUT endpoints, Auto-Out Mode allows the host to continuously fill a FIFO, with no need for the
external logic or FX2 firmware to handshake each incoming packet, arm the endpoint buffers, etc.
See Figure 9-27.
Figure 9-27. When AUTOOUT=1, OUT Packets are Automatically Committed
To configure an IN endpoint FIFO for Auto Mode, set the AUTOIN bit in the appropriate
EPxFIFOCFG register to 1. To configure an OUT endpoint FIFO for Auto Mode, set the AUTOOUT
bit in the appropriate EPxFIFOCFG register to 1. See Figures 9-28 and 9-29.
At power-on reset, all FIFOs default to Manual Mode (i.e., AUTOIN = 0 and AUTOOUT = 0).
Figure 9-28. TD_Init Example: Configuring AUTOOUT = 1
TD_Init():
… … … … …
REVCTL = 0x03; // MUST set REVCTL.0 and REVCTL.1 to 1
SYNCDELAY;
EP2CFG = 0xA2; // EP2 is DIR=OUT, TYPE=BULK, SIZE=512, BUF=2x
SYNCDELAY;
FIFORESET = 0x80; // Reset the FIFO
SYNCDELAY;
FIFORESET = 0x02;
SYNCDELAY;
FIFORESET = 0x00;
SYNCDELAY;
EP2FIFOCFG = 0x10; // EP2 is AUTOOUT=1, AUTOIN=0, ZEROLEN=0, WORDWIDE=0
SYNCDELAY;
OUTPKTEND = 0x82; // Arm both EP2 buffers to “prime the pump”
SYNCDELAY;
OUTPKTEND = 0x82;
… … … … …
AUTOOUT=1
Data Path
CPU
USB
Host
Slave
Master
Comentários a estes Manuais