Struct embedded_c_sdk_bind_hal::usart::Usart
source · 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)