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

De-allocate Channel<br />

}<br />

else if (STALL)<br />

{<br />

Transfer Done = 1<br />

Unmask CHH<br />

Disable Channel<br />

}<br />

else if (NAK or TXERR )<br />

{<br />

Rewind Buffer Pointers<br />

Unmask CHH<br />

Disable Channel<br />

if (TXERR)<br />

{<br />

Increment Error Count<br />

Unmask ACK<br />

}<br />

else<br />

{<br />

Reset Error Count<br />

}<br />

}<br />

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

}<br />

}<br />

else 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 as and<br />

when the space is available in the transmit FIFO and the Request queue. The<br />

application can make use of the NPTXFE interrupt in OTG_FS_GINTSTS to find the<br />

transmit FIFO space.<br />

b) Bulk/Control IN<br />

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

if (XFRC)<br />

{<br />

Reset Error Count<br />

Unmask CHH<br />

Disable Channel<br />

Doc ID 018909 Rev 3 1116/1416

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

Saved successfully!

Ooh no, something went wrong!