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.

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

RM0008<br />

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

init_reg(ch_2)<br />

set_ch_en<br />

(ch_2)<br />

set_ch_en<br />

(ch_2)<br />

1<br />

1<br />

2<br />

2<br />

5<br />

Application<br />

init_reg(ch_1)<br />

write_tx_fifo<br />

(ch_1)<br />

write_tx_fifo<br />

(ch_1)<br />

AHB<br />

1<br />

MPS<br />

1<br />

MPS<br />

3<br />

Host<br />

4<br />

ch_1<br />

ch_2<br />

ch_1<br />

USB<br />

Non-Periodic Request<br />

Queue<br />

Assume that this queue<br />

can hold 4 entries.<br />

OUT<br />

Device<br />

ch_2<br />

DAT A0<br />

MPS<br />

set_ch_en<br />

(ch_2)<br />

3<br />

ACK<br />

IN<br />

5<br />

RXFLVL interrupt<br />

4<br />

DAT A0<br />

read_rx_sts<br />

read_rx_fifo<br />

1<br />

MPS<br />

ch_1<br />

ch_2<br />

ACK<br />

OUT<br />

set_ch_en<br />

(ch_2)<br />

ch_2<br />

ch_2<br />

DAT A1<br />

MPS<br />

7<br />

De-allocate<br />

(ch_1)<br />

XFRC interrupt<br />

6<br />

ACK<br />

IN<br />

DAT A1<br />

RXFLVL interrupt<br />

read_rx_stsre<br />

ad_rx_fifo<br />

1<br />

MPS<br />

6<br />

ACK<br />

read_rx_sts<br />

Disable<br />

(ch_2)<br />

7<br />

9<br />

RXFLVL interrupt<br />

XFRC interrupt<br />

RXFLVL interrupt<br />

read_rx_sts<br />

11<br />

10<br />

CHH interrupt r<br />

8<br />

ch_2<br />

De-allocate<br />

(ch_2)<br />

13<br />

12<br />

ai15675<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 <strong>and</strong> 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 />

800/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!