29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

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.

RM0008<br />

USB on-the-go full-speed (OTG_FS)<br />

3. When a DISCINT (Disconnect Device) interrupt in OTG_FS_GINTSTS is received.<br />

(The application is expected to disable all enabled channels<br />

4. When the application aborts a transfer before normal completion.<br />

Operational model<br />

The application must initialize a channel before communicating to the connected device.<br />

This section explains the sequence of operation to be performed for different types of USB<br />

transactions.<br />

● Writing the transmit FIFO<br />

The OTG_FS host automatically writes an entry (OUT request) to the periodic/nonperiodic<br />

request queue, along with the last DWORD write of a packet. The application<br />

must ensure that at least one free space is available in the periodic/non-periodic<br />

request queue before starting to write to the transmit FIFO. The application must<br />

always write to the transmit FIFO in DWORDs. If the packet size is non-DWORD<br />

aligned, the application must use padding. The OTG_FS host determines the actual<br />

packet size based on the programmed maximum packet size <strong>and</strong> transfer size.<br />

Figure 270. Transmit FIFO write task<br />

Read GNPTXSTS/<br />

HPTXFSIZ registers for<br />

available FIFO <strong>and</strong><br />

queue spaces<br />

Start<br />

Wait for<br />

TXFELVL or PTXFELVL<br />

interrupt in<br />

OTG_FS_GAHBCFG<br />

No<br />

1 MPS<br />

or LPS FIFO space<br />

available<br />

Yes<br />

Yes<br />

Write 1 packet<br />

data to<br />

Transmit FIFO<br />

More packets<br />

to send<br />

No<br />

MPS: Maximum packet size<br />

LPS: Last t packet size<br />

Done<br />

ai15673<br />

●<br />

Reading the receive FIFO<br />

The application must ignore all packet statuses other than IN data packet (bx0010).<br />

Doc ID 13902 Rev 9 795/995

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

Saved successfully!

Ooh no, something went wrong!