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 />

handshake, the packet count for the endpoint is decremented by one, until the packet<br />

count is zero. The packet count is not decremented on a timeout.<br />

5. For zero length packets (indicated by an internal zero length flag), the core sends out a<br />

zero-length packet for the IN token and decrements the packet count field.<br />

6. If there are no data in the FIFO for a received IN token and the packet count field for<br />

that endpoint is zero, the core generates an “IN token received when TxFIFO is empty”<br />

(ITTXFE) Interrupt for the endpoint, provided that the endpoint NAK bit is not set. The<br />

core responds with a NAK handshake for nonisochronous endpoints on the USB.<br />

7. The core internally rewinds the FIFO pointers and no timeout interrupt is generated.<br />

8. When the transfer size is 0 and the packet count is 0, the transfer complete (XFRC)<br />

interrupt for the endpoint is generated and the endpoint enable is cleared.<br />

Application programming sequence:<br />

1. Program the OTG_HS_DIEPTSIZx register with the transfer size and corresponding<br />

packet count.<br />

2. Program the OTG_HS_DIEPCTLx register with the endpoint characteristics and set the<br />

CNAK and EPENA (Endpoint Enable) bits.<br />

3. When transmitting nonzero length data packet, the application must poll the<br />

OTG_HS_DTXFSTSx register (where x is the FIFO number associated with that<br />

endpoint) to determine whether there is enough space in the data FIFO. The<br />

application can optionally use TXFE (in OTG_HS_DIEPINTx) before writing the data.<br />

● Generic periodic IN data transfers<br />

This section describes a typical periodic IN data transfer.<br />

Application requirements:<br />

1. Application requirements 1, 2, 3, and 4 of Generic nonperiodic IN data transfers on<br />

page 1299 also apply to periodic IN data transfers, except for a slight modification of<br />

requirement 2.<br />

– The application can only transmit multiples of maximum-packet-size data packets<br />

or multiples of maximum-packet-size packets, plus a short packet at the end. To<br />

1301/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!