AT32F425
Series Reference Manual
2022.03.30
Page 345
Ver 2.01
20.4
OTGFS interrupts
shows the OTGFS interrupt hierarchy. Refer to the OTGFS interrupt register
(OTGFS_GINTSTS) and OTGFS interrupt mask register (OTGFS_GINTMSK).
Figure 20-2 OTGFS interrupt hierarchy
3
1
3
0
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
1
9
1
8
9 8
2 1 0
31:16
OUT
Endpoints
15:0
IN Endpoints
Device IN/OUT Endpoint
Interrupt register 0~15
Host Port Control and Status
Register
Host All Channels Interrupt
Registers
Host Channels Interrupt
Register 0~15
OTG
Interrupt
Register
Core Interrupt Mask Register
Device all endpoints
interrupt mask register
Device IN/OUT Endpoints
Common
Interrupt Mask Register
Host All Channels
Interrupt Mask
Register
Host Channels Interrupt Mask
Registers 0~15
Global Interrupt
Mask (Bit 0)
CORE
Interrupt
AHB Configuration
Register
OR
AND
Device All
Endpoints Interrupt
Register
Interrupt
source
Core interruput
register
Note Because an interrupt mask only masks an interrupt,
software must clear an interrupt before unmasking it, to
avoid servicing an old interrupt.
1
7
1
6
1
5
1
4
1
3
1
2
1
1
1
0
7 6 5 4 3
20.5
OTGFS functional description
20.5.1 OTGFS initialization
If the cable is connected during power-on, the current operation mode bit (CURMOD bit) in the controller
interrupt register indicates the mode. The OTGFS controller enters host mode when A-type plug is
connected or device mode when a B-type plug is connected.
This section explains the initialization of the OTGFS controller after power-on. The application must
follow the initialization sequence, however in host or device mode. All controller global registers are
initialized according to the controller configuration.
1. Program the following fields in the global AHB configuration register:
Global interrupt mask bit = 0x1
Non-periodic transmit FIFO empty level
Periodic transmit FIFO empty level