GD32F10x User Manual
785
2. Initialize and enable the channel.
3. Write a packet into the channel
’s Tx FIFO (Periodic Tx FIFO or non-periodic Tx FIFO).
After 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.
4. When the request entry reaches the top of the request queue, USBFS begins to process
this request entry. If bus time for the transaction indicated by the request entry is enough,
USBFS starts the OUT transaction on USB bus.
5. When the OUT transaction indicated by the request entry has been finished on USB bus,
PCNT in USBFS_HCHxLEN register is decreased by 1. If the transaction is finished
successfully (ACK handshake received), the ACK flag is triggered. Otherwise, the status
flag (NAK) reports the transaction result.
6. If the OUT transaction described in step 5 is successful and PCNT is larger than 1 in
step2, return to step 3 and continues to send the remaining packets. If the OUT
transaction described in step 5 is not successful, return to step 3 to resend the packet
again.
7. After all the transactions in a transfer are successfully sent on USB bus, USBFS
generates TF flag to indicate that the transfer successfully finishes.
8. Disable the channel. Now the channel is in IDLE state and is ready for other transfers.
Device mode
Global register initialization sequence
1. Program USBFS_GAHBCS register according to application
’s demand, such as the
TxFIFO
’s empty threshold, etc. GINTEN bit should be kept cleared at this time.
2. Program USBFS_GUSBCS register according to application
’s demand, such as: the
operation mode (host, device or OTG) and some parameters of OTG and USB protocols.
3. Program USBFS_GCCFG register according to application
’s demand.
4. Program USBFS_GRFLEN, USBFS_HNPTFLEN_DIEP0TFLEN, USBFS_DIEPxTFLEN
register to configure the data FIFOs according to application
’s demand.
5. Program USBFS_GINTEN register to enable Mode Fault, Suspend, SOF, Enumeration
Done and USB Reset interrupt and then, set GINTEN bit in USBFS_GAHBCS register to
enable global interrupt.
6. Program USBFS_DCFG register according to application
’s demand, such as the device
address, etc.
7. After the device is connected to a host, the host will perform port reset on USB bus and
this will trigger the RST interrupt in USBFS_GINTF register.
Содержание 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 ...