GD32VF103 User Manual
467
As required by USB 2.0 protocol, USBFS doesn’t support low-speed in device mode.
Suspend and Wake-up
A USB device will enter into suspend state when the USB bus stays at IDLE state and there
is no change on data lines for 3ms. When USB device is in suspend state, most of its clock
are closed to save power. The USB host is able to wake up the suspended device by
generating a resume signal on USB bus. When USBFS detects the resume signal, the
WKUPIF flag in USBFS_GINTF register will be set and the USBFS wake up interrupt will be
triggered.
In suspend mode, USBFS is also able to remotely wake up the USB bus. Software may set
RWKUP bit in USBFS_DCTL register to send a remote wake-up signal, and if remote wake-
up is supported in USB host, the host will begin to send resume signal on USB bus.
Soft Disconnection
USBFS supports soft disconnection. After the device is powered on, USBFS will switch on
the pull-up resistor on DP line so that the host can detect the connection. It is able to force a
disconnection by setting the SD bit in USBFS_DCTL register. After the SD bit is set, USBFS
will directly switch off the pull-up resistor, so that USB host will detect a disconnection on USB
bus.
SOF tracking
When USBFS receives a SOF packet on USB bus, it will trigger a SOF interrupt and begin to
count the bus time using local USB clock. The frame number of the current frame is reported
in FNRSOF filed in USBFS_DSTAT register. When the USB bus time reaches EOF1 or EOF2
point (End of Frame, described in USB 2.0 protocol), USBFS will trigger an EOPFIF interrupt
in USBFS_GINTF register. These flags and registers can be used to get current bus time and
position information.
21.5.4.
OTG function overview
USBFS supports OTG function described in OTG protocol 1.3, OTG function includes SRP
and HNP protocols.
A-Device and B-Device
A-Device is an OTG capable USB device with a Standard-A or Micro-A plug inserted into its
receptacle. The A-Device supplies power to VBUS and it is host at the start of a session. B-
Device is an OTG capable USB device with a Standard-B, Micro-B or Mini-B plug inserted
into its receptacle, or a captive cable ending being a Standard-A plug. The B-Device is a
peripheral at the start of a session. USBFS uses the voltage level of ID pin to identify A-Device
or B-Device. The ID status is reported in IDPS bit in USBFS_GOTGCS register. For the details
of transfer states between A-Device and B-Device, please refer to OTG 1.3 protocol.
HNP