Trait atmega_hal::usart::UsartOps
source · 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
Required Methods§
sourcefn raw_init<CLOCK>(&mut self, baudrate: Baudrate<CLOCK>)
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.
sourcefn raw_deinit(&mut self)
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.
sourcefn raw_flush(&mut self) -> Result<(), Error<Infallible>>
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.
sourcefn raw_write(&mut self, byte: u8) -> Result<(), Error<Infallible>>
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.
sourcefn raw_read(&mut self) -> Result<u8, Error<Infallible>>
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.
sourcefn raw_interrupt(&mut self, event: Event, state: bool)
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.