??? 01/26/06 21:57 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#108436 - Control IN and Control OUT transfer Responding to: ???'s previous message |
Ummm... I should explain this first.
Standard device request issued by SetUp is divided into two categories as follows. Control IN transfer - GET_CONFIGURATION - GET_DESCRIPTOR - GET_INTERFACE - GET_STATUS - SYNCH-FRAME Control OUT transfer (including no data stage request) - CLEAR_FEATURE (no data stage) - SET_ADDRESS (no data stage) - SET_CONFIGURATION (no data stage) - SET_DESCRIPTOR - SET_FEATURE (no data stage) - SET_INTERFACE (no data stage) As you can see, GET_xxx belongs to Control IN and SET_xxx to Control OUT, naturally. At the end of Control IN transfer, the device must return ZLP when - The number of bytes to return is just the multiple of bMaxPacketSize AND - The number of bytes to return is shorter than requested in wLength field on the SetUp command. This ZLP corresponds to the end of data stage of the control IN transfer, At the end of Control OUT transfer, the device must always return ZLP. This ZLP corresponds to the status stage of the control OUT transfer, As GET_DESCRIPTOR belongs to Control IN transfer, firmware returns ZLP in limited condition. As SET_ADDRESS belongs to Control OUT transfer, firmware always returns ZLP. The sequence to handle SET_ADDRESS is - 'Set Address/Enable' command + address (enabled(bit7) + wValue of SET_ADDRESS) - send ZLP to Control IN EP. Tsuneo |