Interrupt Service Routine (ISR) Flowcharts
13-98
Figure 13–22. Typical Operation for USB Device State Changed Interrupt Handler
End of device state
changed handler
Device state changed
handler
Read DEVSTAT
register (new value),
read DS_mem
(previous value).
DEVSTAT.
ATT changed?
Attached/
umattached
handler
DEVSTAT.
USB_Reset or
DEF changed?
USB Reset
handler
Device state must be
at least attached at
this point.
DEVSTAT.
SUS changed?
Suspend/
resume
handler
DEVSTAT.
R_Wk_Ok
changed?
Inform application that
a set/clear device
feature has modified
the remote wake-up
enable function.
DEVSTAT.
CFG changed
?
DEVSTAT.
CFG = 1?
DEVSTAT.
ADD = 1?
Application-Specific
Action to Handle
Configured State to
Addressed State
Transition
Application-Specific
Action to Handle
Addressed State to
Configured State
Transition
Application-Specific
Action to Handle
Configured State to
Default State Transition
DEVSTAT.
ADD changed?
Action-Specific
Action to Handle Default
State to Addressed
State Transition
Application-Specific
Action to Handle
Addressed State to
Default State Transition
Set IRQ_SRC.
DS_Chg = 1 to
clear the IT.
Save DEVSTAT
in DS_mem for
next DS_Chg IT.
No
Yes
Yes
No
Device state must be
at least default at this
point.
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Must be
not
configured
yet
Yes
No
IRQ_SRC.DS_Chg interrupt
flag is cleared inside the
attached/unattached, USB
reset and suspend/resume
handlers.
DEVSTAT.
ADD = 1?
Yes
No
Set IRQ_SRC.
DS_Chg = 1 to
clear the IT.
Set IRQ_SRC.
DS_Chg = 1 to
clear the IT.