GD32F10x User Manual
758
Table 23-2. Double-buffering buffer flag definition
Buffer flag
Tx endpoint
Rx endpoint
DTG
TX_DTG (USBD_EPxCS bit 6)
RX_DTG (USBD_EPxCS bit 14)
SW_BUF
RX_DTG (USBD_EPxCS bit 14)
TX_DTG (USBD_EPxCS bit 6)
The DTG bit and the SW_BUF bit are responsible for the flow control. When a transfer
completes, the USB peripheral toggle the DTG bit; when the data have been copied, the
application software need to toggle the SW_BUF bit. Except for the first time, if the value of
DTG bit is
equal to the SW_BUF’s, the transfer will pause, and the host is NAK. When the
two bits are not equal, the transfer resume.
Table 23-3. Double buffer usage
Endpoint
Type
DTOG
SW_BUF
Packet buffer used by the
USB peripheral
Packet buffer used by the
application software
OUT
0
1
EPxRBADDR/EPxRBCNT
buffer description table
locations.
EPxTBADDR/EPxTBCNT
buffer description table
locations.
1
0
EPxTBADDR/EPxTBCNT
buffer description table
locations.
EPxRBADDR/EPxRBCNT
buffer description table
locations.
IN
0
1
EPxTBADDR/EPxTBCNT
buffer description table
locations.
EPxRBADDR/EPxRBCNT
buffer description table
locations.
1
0
EPxRBADDR/EPxRBCNT
buffer description table
locations.
EPxTBADDR/EPxTBCNT
buffer description table
locations.
Endpoint memory requests arbitration
As the USBD is connected to the APB1 bus through an APB1 interface, so USB APB1
interface will accept memory requests coming from the APB1 bus and from the USB interface.
The arbiter will resolve the conflicts by giving priority to APB1 accesses, while always
reserving half of the memory bandwidth to complete all USB transfers. This time-duplex
scheme implements a virtual dual-port SRAM that allows memory access, when an USB
transaction is happening. Multiword APB1 transfers of any length are also allowed by this
scheme.
23.6.2.
Operation procedure
USB transaction process
After the endpoint is configured and a transaction is required, the hardware will detect the
token packet. When a token is recognized by the USBD, the data transfer is performed. When
all the data has been transferred, the proper handshake packet over the USBD is generated
Содержание GD32F10 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F10x Arm Cortex M3 32 bit MCU User Manual Revision 2 6 Jun 2022 ...
Страница 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Страница 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Страница 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Страница 427: ...GD32F10x User Manual 427 value ...
Страница 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...