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 high-speed (OTG_HS)<br />

3. When the application pops the Global OUT NAK pattern DWORD from the receive<br />

FIFO, the core sets the GONAKEFF interrupt (OTG_HS_GINTSTS).<br />

4. Once the application detects this interrupt, it can assume that the core is in Global OUT<br />

NAK mode. The application can clear this interrupt by clearing the SGONAK bit in<br />

OTG_HS_DCTL.<br />

Application programming sequence<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_HS_DCTL<br />

2. Wait for the assertion of the GONAKEFF interrupt in OTG_HS_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_HS_DCTL and before the core asserts the GONAKEFF interrupt<br />

(OTG_HS_GINTSTS).<br />

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

GINTMSK.<br />

– GINAKEFFM = 0 in GINTMSK<br />

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

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

(OTG_HS_GINTSTS).<br />

– OTG_HS_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_HS_DCTL<br />

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

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

– EPDIS = 1 in OTG_HS_DOEPCTLx<br />

– SNAK = 1 in OTG_HS_DOEPCTLx<br />

4. Wait for the EPDISD interrupt (OTG_HS_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_HS_DOEPCTLx<br />

– EPENA = 0 in OTG_HS_DOEPCTLx<br />

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

nondisabled OUT endpoints.<br />

– SGONAK = 0 in OTG_HS_DCTL<br />

● Generic nonisochronous OUT data transfers<br />

Doc ID 018909 Rev 3 1292/1416

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

Saved successfully!

Ooh no, something went wrong!