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

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

Bit 15 BL_SIZE: BLock size<br />

This bit selects the size of memory block used to define the allocated buffer area.<br />

– If BL_SIZE=0, the memory block is 2 byte large, which is the minimum block allowed in a<br />

word-wide memory. With this block size the allocated buffer size ranges from 2 to 62 bytes.<br />

– If BL_SIZE=1, the memory block is 32 byte large, which allows to reach the maximum<br />

packet length defined by USB specifications. With this block size the allocated buffer size<br />

ranges from 32 to 1024 bytes, which is the longest packet size allowed by USB st<strong>and</strong>ard<br />

specifications.<br />

Bits 14:10 NUM_BLOCK[4:0]: Number of blocks<br />

These bits define the number of memory blocks allocated to this packet buffer. The actual<br />

amount of allocated memory depends on the BL_SIZE value as illustrated in Table 160.<br />

Bits 9:0 COUNTn_RX[9:0]: Reception byte count<br />

These bits contain the number of bytes received by the endpoint associated with the<br />

USB_EPnR register during the last OUT/SETUP transaction addressed to it.<br />

Note:<br />

Double-buffered <strong>and</strong> Isochronous IN Endpoints have two USB_COUNTn_TX<br />

registers: named USB_COUNTn_TX_1 <strong>and</strong> USB_COUNTn_TX_0 with the<br />

following content.<br />

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16<br />

BLSIZE<br />

_1<br />

NUM_BLOCK_1[4:0]<br />

COUNTn_RX_1[9:0]<br />

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

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

BLSIZE<br />

_0<br />

NUM_BLOCK_0[4:0]<br />

COUNTn_RX_0[9:0]<br />

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

Table 160. Definition of allocated buffer memory<br />

Value of<br />

NUM_BLOCK[4:0]<br />

Memory allocated<br />

when BL_SIZE=0<br />

Memory allocated<br />

when BL_SIZE=1<br />

0 (‘00000’) Not allowed 32 bytes<br />

1 (‘00001’) 2 bytes 64 bytes<br />

2 (‘00010’) 4 bytes 96 bytes<br />

3 (‘00011’) 6 bytes 128 bytes<br />

... ... ...<br />

15 (‘01111’) 30 bytes 512 bytes<br />

16 (‘10000’) 32 bytes N/A<br />

17 (‘10001’) 34 bytes N/A<br />

18 (‘10010’) 36 bytes N/A<br />

... ... ...<br />

30 (‘11110’) 60 bytes N/A<br />

31 (‘11111’) 62 bytes N/A<br />

Doc ID 13902 Rev 9 539/995

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

Saved successfully!

Ooh no, something went wrong!