pub struct BufferedUarteTx<'d> { /* private fields */ }Expand description
Writer part of the buffered UARTE driver.
Implementations§
Source§impl<'d> BufferedUarteTx<'d>
impl<'d> BufferedUarteTx<'d>
Sourcepub fn new<U: UarteInstance>(
uarte: Peri<'d, U>,
txd: Peri<'d, impl GpioPin>,
_irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd,
tx_buffer: &'d mut [u8],
config: Config,
) -> Self
pub fn new<U: UarteInstance>( uarte: Peri<'d, U>, txd: Peri<'d, impl GpioPin>, _irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd, tx_buffer: &'d mut [u8], config: Config, ) -> Self
Create a new BufferedUarteTx without hardware flow control.
Sourcepub fn new_with_cts<U: UarteInstance>(
uarte: Peri<'d, U>,
txd: Peri<'d, impl GpioPin>,
cts: Peri<'d, impl GpioPin>,
_irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd,
tx_buffer: &'d mut [u8],
config: Config,
) -> Self
pub fn new_with_cts<U: UarteInstance>( uarte: Peri<'d, U>, txd: Peri<'d, impl GpioPin>, cts: Peri<'d, impl GpioPin>, _irq: impl Binding<U::Interrupt, InterruptHandler<U>> + 'd, tx_buffer: &'d mut [u8], config: Config, ) -> Self
Create a new BufferedUarteTx with hardware flow control (CTS)
Sourcepub fn write<'a>(
&'a mut self,
buf: &'a [u8],
) -> impl Future<Output = Result<usize, Error>> + 'a + use<'a, 'd>
pub fn write<'a>( &'a mut self, buf: &'a [u8], ) -> impl Future<Output = Result<usize, Error>> + 'a + use<'a, 'd>
Write a buffer into this writer, returning how many bytes were written.
Sourcepub fn try_write(&mut self, buf: &[u8]) -> Result<usize, Error>
pub fn try_write(&mut self, buf: &[u8]) -> Result<usize, Error>
Try writing a buffer without waiting, returning how many bytes were written.
Sourcepub fn flush(&mut self) -> impl Future<Output = Result<(), Error>> + '_
pub fn flush(&mut self) -> impl Future<Output = Result<(), Error>> + '_
Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Sourcepub fn set_baudrate(&mut self, baudrate: Baudrate)
pub fn set_baudrate(&mut self, baudrate: Baudrate)
Adjust the baud rate to the provided value.
Trait Implementations§
Source§impl<'a> Drop for BufferedUarteTx<'a>
impl<'a> Drop for BufferedUarteTx<'a>
Source§impl<'d> ErrorType for BufferedUarteTx<'d>
impl<'d> ErrorType for BufferedUarteTx<'d>
Source§impl<'d> Write for BufferedUarteTx<'d>
impl<'d> Write for BufferedUarteTx<'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> !RefUnwindSafe for BufferedUarteTx<'d>
impl<'d> !UnwindSafe for BufferedUarteTx<'d>
impl<'d> Freeze for BufferedUarteTx<'d>
impl<'d> Send for BufferedUarteTx<'d>
impl<'d> Sync for BufferedUarteTx<'d>
impl<'d> Unpin for BufferedUarteTx<'d>
impl<'d> UnsafeUnpin for BufferedUarteTx<'d>
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