29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

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

Soft disconnect<br />

The powered state can be exited by software with the soft disconnect feature. The DP pullup<br />

resistor is removed by setting the soft disconnect bit in the device control register (SDIS<br />

bit in OTG_FS_DCTL), causing a device disconnect detection interrupt on the host side<br />

even though the USB cable was not really removed from the host port.<br />

Default state<br />

In the Default state the OTG_FS expects to recieve a SET_ADDRESS comm<strong>and</strong> from the<br />

host. No other USB operation is possible. When a valid SET_ADDRESS comm<strong>and</strong> is<br />

decoded on the USB, the application writes the corresponding number into the device<br />

address field in the device configuration register (DAD bit in OTG_FS_DCFG). The OTG_FS<br />

then enters the address state <strong>and</strong> is ready to answer host transactions at the configured<br />

USB address.<br />

Suspended state<br />

The OTG_FS peripheral constantly monitors the USB activity. After counting 3 ms of USB<br />

idleness, the early suspend interrupt (ESUSP bit in OTG_FS_GINTSTS) is issued, <strong>and</strong><br />

confirmed 3 ms later, if appropriate, by the suspend interrupt (USBSUSP bit in<br />

OTG_FS_GINTSTS). The device suspend bit is then automatically set in the device status<br />

register (SUSPSTS bit in OTG_FS_DSTS) <strong>and</strong> the OTG_FS enters the suspended state.<br />

The suspended state may optionally be exited by the device itself. In this case the<br />

application sets the remote wakeup signaling bit in the device control register (WKUPINT bit<br />

in OTG_FS_DCTL) <strong>and</strong> clears it after 1 to 15 ms.<br />

When a resume signaling is detected from the host, the resume interrupt (RWUSIG bit in<br />

OTG_FS_GINTSTS) is generated <strong>and</strong> the device suspend bit is automatically cleared.<br />

26.5.3 Peripheral endpoints<br />

The OTG_FS core instantiates the following USB endpoints:<br />

● Control endpoint 0<br />

– is bidirectional <strong>and</strong> h<strong>and</strong>les control messages only<br />

– has a separate set of registers to h<strong>and</strong>le in <strong>and</strong> out transactions<br />

– has proper control (DIEPCTL0/DOEPCTL0), transfer configuration<br />

(DIEPTSIZ0/DIEPTSIZ0), <strong>and</strong> status-interrupt (DIEPINTx/)DOEPINT0) registers.<br />

The available set of bits inside the control <strong>and</strong> transfer size registers slightly differs<br />

from that of other endpoints<br />

● 3 IN endpoints<br />

– each of them can be configured to support the isochronous, bulk or interrupt<br />

transfer type<br />

– each of them has proper control (DIEPCTLx), transfer configuration (DIEPTSIZx),<br />

<strong>and</strong> status-interrupt (DIEPINTx) registers<br />

– the Device IN endpoints common interrupt mask register (DIEPMSK) is available<br />

to enable/disable a single kind of endpoint interrupt source on all of the IN<br />

endpoints (EP0 included)<br />

– support incomplete isochronous IN transfer interrupt (IISOIXFR bit in<br />

OTG_FS_GINTSTS), asserted when there is at least one isochronous IN endpoint<br />

Doc ID 13902 Rev 9 701/995

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

Saved successfully!

Ooh no, something went wrong!