AT32F425
Series Reference Manual
2022.03.30
Page 399
Ver 2.01
20.6.4.7 OTGFS host port control and status register ( OTGFS_HPRT)
This register is valid only in host mode. Currently, the OTG host supports only one port.
This register contains USB port-relatd information such as USB reset, enable, suspend, resume, connect
status and test mode, as show in
. The register of type rw1c can interrupt the application
through the host port interrupt bit in the controller interrupt register. Upon a port interrupt, the application
must read this register and clear the bit that caused the interrupt. For the register of type rw1c, the
application must write 1 to clear the interrupt.
Bit
Register
Reset value
Type
Description
Bit 31: 19 Reserved
0x0000
resd
Kept at its default value.
Bit 18: 17 PRTSPD
0x0
ro
Port speed
Indicates the speed of the device connected to this port.
00: Reserved
01: Full speed
10: Low speed
11: Reserved
Bit 16: 13 PRTTSTCTL
0x0
rw
Port test control
The application writes a non-zero value to this field to put
the port into test mode, and the port gives a corresponding
signal.
0000: Test mode disabled
0001: Test_J mode
0010: Test_K mode
0011: Test_SE0_NAK mode
0100: Test_Packet mode
0101: Test_Force_Enable
Others: Reserved
Bit 12
PRTPWR
0x0
rw
Port power
The application uses this bit to control power supply to this
port (by writing 1 or 0)
0: Power off
1: Power on
Note: This bit is not associated with interfaces. The
application must follow the programming manual to set this
bit for various interfaces.
Bit 11: 10 PRTLNSTS
0x0
ro
Port line status
Indicates the current logic status of the USB data lines.
Bit [10]: Logic level of D+
Bit [11]: Logic level of D–
Bit 9
Reserved
0x0
resd
Kept at its default value.
Bit 8
PRTRST
0x0
rw
Port reset
When this bit is set by the application, a reset sequence is
started on this port. The application must calculate the time
required for the reset sequence, and clear this bit after the
reset sequence is complete.
0: Port not in reset
1: Port in reset
The application must keep this bit set for a minimum
duration defined in Section 7.1.7.5 of USB 2.0 specification
to start a reset on the port. In addition to this, the
application can make this bit set for another 10 ms to the
minimum duration, before clearing this bit. There is no
maximum limit set by the USB standard.
Bit 7
PRTSUSP
0x0
rw1s
Port suspend
The application sets this bit to put this port in suspend
mode. In this case, the controller only stops sending SOF.
The application must set the port clock stop bit in order to
disable the PHY clock.
The read value of this bit reflects the current suspend
status of the port.
This bit is cleared by the controller when a remote wakeup
signal is detected or when the application sets the port
reset bit or port resume bit in this register, or sets the