GD32F10x User Manual
777
Connection, Reset and Speed identification
As a USB host, USBFS will trigger a connection flag for application after a connection is
detected and will trigger a disconnection flag after a disconnection event.
PRST bit is used for USB reset sequence. Application may set this bit to start a USB reset
and clear this bit to finish the USB reset. This bit only takes effect when port is at connected
or enabled state.
The USBFS performs speed identification during connection, and the speed information will
be reported in PS filed in USBFS_HPCS register. USBFS identifies the device speed by the
voltage level of DM or DP. As describing in USB protocol, full-speed device pulls up DP line
while low-speed device pulls up DM line.
Suspend and resume
USBFS supports suspend state and resume operation. When USBFS port is at enabled state,
writing 1 to PSP bit in USBFS_HPCS register will cause USBFS to enter into suspend state.
In suspend state, USBFS stops sending SOFs on USB bus, and it will lead the connected
USB device to enter into suspend state after 3ms. Application can set the PREM bit in
USBFS_HPCS register to start a resume sequence, so as to wake up the suspended device,
and clear this bit to stop the resume sequence. The WKUPIF bit in USBFS_GINTF will be set
and then the USBFS wake up interrupt will be triggered if a host in suspend state detects a
remote wakeup signal.
SOF generate
USBFS sends SOF tokens on USB bus in host mode. As describing in USB 2.0 protocol, SOF
packets are generated (by the host controller or hub transaction translator) at each 1ms in
full-speed links.
Once that USBFS enterred into enabled state, it will send the SOF packet periodically which
the time is defined in USB 2.0 protocol. In addition, application may adjust the length of a
frame by writing FRI filed in USBFS_HFT registers. The FRI bits define the number of USB
clock cycles in a frame, so its value should be calculated based on the frequency of USB
clock which is used by USBFS. The FRT filed bits show that the remaining clock cycles of the
current frame and stop changing during suspend state.
USBFS is able to generate a pulse signal for each SOF packet and output it to a pin. The
pulse length is 12 HCLK cycle. If application desires to use this function, it needs to set
SOFOEN bit in USBFS_GCCFG register and configure the related pin registers in GPIO.
USB Channels and Transactions
USBFS includes 8 independent channels in host mode. Each channel is able to communicate
with an endpoint in USB device. The transfer type, direction, packet length and other
information are all configured in channel related registers such as USBFS_HCHxCTL and
USBFS_HCHxLEN.
Содержание 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 ...