Struct avr_oxide::devices::serialport::SerialPort
source · pub struct SerialPort<'sp, S>where
S: EventSink,{ /* private fields */ }
Expand description
Encapsulation of a serial port exposing the standard io::Read/io::Write traits. Also generates Oxide event notifications.
Implementations§
source§impl<S> SerialPort<'_, S>where
S: EventSink,
impl<S> SerialPort<'_, S>where
S: EventSink,
sourcepub fn using_port_and_pins(
port: &'static mut dyn SerialRxTx,
tx: &'static dyn Pin,
rx: &'static dyn Pin
) -> Self
pub fn using_port_and_pins( port: &'static mut dyn SerialRxTx, tx: &'static dyn Pin, rx: &'static dyn Pin ) -> Self
Create an instance of SerialPort that will communicate over the given port and pins.
sourcepub fn mode(self, mode: SerialPortMode) -> Self
pub fn mode(self, mode: SerialPortMode) -> Self
Set the serial port comms parameters.
sourcepub fn get_options(&self) -> SerialOptions
pub fn get_options(&self) -> SerialOptions
Get the currently configured transmission options.
sourcepub fn set_options(&mut self, options: SerialOptions)
pub fn set_options(&mut self, options: SerialOptions)
Set the transmission options.
Trait Implementations§
source§impl<S> EventSource for SerialPort<'_, S>where
S: EventSink,
impl<S> EventSource for SerialPort<'_, S>where
S: EventSink,
fn listen(&'static self)
fn process_event(&self, evt: OxideEvent)
source§impl<S> Read for SerialPort<'_, S>where
S: EventSink,
impl<S> Read for SerialPort<'_, S>where
S: EventSink,
source§impl<S> Write for SerialPort<'_, S>where
S: EventSink,
impl<S> Write for SerialPort<'_, S>where
S: EventSink,
source§impl<S> uWrite for SerialPort<'_, S>where
S: EventSink,
impl<S> uWrite for SerialPort<'_, S>where
S: EventSink,
impl<S> Send for SerialPort<'_, S>where
S: EventSink,
impl<S> Sync for SerialPort<'_, S>where
S: EventSink,
Auto Trait Implementations§
impl<'sp, S> !Freeze for SerialPort<'sp, S>
impl<'sp, S> !RefUnwindSafe for SerialPort<'sp, S>
impl<'sp, S> Unpin for SerialPort<'sp, S>where
S: Unpin,
impl<'sp, S> !UnwindSafe for SerialPort<'sp, S>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more