pub type EndpointOut<'a, B> = Endpoint<'a, B, Out>;
Expand description
A host-to-device (OUT) endpoint.
Aliased Type§
struct EndpointOut<'a, B> { /* private fields */ }
Implementations
Source§impl<B: UsbBus, D: EndpointDirection> Endpoint<'_, B, D>
impl<B: UsbBus, D: EndpointDirection> Endpoint<'_, B, D>
Sourcepub fn address(&self) -> EndpointAddress
pub fn address(&self) -> EndpointAddress
Gets the endpoint address including direction bit.
Sourcepub fn ep_type(&self) -> EndpointType
pub fn ep_type(&self) -> EndpointType
Gets the endpoint transfer type.
Sourcepub fn max_packet_size(&self) -> u16
pub fn max_packet_size(&self) -> u16
Gets the maximum packet size for the endpoint.
Source§impl<B: UsbBus> Endpoint<'_, B, Out>
impl<B: UsbBus> Endpoint<'_, B, Out>
Sourcepub fn read(&self, data: &mut [u8]) -> Result<usize>
pub fn read(&self, data: &mut [u8]) -> Result<usize>
Reads a single packet of data from the specified endpoint and returns the actual length of
the packet. The buffer should be large enough to fit at least as many bytes as the
max_packet_size
specified when allocating the endpoint.
§Errors
Note: USB bus implementation errors are directly passed through, so be prepared to handle other errors as well.
WouldBlock
- There is no packet to be read. Note that this is different from a received zero-length packet, which is valid and significant in USB. A zero-length packet will returnOk(0)
.BufferOverflow
- The received packet is too long to fit indata
. This is generally an error in the class implementation.