...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
274
www.silabs.com
5. As soon as the IN packet is received and written to the receive FIFO, the host generates an RXFLVL
interrupt.
6. In response to the RXFLVL interrupt, read the received packet status to determine the number of bytes
received, then read the receive FIFO accordingly. The application must mask the RXFLVL interrupt
before reading the receive FIFO, and unmask after reading the entire packet.
7. The core generates the RXFLVL interrupt for the transfer completion status entry in the receive FIFO.
The application must read and ignore the receive packet status when the receive packet status is not
an IN data packet (USB_GRXSTSR.PKTSTS != 0b0010).
8. The core generates an XFERCOMPL interrupt as soon as the receive packet status is read.
9. In response to the XFERCOMPL interrupt, read the USB_HC2_TSIZ.PKTCNT field. If
USB_HC2_TSIZ.PKTCNT != 0, disable the channel (as explained in Halting a Channel (p. 257)
) before re-initializing the channel for the next transfer, if any). If USB_HC2_TSIZ.PKTCNT ==
0, reinitialize the channel for the next transfer. This time, the application must reset the
USB_HC2_CHAR.ODDFRM bit.
15.4.3.6.10.2 Handling Interrupts
The channel-specific interrupt service routine for an interrupt IN transaction in Slave mode is a follows.
Interrupt IN
Unmask (NAK/XACTERR/XFERCOMPL/BBLERR/STALL/FRMOVRUN/DATATGLERR)
if (XFERCOMPL)
{
Reset Error Count
Mask ACK
if (USB_HCx_TSIZ.PKTCNT == 0)
{
De-allocate Channel
}
else
{
Transfer Done = 1
Unmask CHHLTD
Disable Channel
}
}
else if (STALL or FRMOVRUN or NAK or DATATGLERR or BBLERR)
{
Mask ACK
Unmask CHHLTD
Disable Channel
if (STALL or BBLERR)
{
Reset Error Count
Transfer Done = 1
}
else if (!FRMOVRUN)
{
Reset Error Count
}
}
else if (XACTERR)
{
Increment Error Count
Unmask ACK
Unmask CHHLTD
Disable Channel
}
else if (CHHLTD)
{
Mask CHHLTD
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......