
GD32F403xx User Manual
646
Sof tware can disable the channel by setting both CEN and CDIS bits at the same time.
USBFS will generate a channel disable request entry in request queue af ter the register
setting operation. When the request entry reaches the top of request queue, it will be
processed by USBFS immediately:
For OUT channels, the specified channel will be disabled immediately. Then, a CH f lag will
be generated and the CEN and CDIS bits will be cleared by USBFS.
For IN channels, USBFS pushes a channel disable status entry into Rx FIFO. Then software
should handle the Rx FIFO not empty event: read and pop this status entry, and then, a CH
f lag will be generated and the CEN and CDIS bits will be cleared.
IN transfers operation sequence
1. Initialize USBFS global registers.
2. Initialize the channel.
3. Enable the channel.
4. Af ter the IN channel is enabled by software, USBFS generates an Rx request entry in the
corresponding request queue.
5. When the Rx request entry reaches the top of the request queue, USBFS begins to
process this request entry. If bus time for the IN transaction indicated by the request entry
is enough, USBFS starts the IN transaction on USB bus.
6. If the IN transaction is finished successfully (ACK handshake received), USBFS pushes
the received data packet into the Rx FIFO and triggers ACK f lag. Otherwise, the status
f lag (NAK) reports the transaction result.
7. If the IN transaction described in step 5 is successful and PCNT is larger than 1 in step2,
return to step 3 and continues to receive the remaining packets. If the IN transaction
described in step 5 is not successful, return to step 3 to re-receive the packet again.
8. Af ter all the transactions in a transf er have been successfully received on USB bus,
USBFS pushes a TF status entry into the Rx FIFO on top of the last packet data. Thus
af ter reading and poping all the received data packet, the TF status entry is need, USBFS
generates TF f lag to indicate that the transfer successfully has been finished.
9. Disable the channel. Now the channel is in IDLE state and is ready for other transfers.
OUT transfers operation sequence
1. Initialize USBFS global registers.
2. Initialize and enable the channel.
3.
Write a packet into the channel’s Tx FIFO (Periodic Tx FIFO or non-periodic Tx FIFO).
Af ter the whole packet data is written into the FIFO, USBFS generates a Tx request entry
in the corresponding request queue and decreases the TLEN field in USBFS_HCHxLEN
register by the written packet’s size.
Содержание GD32F403 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F403xx Arm Cortex M4 32 bit MCU User Manual Revision 2 6 Jul 2022 ...
Страница 177: ...GD32F403xx UserManual 177 Peripheral Channel 0 Channel 1 Channel 2 Channel 3 Channel 4 SDIO SDIO ...
Страница 217: ...GD32F403xx UserManual 217 ensures that no conversion is in progress ...