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 full-speed (OTG_FS) <strong>RM0090</strong><br />

Figure 368. Normal bulk/control OUT/SETUP and 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 />

The channel-specific interrupt service routine for bulk and control OUT/SETUP<br />

transactions is shown in the following code samples.<br />

● Interrupt service routine for bulk/control OUT/SETUP and bulk/control IN<br />

transactions<br />

a) Bulk/Control OUT/SETUP<br />

Unmask (NAK/TXERR/STALL/XFRC)<br />

if (XFRC)<br />

{<br />

Reset Error Count<br />

Mask ACK<br />

1115/1416 Doc ID 018909 Rev 3<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 />

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

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!