09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

USB on-the-go high-speed (OTG_HS) <strong>RM0090</strong><br />

Endpoint transfer<br />

The device endpoint-x transfer size registers (DIEPTSIZx/DOEPTSIZx) allow the application<br />

to program the transfer size parameters and read the transfer status.<br />

The programming operation must be performed before setting the endpoint enable bit in the<br />

endpoint control register.<br />

Once the endpoint is enabled, these fields are read-only as the OTG FS core updates them<br />

with the current transfer status.<br />

The following transfer parameters can be programmed:<br />

● Transfer size in bytes<br />

● Number of packets constituting the overall transfer size.<br />

Endpoint status/interrupt<br />

The device endpoint-x interrupt registers (DIEPINTx/DOPEPINTx) indicate the status of an<br />

endpoint with respect to USB- and AHB-related events. The application must read these<br />

registers when the OUT endpoint interrupt bit or the IN endpoint interrupt bit in the core<br />

interrupt register (OEPINT bit in OTG_HS_GINTSTS or IEPINT bit in OTG_HS_GINTSTS,<br />

respectively) is set. Before the application can read these registers, it must first read the<br />

device all endpoints interrupt register (OTG_HS_DAINT) to get the exact endpoint number<br />

for the device endpoint-x interrupt register. The application must clear the appropriate bit in<br />

this register to clear the corresponding bits in the DAINT and GINTSTS registers.<br />

The peripheral core provides the following status checks and interrupt generation:<br />

● Transfer completed interrupt, indicating that data transfer has completed on both the<br />

application (AHB) and USB sides<br />

● Setup stage done (control-out only)<br />

● Associated transmit FIFO is half or completely empty (in endpoints)<br />

● NAK acknowledge transmitted to the host (isochronous-in only)<br />

● IN token received when Tx-FIFO was empty (bulk-in/interrupt-in only)<br />

● OUT token received when endpoint was not yet enabled<br />

● Babble error condition detected<br />

● Endpoint disable by application is effective<br />

● Endpoint NAK by application is effective (isochronous-in only)<br />

● More than 3 back-to-back setup packets received (control-out only)<br />

● Timeout condition detected (control-in only)<br />

● Isochronous out packet dropped without generating an interrupt<br />

1163/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!