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.

Universal serial bus full-speed device interface (USB)<br />

RM0008<br />

A device may require to exit from suspend mode as an answer to particular events not<br />

directly related to the USB protocol (e.g. a mouse movement wakes up the whole system).<br />

In this case, the resume sequence can be started by setting the RESUME bit in the<br />

USB_CNTR register to ‘1’ <strong>and</strong> resetting it to 0 after an interval between 1mS <strong>and</strong> 15mS (this<br />

interval can be timed using ESOF interrupts, occurring with a 1mS period when the system<br />

clock is running at nominal frequency). Once the RESUME bit is clear, the resume<br />

sequence will be completed by the host PC <strong>and</strong> its end can be monitored again using the<br />

RXDP <strong>and</strong> RXDM bits in the USB_FNR register.<br />

Note:<br />

The RESUME bit must be anyway used only after the USB peripheral has been put in<br />

suspend mode, setting the FSUSP bit in USB_CNTR register to 1.<br />

21.5 USB registers<br />

The USB peripheral registers can be divided into the following groups:<br />

● Common Registers: Interrupt <strong>and</strong> Control registers<br />

● Endpoint Registers: Endpoint configuration <strong>and</strong> status<br />

● Buffer Descriptor Table: Location of packet memory used to locate data buffers<br />

All register addresses are expressed as offsets with respect to the USB peripheral registers<br />

base address 0x4000 5C00, except the buffer descriptor table locations, which starts at the<br />

address specified by the USB_BTABLE register. Due to the common limitation of APB1<br />

bridges on word addressability, all register addresses are aligned to 32-bit word boundaries<br />

although they are 16-bit wide. The same address alignment is used to access packet buffer<br />

memory locations, which are located starting from 0x4000 6000.<br />

Refer to Section 1.1 on page 37 for a list of abbreviations used in register descriptions.<br />

21.5.1 Common registers<br />

These registers affect the general behavior of the USB peripheral defining operating mode,<br />

interrupt h<strong>and</strong>ling, device address <strong>and</strong> giving access to the current frame number updated<br />

by the host PC.<br />

USB control register (USB_CNTR)<br />

Address offset: 0x40<br />

Reset value: 0x0003<br />

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

CTRM PMAOVRM ERRM WKUPM SUSPM RESETM SOFM ESOFM Reserved RESUME FSUSP LP_MODE PDWN FRES<br />

rw rw rw rw rw rw rw rw Res. rw rw rw rw rw<br />

Bit 15 CTRM: Correct transfer interrupt mask<br />

0: Correct Transfer (CTR) Interrupt disabled.<br />

1: CTR Interrupt enabled, an interrupt request is generated when the corresponding bit in<br />

the USB_ISTR register is set.<br />

Bit 14 PMAOVRM: Packet memory area over / underrun interrupt mask<br />

0: PMAOVR Interrupt disabled.<br />

1: PMAOVR Interrupt enabled, an interrupt request is generated when the corresponding bit<br />

in the USB_ISTR register is set.<br />

526/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!