GD32F10x User Manual
787
OUT transfers operation sequence
1.
Initialize USBFS global registers.
2.
Initialize the endpoint and enable the endpoint.
3.
When an OUT token is received, USBFS receives the data packet or response with an
NAK handshake based on the status of Rx FIFO and register configuration. If the
transaction is finished successfully (USBFS receives and saves the data packet into Rx
FIFO successfully and sends ACK handshake on USB bus), PCNT in
USBFS_DOEPxLEN register is decreased by 1 and the ACK flag is triggered, otherwise,
the status flags report the transaction result.
4.
After all the data packets in a transfer are successfully received on USB bus, USBFS
pushes a TF status entry into the Rx FIFO on top of the last packet data. Thus after
reading and poping all the received data packet, the TF status entry is read, USBFS
generates TF flag to indicate that the transfer successfully is finished and the OUT
endpoint is disabled.
24.6.
Interrupts
USBFS has two interrupts: global interrupt and wake-up interrupt.
The source flags of the global interrupt are readable in USBFS_GINTF register and are listed
in
Table 24-2. USBFS global interrupt
Table 24-2. USBFS global interrupt
Interrupt Flag
Description
Operation Mode
SESIF
Session interrupt
Host or device mode
DISCIF
Disconnect interrupt flag
Host Mode
IDPSC
ID pin status change
Host or device mode
PTXFEIF
Periodic Tx FIFO empty interrupt flag
Host Mode
HCIF
Host channels interrupt flag
Host Mode
HPIF
Host port interrupt flag
Host Mode
ISOONCIF/PXN
CIF
Periodic transfer Not Complete
Interrupt flag /Isochronous OUT
transfer Not Complete Interrupt Flag
Host or device mode
ISOINCIF
Isochronous IN transfer Not Complete
Interrupt Flag
Device mode
OEPIF
OUT endpoint interrupt flag
Device mode
IEPIF
IN endpoint interrupt flag
Device mode
EOPFIF
End of periodic frame interrupt flag
Device mode
ISOOPDIF
Isochronous OUT packet dropped
interrupt flag
Device mode
ENUMF
Enumeration finished
Device mode
Summary of Contents for GD32F10 Series
Page 63: ...GD32F10x User Manual 63 programmed during the chip production ...
Page 117: ...GD32F10x User Manual 117 010 1 0 011 0 9 ...
Page 416: ...GD32F10x User Manual 416 shadow register updates every update event ...
Page 427: ...GD32F10x User Manual 427 value ...
Page 518: ...GD32F10x User Manual 518 These bits are not used in SPI mode ...