...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
296
www.silabs.com
4. Once the application detects this interrupt, it can assume that the core is in Global OUT NAK mode.
The application can clear this interrupt by clearing the USB_DCTL.SGOUTNAK bit.
Application Programming Sequence
1. To stop receiving any kind of data in the receive FIFO, the application must set the Global OUT NAK
bit by programming the following field.
• USB_DCTL.SGOUTNAK = 1
2. Wait for the assertion of the interrupt USB_GINTSTS.GOUTNAKEFF. When asserted, this interrupt
indicates that the core has stopped receiving any type of data except SETUP packets.
3. The application can receive valid OUT packets after it has set USB_DCTL.SGOUTNAK and before
the core asserts the USB_GINTSTS.GOUTNAKEFF interrupt.
4. The
application
can
temporarily
mask
this
interrupt
by
writing
to
the
USB_GINTMSK.GOUTNAKEFFMSK bit.
• USB_GINTMSK.GINNAKEFFMSK = 0
5. Whenever the application is ready to exit the Global OUT NAK mode, it must clear the
USB_DCTL.SGOUTNAK bit. This also clears the USB_GINTSTS.GOUTNAKEFF interrupt.
• USB_DCTL.CGOUTNAK = 1
6. If the application has masked this interrupt earlier, it must be unmasked as follows:
• USB_GINTMSK.GOUTNAKEFFMSK = 1
15.4.4.2.2.6 Disabling an OUT Endpoint
The application must use this sequence to disable an OUT endpoint that it has enabled.
Application Programming Sequence
1. Before disabling any OUT endpoint, the application must enable Global OUT NAK mode in the core,
as described in Setting the Global OUT NAK (p. 295) .
• USB_DCTL.SGOUTNAK = 1
• Wait for the USB_GINTSTS.GOUTNAKEFF interrupt
2. Disable the required OUT endpoint by programming the following fields.
• USB_DOEPx_CTL.EPDIS = 1
• USB_DOEPx_CTL.SNAK = 1
3. Wait for the USB_DOEPx_INT.EPDISBLD interrupt, which indicates that the OUT endpoint is
completely disabled. When the EPDISBLD interrupt is asserted, the core also clears the following bits.
• USB_DOEPx_CTL.EPDIS = 0
• USB_DOEPx_CTL.EPENA = 0
4. The application must clear the Global OUT NAK bit to start receiving data from other non-disabled
OUT endpoints.
• USB_DCTL.SGOUTNAK = 0
15.4.4.2.2.7 Stalling a Non-Isochronous OUT Endpoint
This section describes how the application can stall a non-isochronous endpoint.
1. Put the core in the Global OUT NAK mode, as described in Setting the Global OUT NAK (p. 295) .
2. Disable the required endpoint, as described in Section 15.4.4.2.2.6 (p. 296) .
• When disabling the endpoint, instead of setting the USB_DOEPx_CTL.SNAK bit, set
USB_DOEPx_CTL.STALL = 1.
• The Stall bit always takes precedence over the NAK bit.
3. When the application is ready to end the STALL handshake for the endpoint, the
USB_DOEPx_CTL.STALL bit must be cleared.
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......