Interrupt Service Routine (ISR) Flowcharts
13-93
USB Function Module
Figure 13–18. Prepare for Control Write Status Stage Routine
Prepare for control
write stage status
routine
End of prepare for
control write status
stage routine
Application-
specific action
to determine
control write
action and
status result
Set CTRL.Clr_EP to
1, then set
CTRL.Set_FIFO_En
to 1.
Want to respond
with ACK?
No
Want to respond
with stall?
Set SYSCON2.
Stall_Cmd to 1.
Yes
This actions include:
Reset-relevant endpoints if request is clear
endpoint feature, set config, or set interface.
Set halt for relevant endpoints if
request is set endpoint feature, set config, or
set interface.
Set SYSCON2.Dev_Cfg if request is valid
set config and device is addressed.
Set SYSCON2.Clr_Cfg if request is valid
set config with config_nb of 0 and device
is configured.
Set SYSCON1.Self_Pwr if request is set
config and device is self-powered in the
new config.
Enable NAK interrupt by
setting SYSCON1.Nak_En
to 1 if not already enabled.
No
Command-
specific
actions
Yes
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 1
– EP_NUM.EP_Sel = 1
– EP_NUM.Setup_Sel = 0
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 1
– EP_NUM.EP_Sel = 0
– EP_NUM.Setup_Sel = 0