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

Mask ACK<br />

Unmask CHH<br />

Disable Channel<br />

if (STALL)<br />

{<br />

Transfer Done = 1<br />

}<br />

}<br />

else<br />

if (NAK or TXERR)<br />

{<br />

Rewind Buffer Pointers<br />

Reset Error Count<br />

Mask ACK<br />

Unmask CHH<br />

Disable Channel<br />

}<br />

else<br />

if (CHH)<br />

{<br />

Mask CHH<br />

if (Transfer Done or (Error_count == 3))<br />

{<br />

De-allocate Channel<br />

}<br />

else<br />

{<br />

Re-initialize Channel (in next b_interval - 1 Frame)<br />

}<br />

}<br />

else<br />

if (ACK)<br />

{<br />

Reset Error Count<br />

Mask ACK<br />

}<br />

The application is expected to write the data packets into the transmit FIFO when the<br />

space is available in the transmit FIFO and the Request queue up to the count<br />

specified in the MCNT field before switching to another channel. The application uses<br />

the NPTXFE interrupt in OTG_HS_GINTSTS to find the transmit FIFO space.<br />

b) Interrupt IN<br />

Unmask (NAK/TXERR/XFRC/BBERR/STALL/FRMOR/DTERR)<br />

if (XFRC)<br />

{<br />

Reset Error Count<br />

Mask ACK<br />

if (OTG_HS_HCTSIZx.PKTCNT == 0)<br />

{<br />

De-allocate Channel<br />

}<br />

else<br />

{<br />

1273/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!