pub struct EcmHost<'d, A: UsbHostAllocator<'d>> { /* private fields */ }Expand description
CDC-ECM USB host driver.
Implementations§
Source§impl<'d, A: UsbHostAllocator<'d>> EcmHost<'d, A>
impl<'d, A: UsbHostAllocator<'d>> EcmHost<'d, A>
Source§impl<'d, A: UsbHostAllocator<'d>> EcmHost<'d, A>
impl<'d, A: UsbHostAllocator<'d>> EcmHost<'d, A>
Sourcepub fn new(
alloc: &A,
enum_info: &EnumerationInfo,
config_desc: &[u8],
) -> Result<Self, EcmError>
pub fn new( alloc: &A, enum_info: &EnumerationInfo, config_desc: &[u8], ) -> Result<Self, EcmError>
Create and initialize a new CDC-ECM host driver.
Sourcepub async fn enable(&mut self) -> Result<(), EcmError>
pub async fn enable(&mut self) -> Result<(), EcmError>
Enable the network interface: selects the active data alternate setting and configures packet filters (directed + broadcast + multicast).
Sourcepub async fn read_packet(&mut self, buf: &mut [u8]) -> Result<usize, EcmError>
pub async fn read_packet(&mut self, buf: &mut [u8]) -> Result<usize, EcmError>
Read an incoming Ethernet frame.
Sourcepub async fn write_packet(&mut self, data: &[u8]) -> Result<(), EcmError>
pub async fn write_packet(&mut self, data: &[u8]) -> Result<(), EcmError>
Send an outgoing Ethernet frame.
Sourcepub async fn poll_notification(
&mut self,
buf: &mut [u8],
) -> Result<usize, EcmError>
pub async fn poll_notification( &mut self, buf: &mut [u8], ) -> Result<usize, EcmError>
Poll for an interrupt notification packet.
Sourcepub fn split(self) -> (EcmHostSender<'d, A>, EcmHostReceiver<'d, A>)
pub fn split(self) -> (EcmHostSender<'d, A>, EcmHostReceiver<'d, A>)
Split into independent sender and receiver halves.
Auto Trait Implementations§
impl<'d, A> Forget for EcmHost<'d, A>
impl<'d, A> Freeze for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Freeze,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: Freeze,
EcmHostSender<'d, A>: Freeze,
EcmHostReceiver<'d, A>: Freeze,
impl<'d, A> Move for EcmHost<'d, A>
impl<'d, A> RefUnwindSafe for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: RefUnwindSafe,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: RefUnwindSafe,
EcmHostSender<'d, A>: RefUnwindSafe,
EcmHostReceiver<'d, A>: RefUnwindSafe,
impl<'d, A> Send for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Send,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: Send,
EcmHostSender<'d, A>: Send,
EcmHostReceiver<'d, A>: Send,
impl<'d, A> Sync for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Sync,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: Sync,
EcmHostSender<'d, A>: Sync,
EcmHostReceiver<'d, A>: Sync,
impl<'d, A> Unpin for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Unpin,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: Unpin,
EcmHostSender<'d, A>: Unpin,
EcmHostReceiver<'d, A>: Unpin,
impl<'d, A> UnsafeUnpin for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: UnsafeUnpin,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: UnsafeUnpin,
EcmHostSender<'d, A>: UnsafeUnpin,
EcmHostReceiver<'d, A>: UnsafeUnpin,
impl<'d, A> UnwindSafe for EcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: UnwindSafe,
<A as UsbHostAllocator<'d>>::Pipe<Interrupt, In>: UnwindSafe,
EcmHostSender<'d, A>: UnwindSafe,
EcmHostReceiver<'d, A>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more