09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>RM0090</strong> USB on-the-go full-speed (OTG_FS)<br />

1. To stop receiving any kind of data in the receive FIFO, the application must set the<br />

Global OUT NAK bit by programming the following field:<br />

– SGONAK = 1 in OTG_FS_DCTL<br />

2. Wait for the assertion of the GONAKEFF interrupt in OTG_FS_GINTSTS. When<br />

asserted, this interrupt indicates that the core has stopped receiving any type of data<br />

except SETUP packets.<br />

3. The application can receive valid OUT packets after it has set SGONAK in<br />

OTG_FS_DCTL and before the core asserts the GONAKEFF interrupt<br />

(OTG_FS_GINTSTS).<br />

4. The application can temporarily mask this interrupt by writing to the GINAKEFFM bit in<br />

the OTG_FS_GINTMSK register.<br />

– GINAKEFFM = 0 in the OTG_FS_GINTMSK register<br />

5. Whenever the application is ready to exit the Global OUT NAK mode, it must clear the<br />

SGONAK bit in OTG_FS_DCTL. This also clears the GONAKEFF interrupt<br />

(OTG_FS_GINTSTS).<br />

– OTG_FS_DCTL = 1 in CGONAK<br />

6. If the application has masked this interrupt earlier, it must be unmasked as follows:<br />

– GINAKEFFM = 1 in GINTMSK<br />

● Disabling an OUT endpoint<br />

The application must use this sequence to disable an OUT endpoint that it has enabled.<br />

Application programming sequence:<br />

1. Before disabling any OUT endpoint, the application must enable Global OUT NAK<br />

mode in the core.<br />

– SGONAK = 1 in OTG_FS_DCTL<br />

2. Wait for the GONAKEFF interrupt (OTG_FS_GINTSTS)<br />

3. Disable the required OUT endpoint by programming the following fields:<br />

– EPDIS = 1 in OTG_FS_DOEPCTLx<br />

– SNAK = 1 in OTG_FS_DOEPCTLx<br />

4. Wait for the EPDISD interrupt (OTG_FS_DOEPINTx), which indicates that the OUT<br />

endpoint is completely disabled. When the EPDISD interrupt is asserted, the core also<br />

clears the following bits:<br />

– EPDIS = 0 in OTG_FS_DOEPCTLx<br />

– EPENA = 0 in OTG_FS_DOEPCTLx<br />

5. The application must clear the Global OUT NAK bit to start receiving data from other<br />

non-disabled OUT endpoints.<br />

– SGONAK = 0 in OTG_FS_DCTL<br />

● Generic non-isochronous OUT data transfers<br />

This section describes a regular non-isochronous OUT data transfer (control, bulk, or<br />

interrupt).<br />

Application requirements:<br />

Doc ID 018909 Rev 3 1134/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!