![GigaDevice Semiconductor GD32F20 Series Скачать руководство пользователя страница 882](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32f20-series/gd32f20-series_user-manual_2225801882.webp)
GD32F20x User Manual
882
Since On-The-Go devices have a Micro-AB receptacle, an On-The-Go device can be a
host/device by default, depending on which type of plug (Micro-A plug for host, 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 request to be a host. The process for changing the
role to be a host is described in next 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
perform 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 by application.
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
for 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 OTG
B-Device mode. USBFS will generate a success flag SRPS in USBFS_GOTGCS register if
the SRP requests 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.
28.5.5.
Data FIFO
The USBFS contains a 1.25K bytes data FIFO for packet data storage. 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 for non-period transmission packet and periodic Tx FIFO for periodic
transmission packet. All IN channels shares the Rx FIFO for packets reception. All the
periodic OUT channels share the periodic Tx FIFO for packets transmission. All the non-
periodic OUT channels share the non-periodic FIFO for packets transmission. The size and
start offset of these data FIFOs should be configured using these registers: USBFS_GRFLEN,
USBFS_HNPTFLEN and USBFS_HPTFLEN.
Figure 28-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.
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...