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.

USB on-the-go high-speed (OTG_HS) <strong>RM0090</strong><br />

}<br />

The application is expected to write the requests for the same channel when the<br />

Request queue space is available up to the count specified in the MCNT field before<br />

switching to another channel (if any).<br />

● Interrupt IN transactions<br />

The assumptions are:<br />

– The application is attempting to receive one packet (up to 1 maximum packet size)<br />

in every frame, starting with odd (transfer size = 1 024 bytes).<br />

– The receive FIFO can hold at least one maximum-packet-size packet and two<br />

status DWORDs per packet (1 031 bytes).<br />

– Periodic request queue depth = 4.<br />

● Normal interrupt IN operation<br />

The sequence of operations is as follows:<br />

a) Initialize channel 2. The application must set the ODDFRM bit in<br />

OTG_HS_HCCHAR2.<br />

b) Set the CHENA bit in OTG_HS_HCCHAR2 to write an IN request to the periodic<br />

request queue. For a high-bandwidth interrupt transfer, the application must write<br />

the OTG_HS_HCCHAR2 register MCNT (maximum number of expected packets<br />

in the next frame times) before switching to another channel.<br />

c) The OTG_HS host writes an IN request to the periodic request queue for each<br />

OTG_HS_HCCHAR2 register write with the CHENA bit set.<br />

d) The OTG_HS host attempts to send an IN token in the next (odd) frame.<br />

e) As soon as the IN packet is received and written to the receive FIFO, the OTG_HS<br />

host generates an RXFLVL interrupt.<br />

f) In response to the RXFLVL interrupt, read the received packet status to determine<br />

the number of bytes received, then read the receive FIFO accordingly. The<br />

application must mask the RXFLVL interrupt before reading the receive FIFO, and<br />

unmask after reading the entire packet.<br />

g) The core generates the RXFLVL interrupt for the transfer completion status entry<br />

in the receive FIFO. The application must read and ignore the receive packet<br />

status when the receive packet status is not an IN data packet (PKTSTS in<br />

GRXSTSR ≠ 0b0010).<br />

h) The core generates an XFRC interrupt as soon as the receive packet status is<br />

read.<br />

i) In response to the XFRC interrupt, read the PKTCNT field in OTG_HS_HCTSIZ2.<br />

If the PKTCNT bit in OTG_HS_HCTSIZ2 is not equal to 0, disable the channel<br />

before re-initializing the channel for the next transfer, if any). If PKTCNT bit in<br />

1275/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!