User manual
...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 258
www.energymicro.com
Figure 15.10. Transmit FIFO Write Task in Slave Mode
1 MPS
or LPS FIFO space
available?
Wait for
USB_GAHBCFG
.
NPTXFEMPLVL
or
USB_GAHBCFG
.
PTXFEMPLVL
interrupt
Write 1 packet
data to
Transmit FIFO
Yes
No
No
Yes
MPS: Max Packet Size
LPS : Last Packet Size
Start
Done
Read USB_GNPTXSTS /
USB_HPTXFSIZ registers
for available FIFO and
Queue spaces
More packets
to send?
15.4.3.6.2 Reading the Receive FIFO in Slave Mode
Figure 15.11 (p. 258) shows the flow diagram for reading the receive FIFO in Slave mode. The
application must ignore all packet statuses other than IN Data Packet (0b0010).
Figure 15.11. Receive FIFO Read Task in Slave Mode
Read
USB_GRXSTSP
PKTSTS =
0b0010?
Yes
Yes
Unmask RXFLVL
int errupt
BCNT > 0 ?
No
Mask RXFLVL
int errupt
Yes
Unmask RXFLVL
int errupt
No
No
Start
RXFLVL
Interrupt?
Read the received
packet from the
Receive FIFO
15.4.3.6.3 Control Transactions in Slave Mode
Setup, Data, and Status stages of a control transfer must be performed as three separate transfers.
Setup- Data- or Status-stage OUT transactions are performed similarly to the bulk OUT transactions
explained in Bulk and Control OUT/SETUP Transactions in Slave Mode (p. 259) . Data- or Status-
stage IN transactions are performed similarly to the bulk IN transactions explained in Bulk and Control
IN Transactions in Slave Mode (p. 261) For all three stages, the application is expected to set the
USB_HC1_CHAR.EPTYPE field to Control. During the Setup stage, the application is expected to set
the USB_HC1_TSIZ.PID field to SETUP.