28 USB FUNCTION CONTROLLER (USB)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
28-7
Transition to a status stage is triggered by an issuance of a transaction by the host whose direction is opposite to
that of the data stage. Have your firmware monitor an IN_TranNAK status (EP0IntStat.IN_TranNAK bit) as a
trigger to transit to a status stage from a data stage.
a
b
b
c
Host to Device
Device to Host
5.1.4 Control Transfer Having an OUT Data Stage
Figure 28.
Figure 28.5.1.5 illustrates how control transfer is executed for an IN data stage.
(a) The host starts control transfer in a SETUP transaction. The device’s firmware analyzes the request contents
to prepare for responding to a data stage.
(b) The host issues an IN transaction and executes a data stage, and the device transmits data.
(c) The host issues an OUT transaction and executes a status stage, and the device returns an ACK response.
Transition to a status stage is triggered by an issuance of a transaction by the host whose direction is opposite to
that of the data stage. Have your firmware monitor an OUT_TranNAK status (EP0IntStat.OUT_TranNAK bit)
as a trigger to transit to a status stage from a data stage.
a
b
b
c
Host to Device
Device to Host
5.1.5 Control Transfer Having an IN Data Stage
Figure 28.
Since status and data stages in control transfer execute ordinary OUT and IN transactions, flow control using
NAK responses works effectively. The device is allowed to prepare for returning responses within a specified
time frame.
SETUP stage
The macro automatically executes a SETUP transaction upon reception of a SETUP token addressed to its
own node. Have your firmware monitor a RcvEP0SETUP status and analyze the request referring to the
EP0Setup_0 through EP0Setup_7 registers to control “control transfer”.
If the host has received a request that involves an OUT data stage, clear the INxOUT bit of the EP0Control
register to set the EP0 endpoint direction to OUT.
If the host has received a request that involves an IN data stage, set the INxOUT bit of the EP0Control reg-
ister to set the EP0 endpoint direction to IN.
If the host has received a request that involves no data stage, set the INxOUT bit of the EP0Control register
to set the EP0 endpoint direction to IN in order to transit to a status stage.
Data stage/status stage
Transit to the next stage according to the result of request analysis executed by reading the EP0Setup_0
through EP0Setup_7 registers.
If it is an OUT stage, clear the INxOUT of the EP0Control register to set the direction to OUT and control
the stage by setting the EP0ControlOUT accordingly. When the SETUP stage is completed, the ForceNAK
bit is set.
If it is an IN stage, set the INxOUT of the EP0Control register to set the direction to IN and control the
stage by setting the EP0ControlIN accordingly. When the SETUP stage is completed, the ForceNAK bit is
set.