0
\$\begingroup\$

On reading about usb protocol in http://www.beyondlogic.org/usbnutshell/usb4.shtml It is said that interrupt endpoint is unidirectional and periodic.

Yet, I see in the description for IN interrupt endpoint, that host initiate the IN token and then data packet is send from device to host

"If an interrupt has been queued by the device, the function will send a data packet containing data relevant to the interrupt when it receives the IN Token.".

So, If the data packet is sent on this IN endpoint from device to host, doesn't it mean that the same endpoint is used both the transmit and receive ?

\$\endgroup\$
  • 2
    \$\begingroup\$ There is no contradiction here. There is no USB OUT for interrupt endpoint. USB IN always means into the USB host, device transmits data payload. And the USB host always initiates data transfer regardless of IN (to host) or OUT (from host) direction. \$\endgroup\$ – MarkU Feb 15 '18 at 9:58
  • \$\begingroup\$ Thanks MarkU, I think you can write it as a solution, becuase it answers my question. \$\endgroup\$ – ransh Feb 15 '18 at 10:02
  • 1
    \$\begingroup\$ Not trying to be critical, but you just need to read more about how the various layers of USB work and this will all become clearer. I was going to write an answer, but in the end I realised it would just be a yet another general summary of how USB packets, transactions and pipes work - something for which there are many books/articles online that do a good job already. USB Complete is a good place to start, though the first few chapters of the USB spec are actually not that bad to work through either. \$\endgroup\$ – Jon Feb 15 '18 at 10:12
  • \$\begingroup\$ Thanks, I probably need to read more, that's for sure. Yet, there is something which confused me, in that token and packet are not on the same direction, yet the data is what determines the endpoint direction name as IN/OUT. Anyway, I understood this issue now. \$\endgroup\$ – ransh Feb 15 '18 at 10:18
1
\$\begingroup\$

No, the endpoint number encodes the direction in the top bit. Endpoints 0x01 and 0x81 are distinct, and if you want bidirectional transfers, you need to implement both.

In any case, the host initiates the transfer.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I am not familiar with the 0x01 0x81 numbers. Where can I find more information about it ? \$\endgroup\$ – ransh Feb 15 '18 at 10:01
  • \$\begingroup\$ @ransh, these are examples. Endpoint 0x00 is the control endpoint, all others are optional. If you wanted to have an IN endpoint, you'd give it a number with the top bit set, typically 0x81. I'm not sure why 0x80 is never used. \$\endgroup\$ – Simon Richter Feb 15 '18 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.