
EZ-USB FX2 Technical Reference Manual
Page 10-58 EZ-USB FX2 Technical Reference Manual v2.1
2. It can skip packet(s) sent from the host to the master by writing the EPxBCL register with the
SKIP bit (EPxBCL.7) set to 1 (see Figure 10-51).
Figure 10-51. Skipping an OUT Packet by Writing OUTPKTEND w/SKIP=1
3. It can edit the packet (or source an entire OUT packet) by writing to the FIFO buffer directly,
then writing the length of the packet to EPxBCH:L. The write to EPxBCL commits the edited
packet, so EPxBCL should be written after writing EPxBCH (Figure10-52).
In all cases, the OUT buffer automatically re-arms so it can receive the next packet.
See Section 8.6.2.4 for a detailed description of the SKIP bit.
Figure 10-52. Sourcing an OUT Packet (AUTOOUT = 0)
TD_Poll():
… … … … …
if( !( EP24FIFOFLGS & 0x02 ) )
{ // EP2EF=0 when FIFO “not” empty, host sent pkt.
OUTPKTEND = 0x82; // SKIP=1, do NOT pass buffer on to master
}
… … … … …
TD_Poll():
… … … … …
if( EP24FIFOFLGS & 0x02 )
{
SYNCDELAY; //
FIFORESET = 0x80; // nak all OUT pkts. from host
SYNCDELAY; //
FIFORESET = 0x02; // advance all EP2 buffers to cpu domain
SYNCDELAY; //
EP2FIFOBUF[0] = 0xAA; // create newly sourced pkt. data
SYNCDELAY; //
EP2BCH = 0x00;
SYNCDELAY; //
EP2BCL = 0x01; // commit newly sourced pkt. to interface fifo
// beware of "left over" uncommitted buffers
SYNCDELAY; //
OUTPKTEND = 0x82; // skip uncommitted pkt. (second pkt.)
// note: core will not allow pkts. to get out of sequence
SYNCDELAY; //
FIFORESET = 0x00; // release "nak all"
}
… … … … …
Comentários a estes Manuais