pub trait UsartOps<H, RX, TX> {
    fn raw_init<CLOCK>(&mut self, baudrate: Baudrate<CLOCK>);
    fn raw_deinit(&mut self);
    fn raw_flush(&mut self) -> Result<(), Void>;
    fn raw_write(&mut self, byte: u8) -> Result<(), Void>;
    fn raw_read(&mut self) -> Result<u8, Void>;
    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

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.

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.

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.

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.

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.

Enable/Disable a certain interrupt.

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

Implementors