#[non_exhaustive]pub enum UsbError {
Stall,
Timeout,
Overflow,
BitStuffError,
CrcError,
DataSeqError,
BufferTooSmall,
AllPipesInUse,
ProtocolError,
TooManyDevices,
NoSuchEndpoint,
}Expand description
Errors reported from a USB operation
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Stall
The device has stalled the endpoint
See USB 2.0 section 8.5.2 and 8.5.3.4, and, for a prolific user of stall conditions, the USB Mass Storage Bulk-Only Transport section 6.
Timeout
The USB transaction has timed out
A NAK response is automatically retried, but if NAKs persist, eventually the transfer will time out.
Overflow
The input FIFO overflowed
This error, produced by the USB host-controller hardware, probably represents a bug in cotton-usb-host (or perhaps a failure to service interrupts quickly enough).
BitStuffError
The USB hardware experienced a bit-stuffing error
CrcError
The USB hardware experienced a CRC error
DataSeqError
The USB hardware received a DATA1 packet when expecting DATA0, or vice versa
This probably indicates a bug in cotton-usb-host (which is intended to take care of the data toggle without client code needing to intervene).
BufferTooSmall
A buffer supplied to cotton-usb-host was too small for the intended data
AllPipesInUse
A USB transaction was attempted when all hardware resources were in use
This error is returned from
HostController::try_alloc_interrupt_pipe() when all
interrupt-capable pipes are already in use. Users of
UsbBus::interrupt_endpoint_in()
do not experience this error, as that call will wait for the
next pipe to be available.
ProtocolError
The device has reacted in a way contrary to the expected protocol
TooManyDevices
The limit of attached USB devices has been reached
NoSuchEndpoint
UsbDevice::open_in_endpoint() was called with a bogus endpoint number