Trait avr_oxide::hal::generic::serial::SerialRxTx

source ·
pub trait SerialRxTx {
    // Required methods
    fn set_mode(&mut self, mode: SerialPortMode);
    fn set_enable_rxtx(&mut self, enable: bool);
    fn set_write_complete_callback(&self, handler: SerialWriteEventCallback);
    fn set_error_callback(&self, handler: SerialErrorEventCallback);
    fn set_read_callback(&self, handler: SerialReadEventCallback);
    fn write_u8(&mut self, byte: u8);
    fn flush(&mut self);
    fn read_u8(&mut self) -> u8;
    fn try_read_u8(&mut self) -> Option<u8>;
}

Required Methods§

source

fn set_mode(&mut self, mode: SerialPortMode)

Configure the serial port with the given mode

source

fn set_enable_rxtx(&mut self, enable: bool)

Enable or disable the receiver & transmitter

source

fn set_write_complete_callback(&self, handler: SerialWriteEventCallback)

Set the callback handler for write notifications

source

fn set_error_callback(&self, handler: SerialErrorEventCallback)

Set the callback handler for error

source

fn set_read_callback(&self, handler: SerialReadEventCallback)

Set the callback handler for read notifications

source

fn write_u8(&mut self, byte: u8)

source

fn flush(&mut self)

source

fn read_u8(&mut self) -> u8

source

fn try_read_u8(&mut self) -> Option<u8>

Read a byte from the serial port. If no byte is available, return None instead.

Implementors§