pub struct Usart<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Usart<'a>
impl<'a> Usart<'a>
Sourcepub fn new(usart: &'a UsartInner) -> Self
pub fn new(usart: &'a UsartInner) -> Self
Sourcepub fn set_rx_buf(&self, rx_buffer: &mut [u8])
pub fn set_rx_buf(&self, rx_buffer: &mut [u8])
Sets the receive buffer for the USART.
§Arguments
rx_buffer
- A mutable slice representing the receive buffer.
Sourcepub fn blocking_write(&self, buf: &[u8]) -> i32
pub fn blocking_write(&self, buf: &[u8]) -> i32
Sourcepub fn blocking_read(&self, buffer: &mut [u8])
pub fn blocking_read(&self, buffer: &mut [u8])
Reads into a buffer from the USART in a blocking manner.
§Arguments
buffer
- A mutable slice representing the read buffer.
Trait Implementations§
Source§impl<'d> Read for Usart<'_>
impl<'d> Read for Usart<'_>
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
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§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
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 Write for Usart<'_>
impl Write for Usart<'_>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
Write a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Auto Trait Implementations§
impl<'a> Freeze for Usart<'a>
impl<'a> RefUnwindSafe for Usart<'a>
impl<'a> Send for Usart<'a>
impl<'a> Sync for Usart<'a>
impl<'a> Unpin for Usart<'a>
impl<'a> UnwindSafe for Usart<'a>
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