
GD32F403xx User Manual
642
Micro-B plug for device) is inserted. By utilizing the Host Negotiation Protocol (HNP), an On-
The-Go B-Device, which is the default device, may make a request to be a host. The process
f or changing the role to be a host is described in this section. This protocol eliminates the
necessity of switching the cable connection for the roles change of the connected devices.
When USBFS is in OTG A-Device host mode and it wants to give up its host role, it may firstly
set PSP bit in USBFS_HPCS register to make the USB bus enter into suspend status. Then,
the B-Device will enter into suspend state 3ms later. If the B-Device wants to change to be a
host, HNPREQ bit in USBFS_GOTGCS register should be set and the USBFS will begin to
perf orm HNP protocol on bus, and at last, the result of HNP is reported in HNPS bit in
USBFS_GOTGCS register. In additional, it is always available to get the current role (host or
device) from COPM bit in USBFS_GINTF register.
SRP
The Session Request Protocol (SRP) allows a B-Device to request the A-Device to turn on
VBUS and start a session. This protocol allows the A-Device, which may be battery powered,
to save power by turning VBUS off when there is no bus activity, while still providing a means
f or the B-Device to initiate bus activity. As is described in OTG protocol, an OTG device must
compare VBUS voltage with several threshold values , and the compared result should be
reported in ASV and BSV bits in USBFS_GOTGCS register.
Set SRPREQ bit in USBFS_GOTGCS register to start a SRP request when USBFS is in B-
Device OTG mode. USBFS will generate a success flag SRPS in USBFS_GOTGCS register
if the SRP request successfully.
When USBFS is in OTG A-Device mode and it has detected a SRP request from a B-Device,
it sets a SESIF flag in USBFS_GINTF register. The 5V power supply for VBUS pin should be
prepared to switch on after getting this flag.
23.5.5.
Data FIFO
The USBFS contains a 1.25K bytes data FIFO f or packet data storing. The data FIFO is
implemented by using an internal SRAM in USBFS.
Host Mode
In host mode, the data FIFO space is divided into 3 parts: Rx FIFO for received packet, Non-
Periodic Tx FIFO f or non-period transmission packet and Periodic Tx FIFO f or periodic
transmission packet. All IN channels shares the Rx FIFO f or packets reception. All the
periodic OUT channels share the periodic Tx FIFO to packets tramsmission. All the non-
periodic OUT channels share the non-Periodic FIFO for transmit packets. The size and start
of fset of these data FIFOs should be configured using these registers: USBFS_GRFLEN,
USBFS_HNPTFLEN and USBFS_HPTFLEN.
Figure 23-5. HOST mode FIFO space in
describes the structure of these FIFOs in SRAM. The values in the figure are in term
of 32-bit words.
Содержание 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 ...