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.

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

RM0008<br />

Reception buffer address n (USB_ADDRn_RX)<br />

Address offset: [USB_BTABLE] + n*16 + 8<br />

USB local Address: [USB_BTABLE] + n*8 + 4<br />

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

ADDRn_RX[15:1] -<br />

rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw -<br />

Bits 15:1 ADDRn_RX[15:1]: Reception buffer address<br />

These bits point to the starting address of the packet buffer, which will contain the data<br />

received by the endpoint associated with the USB_EPnR register at the next OUT/SETUP<br />

token addressed to it.<br />

Bit 0 This bit must always be written as ‘0’ since packet memory is word-wide <strong>and</strong> all packet buffers<br />

must be word-aligned.<br />

Reception byte count n (USB_COUNTn_RX)<br />

Address offset: [USB_BTABLE] + n*16 + 12<br />

USB local Address: [USB_BTABLE] + n*8 + 6<br />

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

BLSIZE NUM_BLOCK[4:0] COUNTn_RX[9:0]<br />

rw rw rw rw rw rw r r r r r r r r r r<br />

This table location is used to store two different values, both required during packet<br />

reception. The most significant bits contains the definition of allocated buffer size, to allow<br />

buffer overflow detection, while the least significant part of this location is written back by the<br />

USB peripheral at the end of reception to give the actual number of received bytes. Due to<br />

the restrictions on the number of available bits, buffer size is represented using the number<br />

of allocated memory blocks, where block size can be selected to choose the trade-off<br />

between fine-granularity/small-buffer <strong>and</strong> coarse-granularity/large-buffer. The size of<br />

allocated buffer is a part of the endpoint descriptor <strong>and</strong> it is normally defined during the<br />

enumeration process according to its maxPacketSize parameter value (See “Universal<br />

Serial Bus Specification”).<br />

538/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!