pub struct CdcAcmHost<D: UsbHostDriver> { /* 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: UsbHostDriver> CdcAcmHost<D>
impl<D: UsbHostDriver> CdcAcmHost<D>
Sourcepub fn new(
driver: &D,
config_desc: &[u8],
device_address: u8,
max_packet_size_0: u16,
) -> Result<Self, CdcAcmError>
pub fn new( driver: &D, config_desc: &[u8], device_address: u8, max_packet_size_0: u16, ) -> 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: UsbHostDriver> ErrorType for CdcAcmHost<D>
impl<D: UsbHostDriver> ErrorType for CdcAcmHost<D>
Source§type Error = CdcAcmError
type Error = CdcAcmError
Error type of all the IO operations on this type.
Source§impl<D: UsbHostDriver> Read for CdcAcmHost<D>
impl<D: UsbHostDriver> Read for CdcAcmHost<D>
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: UsbHostDriver> Write for CdcAcmHost<D>
impl<D: UsbHostDriver> Write for CdcAcmHost<D>
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> Freeze for CdcAcmHost<D>where
<D as UsbHostDriver>::Channel<Control, InOut>: Freeze,
<D as UsbHostDriver>::Channel<Bulk, In>: Freeze,
<D as UsbHostDriver>::Channel<Bulk, Out>: Freeze,
impl<D> RefUnwindSafe for CdcAcmHost<D>where
<D as UsbHostDriver>::Channel<Control, InOut>: RefUnwindSafe,
<D as UsbHostDriver>::Channel<Bulk, In>: RefUnwindSafe,
<D as UsbHostDriver>::Channel<Bulk, Out>: RefUnwindSafe,
impl<D> Send for CdcAcmHost<D>where
<D as UsbHostDriver>::Channel<Control, InOut>: Send,
<D as UsbHostDriver>::Channel<Bulk, In>: Send,
<D as UsbHostDriver>::Channel<Bulk, Out>: Send,
impl<D> Sync for CdcAcmHost<D>where
<D as UsbHostDriver>::Channel<Control, InOut>: Sync,
<D as UsbHostDriver>::Channel<Bulk, In>: Sync,
<D as UsbHostDriver>::Channel<Bulk, Out>: Sync,
impl<D> Unpin for CdcAcmHost<D>where
<D as UsbHostDriver>::Channel<Control, InOut>: Unpin,
<D as UsbHostDriver>::Channel<Bulk, In>: Unpin,
<D as UsbHostDriver>::Channel<Bulk, Out>: Unpin,
impl<D> UnwindSafe for CdcAcmHost<D>where
<D as UsbHostDriver>::Channel<Control, InOut>: UnwindSafe,
<D as UsbHostDriver>::Channel<Bulk, In>: UnwindSafe,
<D as UsbHostDriver>::Channel<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