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<(), Error<Infallible>>;
    fn raw_write(&mut self, byte: u8) -> Result<(), Error<Infallible>>;
    fn raw_read(&mut self) -> Result<u8, Error<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<(), Error<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<(), Error<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, Error<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.

Implementations on Foreign Types§

source§

impl UsartOps<Atmega, Pin<Input, PD0>, Pin<Output, PD1>> for USART0

source§

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

source§

fn raw_deinit(&mut self)

source§

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

source§

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

source§

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

source§

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

Implementors§