Skip to main content

UsartWriter

Struct UsartWriter 

Source
pub struct UsartWriter<H, USART: UsartOps<H, RX, TX>, RX, TX, CLOCK> { /* private fields */ }
Expand description

Writer half of a Usart peripheral.

Created by calling Usart::split. Splitting a peripheral into reader and writer allows concurrently receiving and transmitting data from different contexts.

The writer half most notably implements embedded_hal_v0::serial::Write and ufmt::uWrite for transmitting data.

Implementations§

Source§

impl<H, USART: UsartOps<H, RX, TX>, RX, TX, CLOCK> UsartWriter<H, USART, RX, TX, CLOCK>

Source

pub fn reunite( self, other: UsartReader<H, USART, RX, TX, CLOCK>, ) -> Usart<H, USART, RX, TX, CLOCK>

Merge this UsartWriter with a UsartReader back into a single Usart peripheral.

Trait Implementations§

Source§

impl<H, USART: UsartOps<H, RX, TX>, RX, TX, CLOCK> Write<u8> for UsartWriter<H, USART, RX, TX, CLOCK>

Source§

type Error = !

Write error
Source§

fn write(&mut self, byte: u8) -> Result<(), Self::Error>

Writes a single word to the serial interface
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Ensures that none of the previously written words are still buffered
Source§

impl<H, USART: UsartOps<H, RX, TX>, RX, TX, CLOCK> uWrite for UsartWriter<H, USART, RX, TX, CLOCK>

Source§

type Error = !

The error associated to this writer
Source§

fn write_str(&mut self, s: &str) -> Result<(), Self::Error>

Writes a string slice into this writer, returning whether the write succeeded. Read more
Source§

fn write_char(&mut self, c: char) -> Result<(), Self::Error>

Writes a char into this writer, returning whether the write succeeded. Read more

Auto Trait Implementations§

§

impl<H, USART, RX, TX, CLOCK> Freeze for UsartWriter<H, USART, RX, TX, CLOCK>
where USART: Freeze, TX: Freeze, PhantomData<RX>: Freeze, PhantomData<CLOCK>: Freeze, PhantomData<H>: Freeze,

§

impl<H, USART, RX, TX, CLOCK> RefUnwindSafe for UsartWriter<H, USART, RX, TX, CLOCK>

§

impl<H, USART, RX, TX, CLOCK> Send for UsartWriter<H, USART, RX, TX, CLOCK>
where USART: Send, TX: Send, PhantomData<RX>: Send, PhantomData<CLOCK>: Send, PhantomData<H>: Send,

§

impl<H, USART, RX, TX, CLOCK> Sync for UsartWriter<H, USART, RX, TX, CLOCK>
where USART: Sync, TX: Sync, PhantomData<RX>: Sync, PhantomData<CLOCK>: Sync, PhantomData<H>: Sync,

§

impl<H, USART, RX, TX, CLOCK> Unpin for UsartWriter<H, USART, RX, TX, CLOCK>
where USART: Unpin, TX: Unpin, PhantomData<RX>: Unpin, PhantomData<CLOCK>: Unpin, PhantomData<H>: Unpin,

§

impl<H, USART, RX, TX, CLOCK> UnsafeUnpin for UsartWriter<H, USART, RX, TX, CLOCK>

§

impl<H, USART, RX, TX, CLOCK> UnwindSafe for UsartWriter<H, USART, RX, TX, CLOCK>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.