[][src]Trait avr_hal_generic::usart::UsartOps

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

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

pub fn raw_init<CLOCK>(&mut self, baudrate: Baudrate<CLOCK>)[src]

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.

pub fn raw_deinit(&mut self)[src]

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.

pub fn raw_flush(&mut self) -> Result<(), Void>[src]

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.

pub fn raw_write(&mut self, byte: u8) -> Result<(), Void>[src]

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.

pub fn raw_read(&mut self) -> Result<u8, Void>[src]

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.

pub fn raw_interrupt(&mut self, event: Event, state: bool)[src]

Enable/Disable a certain interrupt.

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

Loading content...

Implementors

Loading content...