English
Language : 

EFM32WG Datasheet, PDF (260/834 Pages) List of Unclassifed Manufacturers – The EFM32WG Wonder Gecko is the ideal choice for demanding 8-, 16-, and 32-bit energy sensitive applications.
...the world's most energy friendly microcontrollers
1. Initialize channel 2 as explained in Channel Initialization (p. 252) .
2. Set the USB_HC2_CHAR.CHENA bit to write an IN request to the Non-periodic Request Queue.
3. The core attempts to send an IN token after completing the current OUT transaction.
4. The core generates an RXFLVL interrupt as soon as the received packet is written to the receive FIFO.
5. In response to the RXFLVL interrupt, mask the RXFLVL interrupt and read the received packet status
to determine the number of bytes received, then read the receive FIFO accordingly. Following this,
unmask the RXFLVL interrupt.
6. The core generates the RXFLVL interrupt for the transfer completion status entry in the receive FIFO.
7. 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 the XFERCOMPL interrupt as soon as the receive packet status is read.
9. In response to the XFERCOMPL interrupt, disable the channel (see Halting a Channel (p. 253) )
and stop writing the USB_HC2_CHAR register for further requests. The core writes a channel disable
request to the non-periodic request queue as soon as the USB_HC2_CHAR register is written.
10.The core generates the RXFLVL interrupt as soon as the halt status is written to the receive FIFO.
11.Read and ignore the receive packet status.
12.The core generates a CHHLTD interrupt as soon as the halt status is popped from the receive FIFO.
13.In response to the CHHLTD interrupt, de-allocate the channel for other transfers.
Note
For Bulk/Control IN transfers, the application must write the requests when the Request
queue space is available, and until the XFERCOMPL interrupt is received.
15.4.3.6.5.2 Handling Interrupts
The channel-specific interrupt service routine for bulk and control IN transactions in Slave mode is shown
in the following code samples.
Interrupt Service Routine for Bulk/Control IN Transactions in Slave Mode
Unmask (XACTERR/XFERCOMPL/BBLERR/STALL/DATATGLERR)
if (XFERCOMPL)
{
Reset Error Count
Unmask CHHLTD
Disable Channel
Reset Error Count
Mask ACK
}
else if (XACTERR or BBLERR or STALL)
{
Unmask CHHLTD
Disable Channel
if (XACTERR)
{
Increment Error Count
Unmask ACK
}
}
else if (CHHLTD)
{
Mask CHHLTD
if (Transfer Done or (Error_count == 3))
{
De-allocate Channel
}
else
{
Re-initialize Channel
}
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
260
www.energymicro.com