Skip to main content

Endpoint

Struct Endpoint 

Source
pub struct Endpoint<'d, T, D, const SIZE: usize> { /* private fields */ }
Expand description

USB endpoint.

Trait Implementations§

Source§

impl<'d, T: Instance, D: Dir, const SIZE: usize> Endpoint for Endpoint<'d, T, D, SIZE>

Source§

fn info(&self) -> &EndpointInfo

Get the endpoint address
Source§

async fn wait_enabled(&mut self)

Wait for the endpoint to be enabled.
Source§

fn set_stall(&mut self, stalled: bool) -> Result<(), Unsupported>

Set or clear the STALL handshake on this endpoint. Read more
Source§

fn is_stalled(&self) -> Result<bool, Unsupported>

Get whether the STALL handshake is set on this endpoint. Read more
Source§

impl<'d, T: Instance, const SIZE: usize> EndpointIn for Endpoint<'d, T, In, SIZE>

Source§

async fn write(&mut self, buf: &[u8]) -> Result<(), EndpointError>

Write a single packet of data to the endpoint.
§

async fn write_transfer( &mut self, buf: &[u8], needs_zlp: bool, ) -> Result<(), EndpointError>

Write all the data from buf to the endpoint one wMaxPacketSize chunk at a time. Read more
Source§

impl<'d, T: Instance, const SIZE: usize> EndpointOut for Endpoint<'d, T, Out, SIZE>

Source§

async fn read(&mut self, buf: &mut [u8]) -> Result<usize, EndpointError>

Read a single packet of data from the endpoint, and return the actual length of the packet. Read more
§

async fn read_transfer( &mut self, buf: &mut [u8], ) -> Result<usize, EndpointError>

Read until the buffer is full or we receive a short packet from the USB host returning the actual length of the entire data block. Read more

Auto Trait Implementations§

§

impl<'d, T, D, const SIZE: usize> !UnwindSafe for Endpoint<'d, T, D, SIZE>

§

impl<'d, T, D, const SIZE: usize> Freeze for Endpoint<'d, T, D, SIZE>

§

impl<'d, T, D, const SIZE: usize> RefUnwindSafe for Endpoint<'d, T, D, SIZE>
where T: RefUnwindSafe, D: RefUnwindSafe,

§

impl<'d, T, D, const SIZE: usize> Send for Endpoint<'d, T, D, SIZE>
where T: Send, D: Send,

§

impl<'d, T, D, const SIZE: usize> Sync for Endpoint<'d, T, D, SIZE>
where T: Sync, D: Sync,

§

impl<'d, T, D, const SIZE: usize> Unpin for Endpoint<'d, T, D, SIZE>

§

impl<'d, T, D, const SIZE: usize> UnsafeUnpin for Endpoint<'d, T, D, SIZE>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.