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§
sourcefn set_mode(&mut self, mode: SerialPortMode)
fn set_mode(&mut self, mode: SerialPortMode)
Configure the serial port with the given mode
sourcefn set_enable_rxtx(&mut self, enable: bool)
fn set_enable_rxtx(&mut self, enable: bool)
Enable or disable the receiver & transmitter
sourcefn set_write_complete_callback(&self, handler: SerialWriteEventCallback)
fn set_write_complete_callback(&self, handler: SerialWriteEventCallback)
Set the callback handler for write notifications
sourcefn set_error_callback(&self, handler: SerialErrorEventCallback)
fn set_error_callback(&self, handler: SerialErrorEventCallback)
Set the callback handler for error
sourcefn set_read_callback(&self, handler: SerialReadEventCallback)
fn set_read_callback(&self, handler: SerialReadEventCallback)
Set the callback handler for read notifications
fn write_u8(&mut self, byte: u8)
fn flush(&mut self)
fn read_u8(&mut self) -> u8
sourcefn try_read_u8(&mut self) -> Option<u8>
fn try_read_u8(&mut self) -> Option<u8>
Read a byte from the serial port. If no byte is available, return None instead.