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

Figure 369. Bulk/control IN transactions<br />

init_reg(ch_2)<br />

set_ch_en<br />

(ch_2)<br />

set_ch_en<br />

(ch_2)<br />

set_ch_en<br />

(ch_2)<br />

read_rx_sts<br />

read_rx_fifo<br />

set_ch_en<br />

(ch_2)<br />

read_rx_stsre<br />

ad_rx_fifo<br />

read_rx_sts<br />

Disable<br />

(ch_2)<br />

De-allocate<br />

(ch_2)<br />

1<br />

1<br />

2<br />

2<br />

5<br />

5<br />

7<br />

7<br />

9<br />

Application AHB Host<br />

USB Device<br />

init_reg(ch_1)<br />

write_tx_fifo<br />

(ch_1)<br />

write_tx_fifo<br />

(ch_1)<br />

De-allocate<br />

(ch_1)<br />

1<br />

MPS<br />

1<br />

MPS<br />

1<br />

MPS<br />

1<br />

MPS<br />

read_rx_sts 11<br />

10<br />

CHH interrupt r<br />

13<br />

RXFLVL interrupt<br />

XFRC interrupt<br />

RXFLVL interrupt<br />

RXFLVL interrupt<br />

XFRC interrupt<br />

RXFLVL interrupt<br />

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

a) Initialize channel 2.<br />

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

queue.<br />

c) The core attempts to send an IN token after completing the current OUT<br />

transaction.<br />

d) The core generates an RXFLVL interrupt as soon as the received packet is written<br />

to the receive FIFO.<br />

e) In response to the RXFLVL interrupt, mask the RXFLVL interrupt and read the<br />

received packet status to determine the number of bytes received, then read the<br />

receive FIFO accordingly. Following this, unmask the RXFLVL interrupt.<br />

8<br />

6<br />

3<br />

6<br />

12<br />

4<br />

ch_1<br />

ch_2<br />

ch_1<br />

ch_2<br />

3<br />

ch_1<br />

ch_2<br />

ch_2<br />

ch_2<br />

ch_2<br />

4<br />

Non-Periodic Request<br />

Queue<br />

Assume that this queue<br />

can hold 4 entries.<br />

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

OUT<br />

DATA0<br />

MPS<br />

ACK<br />

IN<br />

DATA0<br />

ACK<br />

OUT<br />

DATA1<br />

MPS<br />

ACK<br />

IN<br />

DATA1<br />

ACK<br />

ai15675

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

Saved successfully!

Ooh no, something went wrong!