English
Language : 

EZ-USB Datasheet, PDF (132/334 Pages) Cypress Semiconductor – The EZ-USB USB Integrated Circuit
Table 7-7. Set Feature-Endpoint (Stall)
Byte
Field
0 bmRequestType
1 bRequest
2 wValueL
3 wValueH
4 wIndexL
5 wIndexH
6 wLengthL
7 wLengthH
Value
Meaning
0x02 OUT, Endpoint
0x03 “Set Feature”
0x00 Feature Selector:
STALL
0x00
EP
0x00
0x00
0x00
8051 Response
Set the STALL bit for the
indicated endpoint:
EP(n):
0x00-0x07: OUT0-OUT7
0x80-0x87: IN0-IN7
The only Set_Feature/Endpoint request presently defined in the USB Specification is to
stall an endpoint. The 8051 should respond to this request by setting the stall bit in the
Control and Status register for the indicated endpoint EP (byte 4 of the request). The 8051
can either stall an endpoint on its own, or in response to the device request. Endpoint
stalls are cleared by the host Clear_Feature/Stall request.
The 8051 should respond to the Set_Feature/Stall request by performing the following
steps:
1. Set the stall bit in the indicated endpoint’s CS register.
2. Reset the data toggle for the indicated endpoint.
3. For an IN endpoint, clear the busy bit in the indicated endpoint’s CS register.
4. For an OUT endpoint, load any value into the endpoint’s byte count register.
5. Clear the HSNAK bit in the EP0CS register (by writing 1 to it) to terminate the
Set_Feature/Stall CONTROL transfer.
Steps 3 and 4 restore the stalled endpoint to its default condition, ready to send or accept
data after the stall condition is removed by the host (using a Clear_Feature/Stall request).
These steps are also required when the host sends a Set_Interface request.
Data Toggles
The EZ-USB core automatically maintains the endpoint toggle bits to ensure data integ-
rity for USB transfers. The 8051 should directly manipulate these bits only for a very
limited set of circumstances:
• Set_Feature/Stall
• Set_Configuration
• Set_Interface
EZ-USB TRM v1.9
Chapter 7. EZ-USB CPU
Page 7-11