English
Language : 

EFM32WG Datasheet, PDF (304/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. When the application sets the IN NAK for a particular endpoint, the core stops transmitting data on
the endpoint, irrespective of data availability in the endpoint’s transmit FIFO.
2. Non-isochronous IN tokens receive a NAK handshake reply
• Isochronous IN tokens receive a zero-data-length packet reply
3. The core asserts the USB_DIEPx_INT.INEPNAKEFF (IN NAK Effective) interrupt in response to the
USB_DIEPx_CTL.SNAK (Set NAK) bit.
4. Once this interrupt is seen by the application, the application can assume that the endpoint is in IN
NAK mode. This interrupt can be cleared by the application by setting the USB_DIEPx_CTL. Clear
NAK bit.
Application Programming Sequence
1. To stop transmitting any data on a particular IN endpoint, the application must set the IN NAK bit. To
set this bit, the following field must be programmed.
• USB_DIEPx_CTL.SNAK = 1
2. Wait for assertion of the USB_DIEPx_INT.INEPNAKEFF (NAK Effective) interrupt. This interrupt
indicates the core has stopped transmitting data on the endpoint.
3. The core can transmit valid IN data on the endpoint after the application has set the NAK bit, but
before the assertion of the NAK Effective interrupt.
4. The application can mask this interrupt temporarily by writing to the
USB_DIEPMSK.INEPNAKEFFMSK (NAK Effective) bit.
• USB_DIEPMSK.INEPNAKEFFMSK (NAK Effective) = 0
5. To exit Endpoint NAK mode, the application must clear the USB_DIEPx_CTL.NAK status. This also
clears the USB_DIEPx_INT.INEPNAKEFF (NAK Effective) interrupt.
• USB_DIEPx_CTL.CNAK = 1
6. If the application masked this interrupt earlier, it must be unmasked as follows:
• USB_DIEPMSK.INEPNAKEFFMSK (NAK Effective) = 1
15.4.4.2.3.4 IN Endpoint Disable
Use the following sequence to disable a specific IN endpoint (periodic/non-periodic) that has been
previously enabled.
Application Programming Sequence:
1. In Slave mode, the application must stop writing data on the AHB, for the IN endpoint to be disabled.
2. The application must set the endpoint in NAK mode. See Setting IN Endpoint NAK (p. 303) .
• USB_DIEPx_CTL.SNAK = 1
3. Wait for USB_DIEPx_INT.INEPNAKEFF (NAK Effective) interrupt.
4. Set the following bits in the USB_DIEPx_CTL register for the endpoint that must be disabled.
• USB_DIEPx_CTL.EPDIS (Endpoint Disable) = 1
• USB_DIEPx_CTL.SNAK = 1
5. Assertion of USB_DIEPx_INT.EPDISBLD (Endpoint Disabled) interrupt indicates that the core has
completely disabled the specified endpoint. Along with the assertion of the interrupt, the core also
clears the following bits.
• USB_DIEPx_CTL.EPENA = 0
• USB_DIEPx_CTL.EPDIS = 0
6. The application must read the USB_DIEPx_TSIZ register for the periodic IN EP, to calculate how
much data on the endpoint was transmitted on the USB.
7. The application must flush the data in the Endpoint transmit FIFO, by setting the following fields in
the USB_GRSTCTL register.
• USB_GRSTCTL.TXFNUM = Endpoint Transmit FIFO Number
• USB_GRSTCTL.TXFFLSH = 1
2013-05-08 - Wonder Gecko Family - d0233_Rev0.50
304
www.energymicro.com