
Chapter 10. General Programmable Interface (GPIF) Page 10-51
Figure 10-37. Sourcing an IN Packet by writing to EPxBCH:L
TD_Poll():
… … … … …
if( source_pkt_event )
{ // 100msec background timer fired
if( holdoff_master( ) )
{ // signaled “busy” to master successful
while( !( EP68FIFOFLGS & 0x20 ) )
{ // EP8EF=0, when buffer not empty
; // wait ‘til host takes entire FIFO data
}
// Reset FIFO 8.
FIFORESET = 0x80; // Activate NAK-All to avoid race conditions.
SYNCDELAY;
FIFORESET = 0x08; // Reset FIFO 8.
SYNCDELAY;
FIFORESET = 0x00; // Deactivate NAK-All.
EP8FIFOBUF[ 0 ] = 0x02; // <STX>, packet start of text msg
EP8FIFOBUF[ 1 ] = 0x06; // <ACK>
EP8FIFOBUF[ 2 ] = 0x07; // <HEARTBEAT>
EP8FIFOBUF[ 3 ] = 0x03; // <ETX>, packet end of text msg
SYNCDELAY;
EP8BCH = 0x00;
SYNCDELAY;
EP8BCL = 0x04; // pass src’d buffer on to host
}
else
{
history_record( EP8, BAD_MASTER );
}
}
… … … … …
Komentáře k této Příručce