pub struct SerialPortComponent { /* private fields */ }
Expand description
Component interface used to instantiate a SerialPort
Implementations§
Source§impl SerialPortComponent
impl SerialPortComponent
Sourcepub unsafe fn new(base: u16) -> Self
pub unsafe fn new(base: u16) -> Self
Constructs and returns a new instance of SerialPortComponent
.
§Safety
An 8250-compatible serial port must exist at the specified address. Otherwise we could end up spamming some unknown device with I/O operations.
The specified serial port must not be in use by any other instance of SerialPort
or any
other code.
Trait Implementations§
Source§impl Component for SerialPortComponent
impl Component for SerialPortComponent
Source§type StaticInput = (&'static mut MaybeUninit<SerialPort<'static>>,)
type StaticInput = (&'static mut MaybeUninit<SerialPort<'static>>,)
An optional type to specify the chip or board specific static memory
that a component needs to setup the output object(s). This is the memory
that
crate::static_buf!()
would normally setup, but generic
components cannot setup static buffers for types which are
chip-dependent, so those buffers have to be passed in manually, and the
Component::StaticInput
type makes this possible.Source§type Output = &'static SerialPort<'static>
type Output = &'static SerialPort<'static>
The type (e.g., capsule, peripheral) that this implementation of
Component
produces via Component::finalize()
. This is typically
a static reference (&'static
).Source§fn finalize(self, s: Self::StaticInput) -> Self::Output
fn finalize(self, s: Self::StaticInput) -> Self::Output
Auto Trait Implementations§
impl Freeze for SerialPortComponent
impl RefUnwindSafe for SerialPortComponent
impl Send for SerialPortComponent
impl Sync for SerialPortComponent
impl Unpin for SerialPortComponent
impl UnwindSafe for SerialPortComponent
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