
Chapter 10. General Programmable Interface (GPIF) Page 10-57
10.4.9 Firmware access to OUT packets, (AUTOOUT = 0)
Figure 10-48. Firmware can Skip or Commit, AUTOOUT = 0
Figure 10-49. Initialization Code for AUTOOUT = 0
In manual OUT mode (AUTOOUT = 0), the firmware has the following options:
1. It can commit (“pass-on”) packet(s) sent from the host to the master when a buffer is available,
by writing the OUTPKTEND register with the SKIP bit (OUTPKTEND.7) cleared to 0 (see
Figure 10-50).
Figure 10-50. Committing an OUT Packet by Writing OUTPKTEND w/SKIP=0
TD_Init():
… … … … …
EP2CFG = 0xA2; // EP2 is DIR=OUT, TYPE=BULK, SIZE=512, BUF=2x
SYNCDELAY;
EP2FIFOCFG = 0x00; // EP2 is AUTOOUT=0, AUTOIN=0, ZEROLEN=0, WORDWIDE=0
SYNCDELAY;
// OUT endpoints do NOT come up armed
EP2BCL = 0x80; // arm first buffer by writing BC w/skip=1
SYNCDELAY;
EP2BCL = 0x80; // arm second buffer by writing BC w/skip=1
… … … … …
TD_Poll():
… … … … …
if( !( EP24FIFOFLGS & 0x02 ) )
{ // EP2EF=0 when FIFO “not” empty, host sent pkt.
OUTPKTEND = 0x02; // SKIP=0, pass buffer on to master
}
… … … … …
Data
8051
USB
Host Peripheral
AUTOOUT=0
skip=0
skip=1
Slave GPIF
Komentáře k této Příručce