kernel::bsp::device_driver::bcm::bcm2xxx_pl011_uart

Struct PL011Uart

Source
pub struct PL011Uart {
    inner: NullLock<PL011UartInner>,
}
Expand description

Representation of the UART.

Fields§

§inner: NullLock<PL011UartInner>

Implementations§

Source§

impl PL011Uart

Source

pub const COMPATIBL: &'static str = "BCM PL011 UART"

Source

pub const unsafe fn new(mmio_start_addr: usize) -> Self

Create an instance.

§Safety
  • The user must ensure to provide a correct MMIO start address.

Trait Implementations§

Source§

impl DeviceDriver for PL011Uart

Source§

fn compatible(&self) -> &'static str

Return a compatibility string for identifying the driver.
Source§

unsafe fn init(&self) -> Result<(), &'static str>

Called by the kernel to bring up the device. Read more
Source§

impl Read for PL011Uart

Source§

fn read_char(&self) -> char

Read a single character.
Source§

fn clear_rx(&self)

Clear RX buffers, if any.
Source§

impl Statistics for PL011Uart

Source§

fn chars_written(&self) -> usize

Return the number of character written.
Source§

fn chars_read(&self) -> usize

Return the number of characters read.
Source§

impl Write for PL011Uart

Source§

fn write_char(&self, c: char)

Passthrough of args to the core::fmt::Write implementation, but guarded by a Mutex to serialize access.

Source§

fn write_fmt(&self, args: Arguments<'_>) -> Result

Write a Rust format string.
Source§

fn flush(&self)

Block until the last buffered character has been physically put on the TX wire.
Source§

impl All for PL011Uart

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.