pub struct CdcAcmHost<'d, A: UsbHostAllocator<'d>> { /* private fields */ }Expand description
CDC ACM host driver.
Provides read/write access to a CDC ACM (virtual serial port) USB device.
Implementations§
Source§impl<'d, A: UsbHostAllocator<'d>> CdcAcmHost<'d, A>
impl<'d, A: UsbHostAllocator<'d>> CdcAcmHost<'d, A>
Sourcepub fn new(
alloc: &A,
config_desc: &[u8],
enum_info: &EnumerationInfo,
) -> Result<Self, CdcAcmError>
pub fn new( alloc: &A, config_desc: &[u8], enum_info: &EnumerationInfo, ) -> Result<Self, CdcAcmError>
Create a new CDC ACM host driver.
Parses the config descriptor to find CDC ACM endpoints and allocates channels.
Sourcepub async fn set_line_coding(
&mut self,
coding: &LineCoding,
) -> Result<(), CdcAcmError>
pub async fn set_line_coding( &mut self, coding: &LineCoding, ) -> Result<(), CdcAcmError>
Set the line coding (baud rate, data bits, parity, stop bits).
Sourcepub async fn set_control_line_state(
&mut self,
dtr: bool,
rts: bool,
) -> Result<(), CdcAcmError>
pub async fn set_control_line_state( &mut self, dtr: bool, rts: bool, ) -> Result<(), CdcAcmError>
Set the control line state (DTR, RTS).
Trait Implementations§
Source§impl<'d, A: UsbHostAllocator<'d>> ErrorType for CdcAcmHost<'d, A>
impl<'d, A: UsbHostAllocator<'d>> ErrorType for CdcAcmHost<'d, A>
Source§type Error = CdcAcmError
type Error = CdcAcmError
Error type of all the IO operations on this type.
Source§impl<'d, A: UsbHostAllocator<'d>> Read for CdcAcmHost<'d, A>
impl<'d, A: UsbHostAllocator<'d>> Read for CdcAcmHost<'d, A>
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf. Read moreSource§impl<'d, A: UsbHostAllocator<'d>> Write for CdcAcmHost<'d, A>
impl<'d, A: UsbHostAllocator<'d>> Write for CdcAcmHost<'d, A>
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Auto Trait Implementations§
impl<'d, A> Freeze for CdcAcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Freeze,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, In>: Freeze,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, Out>: Freeze,
impl<'d, A> RefUnwindSafe for CdcAcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: RefUnwindSafe,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, In>: RefUnwindSafe,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, Out>: RefUnwindSafe,
impl<'d, A> Send for CdcAcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Send,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, In>: Send,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, Out>: Send,
impl<'d, A> Sync for CdcAcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Sync,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, In>: Sync,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, Out>: Sync,
impl<'d, A> Unpin for CdcAcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: Unpin,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, In>: Unpin,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, Out>: Unpin,
impl<'d, A> UnwindSafe for CdcAcmHost<'d, A>where
<A as UsbHostAllocator<'d>>::Pipe<Control, InOut>: UnwindSafe,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, In>: UnwindSafe,
<A as UsbHostAllocator<'d>>::Pipe<Bulk, Out>: 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