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

These data indicate that a SETUP packet for the specified endpoint is now<br />

available for reading from the receive FIFO.<br />

c) Setup stage done pattern:<br />

PKTSTS = Setup Stage Done, BCNT = 0x0, EPNUM = Control EP Num,<br />

DPID = Don’t Care (0b00).<br />

These data indicate that the Setup stage for the specified endpoint has completed<br />

and the Data stage has started. After this entry is popped from the receive FIFO,<br />

the core asserts a Setup interrupt on the specified control OUT endpoint.<br />

d) Data OUT packet pattern:<br />

PKTSTS = DataOUT, BCNT = size of the received data OUT packet (0 ≤ BCNT<br />

≤ 1 024), EPNUM = EPNUM on which the packet was received, DPID = Actual<br />

Data PID.<br />

e) Data transfer completed pattern:<br />

PKTSTS = Data OUT Transfer Done, BCNT = 0x0, EPNUM = OUT EP Num<br />

on which the data transfer is complete, DPID = Don’t Care (0b00).<br />

These data indicate that an OUT data transfer for the specified OUT endpoint has<br />

completed. After this entry is popped from the receive FIFO, the core asserts a<br />

Transfer Completed interrupt on the specified OUT endpoint.<br />

5. After the data payload is popped from the receive FIFO, the RXFLVL interrupt<br />

(OTG_HS_GINTSTS) must be unmasked.<br />

6. Steps 1–5 are repeated every time the application detects assertion of the interrupt line<br />

due to RXFLVL in OTG_HS_GINTSTS. Reading an empty receive FIFO can result in<br />

undefined core behavior.<br />

Figure 394 provides a flowchart of the above procedure.<br />

Figure 394. Receive FIFO packet read in slave mode<br />

packet<br />

store in<br />

memory<br />

● SETUP transactions<br />

wait until RXFLVL in OTG_FS_GINTSTSG<br />

rd_data = rd_reg (OTG_FS_GRXSTSP);<br />

mem[0:dword_cnt-1] =<br />

rd_rxfifo(rd_data.EPNUM,<br />

dword_cnt)<br />

This section describes how the core handles SETUP packets and the application’s<br />

sequence for handling SETUP transactions.<br />

● Application requirements<br />

1289/1416 Doc ID 018909 Rev 3<br />

Y<br />

rd_data.BCNT = 0<br />

N<br />

dword_cnt =<br />

BCNT[11:2] C +<br />

(BCNT[1] | BCNT[1])<br />

rcv_out_pkt()<br />

ai15677

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

Saved successfully!

Ooh no, something went wrong!