A device may have its own power supply, obtain power from the bus, or use power from both sources. A host can request a device to enter the low-power Suspend state, which requires the device to draw no more than 2.5 mA of bus current. Some devices support remote wakeup, which can request to exit the Suspend state. USB 3.0 hosts can place individual functions within a USB 3.0 device in the Suspend state. With host support, devices can use additional, less restrictive low-power states to conserve power and extend battery life.
All of the above tasks support the main job of a device’s USB port, which is to exchange data with the host. For most transfers where the host sends data to the device, the device responds to each transfer attempt by sending a code that indicates whether the device accepted the data or was too busy to accept it. For most transfers where the device sends data to the host, the device must respond to each attempt by returning data or a code indicating the device has no data to send. Typically, the hardware responds according to firmware settings and the error-checking result. Some transfers don’t use acknowledgements, and the sender receives no feedback about whether the receiver accepted transmitted data.
Devices send data only when the host requests data. SuperSpeed devices can send a packet that causes the host to request data from the device.The controller chip’s hardware handles the details of formatting the data for the bus. The formatting includes adding error-checking bits to data to transmit, checking for errors in received data, and sending and receiving the individual
bits on the bus.
Of course, the device must also do whatever other tasks it’s responsible for. For example, a mouse must be ready to detect movement and button clicks, a data-acquisition unit has to read the data from its sensors, and a printer must translate received data into images on paper.




