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

Table 187. OTG_FS register map <strong>and</strong> reset values (continued)<br />

Offset Register<br />

31<br />

30<br />

29<br />

28<br />

27<br />

26<br />

25<br />

24<br />

23<br />

22<br />

21<br />

20<br />

19<br />

18<br />

17<br />

16<br />

15<br />

14<br />

13<br />

12<br />

11<br />

10<br />

9<br />

8<br />

7<br />

6<br />

5<br />

4<br />

3<br />

2<br />

1<br />

0<br />

0xCF0<br />

OTG_FS_DOEP<br />

TSIZ15<br />

Reserved<br />

RXDPID/<br />

STUPCNT<br />

PKTCNT<br />

XFRSIZ<br />

Reset value 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0<br />

0xE00<br />

OTG_FS_PCG<br />

CCTL<br />

Reset value<br />

Reserved<br />

PHYSUSP<br />

Reserved<br />

GATEHCLK<br />

STPPCLK<br />

Refer to Table 1 on page 41 for the register boundary addresses.<br />

26.15 OTG_FS programming model<br />

26.15.1 Core initialization<br />

The application must perform the core initialization sequence. If the cable is connected<br />

during power-up, the current mode of operation bit in the Core interrupt register (CMOD bit<br />

in OTG_FS_GINTSTS) reflects the mode. The OTG_FS controller enters Host mode when<br />

an “A” plug is connected or Device mode when a “B” plug is connected.<br />

This section explains the initialization of the OTG_FS controller after power-on. The<br />

application must follow the initialization sequence irrespective of Host or Device mode<br />

operation. All core global registers are initialized according to the core’s configuration:<br />

1. Program the following fields in the Global AHB configuration (OTG_FS_GAHBCFG)<br />

register:<br />

– Global interrupt mask bit GINT = 1<br />

– RxFIFO non-empty (RXFLVL bit in OTG_FS_GINTSTS)<br />

– Periodic TxFIFO empty level<br />

2. Program the following fields in OTG_FS_GUSBCFG register:<br />

– HNP capable bit<br />

– SRP capable bit<br />

– FS timeout calibration field<br />

– USB turnaround time field<br />

3. The software must unmask the following bits in the GINTMSK register:<br />

OTG interrupt mask<br />

Mode mismatch interrupt mask<br />

4. The software can read the CMOD bit in OTG_FS_GINTSTS to determine whether the<br />

OTG_FS controller is operating in Host or Device mode.<br />

792/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!