Universal Serial Bus OTG Controller
UG0331 User Guide Revision 15.0
295
The following figure shows the flow chart of the overall operation in the USB OTG (dual role) mode.
Figure 144 •
Basic USB Flow Diagram when USB Controller is in OTG Mode
10.2.3.2 USB OTG Controller: Reset Operations
10.2.3.2.1 Peripheral Mode
When the USB controller is acting as a peripheral and a reset condition is detected on the USB, the
device performs the following actions:
1.
Sets Func Addr in
to 0
2.
Sets Selected Endpoint in
to 0
START
STOP
Initialization
1. Disable/initialize the Watchdog Timer
2. Configure the GPIO for keeping the PHY out of reset
3. Register the callback functions and ISRs
4. Clear and enable the interrupts
5. In this mode USB OTG microAB receptacle on board is
connected to PHY
Wait for the connection interrupt
1. Set the USB Controller in Host
mode
2. Enumerates the device
Device
Connected
type A?
Host supports the
device class?
ON
Class specific and application
code execution
START
ISR to handle the USB interrupts in
OTG mode
1. Connect/Disconnect Interrupt
2. Endpoint 0 Interrupt
3. TX Endpoint interrupt
4. RX Endpoint interrupt
5. Host specific interrupts if in Host
mode
6. Device specific interrupts if in
Device mode
STOP
YES
YES – Host Mode
STOP
1. Set the USB Controller in Device
mode
2. Wait for the Host detection of this
device
Device will respond to all the
commands of the enumeration
from host:
1. Set Address
2. Sending the descriptors
3. Set the configuration etc.
Device
Connected to
host ?
ON
Class specific and application
code execution based on the host
commands to device
YES
NO – Device Mode