pub type EndpointIn<'a, B> = Endpoint<'a, B, In>;
Expand description
A device-to-host (IN) endpoint.
Aliased Type§
struct EndpointIn<'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, In>
impl<B: UsbBus> Endpoint<'_, B, In>
Sourcepub fn write(&self, data: &[u8]) -> Result<usize>
pub fn write(&self, data: &[u8]) -> Result<usize>
Writes a single packet of data to the specified endpoint and returns number of bytes
actually written. The buffer must not be longer than 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
- The transmission buffer of the USB peripheral is full and the packet cannot be sent now. A peripheral may or may not support concurrent transmission of packets.BufferOverflow
- The data is longer than themax_packet_size
specified when allocating the endpoint. This is generally an error in the class implementation.