pub trait UsartOps<H, RX, TX> {
    // Required methods
    fn raw_init<CLOCK>(&mut self, baudrate: Baudrate<CLOCK>);
    fn raw_deinit(&mut self);
    fn raw_flush(&mut self) -> Result<(), Infallible>;
    fn raw_write(&mut self, byte: u8) -> Result<(), Infallible>;
    fn raw_read(&mut self) -> Result<u8, Infallible>;
    fn raw_interrupt(&mut self, event: Event, state: bool);
}
Expand description

Internal trait for low-level USART peripherals.

This trait defines the common interface for all USART peripheral variants. It is used as an intermediate abstraction ontop of which the Usart API is built. Prefer using the Usart API instead of this trait.

Required Methods§

source

fn raw_init<CLOCK>(&mut self, baudrate: Baudrate<CLOCK>)

Enable & initialize this USART peripheral to the given baudrate.

Warning: This is a low-level method and should not be called directly from user code.

source

fn raw_deinit(&mut self)

Disable this USART peripheral such that the pins can be used for other purposes again.

Warning: This is a low-level method and should not be called directly from user code.

source

fn raw_flush(&mut self) -> Result<(), Infallible>

Flush all remaining data in the TX buffer.

This operation must be non-blocking and return nb::Error::WouldBlock if not all data was flushed yet.

Warning: This is a low-level method and should not be called directly from user code.

source

fn raw_write(&mut self, byte: u8) -> Result<(), Infallible>

Write a byte to the TX buffer.

This operation must be non-blocking and return nb::Error::WouldBlock until the byte is enqueued. The operation should not wait for the byte to have actually been sent.

Warning: This is a low-level method and should not be called directly from user code.

source

fn raw_read(&mut self) -> Result<u8, Infallible>

Read a byte from the RX buffer.

This operation must be non-blocking and return nb::Error::WouldBlock if no incoming byte is available.

Warning: This is a low-level method and should not be called directly from user code.

source

fn raw_interrupt(&mut self, event: Event, state: bool)

Enable/Disable a certain interrupt.

Warning: This is a low-level method and should not be called directly from user code.

Object Safety§

This trait is not object safe.

Implementors§