English
Language : 

UM0463 Datasheet, PDF (9/30 Pages) STMicroelectronics – ST7 full-speed USB library
UM0463
The USB state machine of the control endpoint
3
The USB state machine of the control endpoint
3.1
The states
The USB state machine implemented in the library is used to handle the requests on the
control endpoint only. The state machine does not process any transactions of noncontrol
endpoints.
The USB state machine is designed to execute the SETUP requests. A SETUP request
consists of three stages: SETUP stage, data stage and status stage. The states of the state
machine are designed to match these three stages.
Table 4. States of USB state machine
State
Meaning
Wait_Setup The state machine is in idle.
In_Data
The state machine is in data IN stage and is waiting for an IN data packet.
Out_Data The state machine is in data OUT stage and is waiting to send an OUT data packet.
One_More_In
The state machine is in data IN stage and is waiting for a zero-length IN data packet when the
length of the data stream in the data stage is multiple of the maximum packet size of the
endpoint.
The state machine is in data OUT stage and is waiting for sending a zero-length OUT data
One_More_Out packet when the length of the data stream in the data stage is a multiple of the maximum packet
size of the endpoint.
Wait_Status_In
The state machine is waiting for a status IN stage after the data OUT stage is finished, or after
the SETUP stage if there is no data stage.
Wait_Status_Out The state machine is waiting for a status OUT stage after the data IN stage is finished.
Address2Set This is a special state to identify the process of a Set Address request.
State_Error An error is detected, such as an invalid request.
Figure 1. States evaluation
Wait_Setup
SETUP
In_Data
IN
IN
.....
IN
OUT
Wait_Setup
SETUP
SETUP
IN
Wait_Status_In
Wait_Status_Out
OUT
OUT .....
Out_Data
OUT
IN
Wait_Setup
9/30