title: Details on USB- no luck so far
body: <p>I've been looking for a detailed description for how USB protocol and cabling works for a long time with no luck. I am looking for a detailed yet not overcomplicated explanation of how things work on the software and hardware side of USB. Links and explanations would be appreciated. I've really run out of ideas, so it would be great if you can help me out.</p>
  
  <hr>
  
  <p>This is what I do know:</p>
  
  <p>USB hardware carries 4 lines- 5V power, ground, and 2 full duplex lines.</p>
  
  <p>When connecting, the device can ask for a specified amount of current.</p>
  
  <p>The transfer speeds for USB are quite fast compared to traditional serial connections.</p>
  
  <p>When connecting, a device will output descriptors to the host describing itself. These descriptors will also be used for data.</p>
  
  <hr>
  
  <p>What I don't know:</p>
  
  <p>How does a program in C/C++ write directly to a USB port? Does it write to an address in the port?</p>
  
  <p>How do some devices describe themselves as HID?</p>
  
  <p>How do drivers work?</p>
  
  <p>Everything else...</p>
  
  <hr>
  
  <p>Thank you!</p>