09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

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) <strong>RM0090</strong><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 receive a SET_ADDRESS command from the<br />

host. No other USB operation is possible. When a valid SET_ADDRESS command 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 and 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, and<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) and 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 (RWUSIG bit<br />

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

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

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

30.5.3 Peripheral endpoints<br />

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

● Control endpoint 0:<br />

– Bidirectional and handles control messages only<br />

– Separate set of registers to handle in and out transactions<br />

– Proper control (OTG_FS_DIEPCTL0/OTG_FS_DOEPCTL0), transfer<br />

configuration (OTG_FS_DIEPTSIZ0/OTG_FS_DIEPTSIZ0), and status-interrupt<br />

(OTG_FS_DIEPINTx/)OTG_FS_DOEPINT0) registers. The available set of bits<br />

inside the control and transfer size registers slightly differs from that of other<br />

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 (OTG_FS_DIEPCTLx), transfer configuration<br />

(OTG_FS_DIEPTSIZx), and status-interrupt (OTG_FS_DIEPINTx) registers<br />

– The Device IN endpoints common interrupt mask register (OTG_FS_DIEPMSK) is<br />

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

IN endpoints (EP0 included)<br />

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

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

1025/1416 Doc ID 018909 Rev 3

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

Saved successfully!

Ooh no, something went wrong!