Uart16550

Struct Uart16550 

Source
pub struct Uart16550 {
    serial_port: SpinLock<MmioSerialPort>,
}
Expand description

16550 UART 串行端口驱动程序结构体

Fields§

§serial_port: SpinLock<MmioSerialPort>

Trait Implementations§

Source§

impl Driver for Uart16550

Source§

fn try_handle_interrupt(&self, irq: Option<usize>) -> bool

Source§

fn device_type(&self) -> DeviceType

Source§

fn get_id(&self) -> String

Source§

fn as_serial(&self) -> Option<&dyn SerialDriver>

将驱动程序转换为串口驱动程序(如果适用)
Source§

fn as_net(&self) -> Option<&dyn NetDevice>

将驱动程序转换为网络驱动程序(如果适用)
Source§

fn as_net_arc(self: Arc<Self>) -> Option<Arc<dyn NetDevice>>

将驱动程序转换为网络驱动程序 Arc(如果适用)
Source§

fn as_block(&self) -> Option<&dyn BlockDriver>

将驱动程序转换为块设备驱动程序(如果适用)
Source§

fn as_block_arc(self: Arc<Self>) -> Option<Arc<dyn BlockDriver>>

将驱动程序转换为块设备驱动程序 Arc(如果适用)
Source§

fn as_rtc(&self) -> Option<&dyn RtcDriver>

将驱动程序转换为实时时钟驱动程序(如果适用)
Source§

fn as_rtc_arc(self: Arc<Self>) -> Option<Arc<dyn RtcDriver>>

将驱动程序转换为实时时钟驱动程序 Arc(如果适用)
Source§

impl SerialDriver for Uart16550

Source§

fn read(&self) -> u8

从 tty 读取一个字节
Source§

fn write(&self, data: &[u8])

向 tty 写入数据
Source§

fn try_read(&self) -> Option<u8>

尝试读取一个字节,如果没有数据则返回 None

Auto Trait Implementations§

§

impl !Freeze for Uart16550

§

impl !RefUnwindSafe for Uart16550

§

impl Send for Uart16550

§

impl Sync for Uart16550

§

impl Unpin for Uart16550

§

impl UnwindSafe for Uart16550

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.