arm_pl011_rs

Struct Pl011

Source
pub struct Pl011 { /* private fields */ }

Implementations§

Source§

impl Pl011

Source

pub async fn new(base: NonNull<u8>, config: Option<Config>) -> Self

Examples found in repository?
examples/async_api.rs (lines 7-16)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pub async fn write() {
    let mut uart = Pl011::new(
        NonNull::new(0x0900_0000 as *mut u8).unwrap(),
        Some(Config {
            baud_rate: 115200,
            clock_freq: 24000000,
            data_bits: DataBits::Bits8,
            stop_bits: StopBits::STOP1,
            parity: Parity::None,
        }),
    )
    .await;

    uart.write_all("uart output\n".as_bytes()).await;
}
Source

pub fn new_sync(base: NonNull<u8>, config: Option<Config>) -> Self

Examples found in repository?
examples/sync_api.rs (lines 7-16)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pub fn write() {
    let mut uart = Pl011::new_sync(
        NonNull::new(0x0900_0000 as *mut u8).unwrap(),
        Some(Config {
            baud_rate: 115200,
            clock_freq: 24000000,
            data_bits: DataBits::Bits8,
            stop_bits: StopBits::STOP1,
            parity: Parity::None,
        }),
    );

    uart.write_all("uart output\n".as_bytes());
}
Source

pub async fn set_config(&mut self, config: Option<Config>)

Source

pub fn set_config_sync(&mut self, config: Option<Config>)

Source

pub fn set_tx_fifo_threadhold(&mut self, threshold: Threshold)

Source

pub fn set_rx_fifo_threadhold(&mut self, threshold: Threshold)

Source

pub fn write_imsc(&mut self, mask: IMSC)

Source

pub fn read_ris(&self) -> RIS

Source

pub fn read_mis(&self) -> MIS

Source

pub fn write_icr(&mut self, mask: RIS)

Trait Implementations§

Source§

impl ErrorType for Pl011

Source§

type Error = ErrorKind

Error type of all the IO operations on this type.
Source§

impl Read for Pl011

Source§

fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>

Read the exact number of bytes required to fill buf. Read more
Source§

impl Read for Pl011

Source§

async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>

Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§

async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>

Read the exact number of bytes required to fill buf. Read more
Source§

impl Write for Pl011

Source§

fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>

Write a buffer into this writer, returning how many bytes were written. Read more
Source§

fn flush(&mut self) -> Result<(), Self::Error>

Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write an entire buffer into this writer. Read more
Source§

fn write_fmt( &mut self, fmt: Arguments<'_>, ) -> Result<(), WriteFmtError<Self::Error>>

Write a formatted string into this writer, returning any error encountered. Read more
Source§

impl Write for Pl011

Source§

async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>

Write a buffer into this writer, returning how many bytes were written. Read more
Source§

async fn flush(&mut self) -> Result<(), Self::Error>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Source§

async fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>

Write an entire buffer into this writer. Read more

Auto Trait Implementations§

§

impl Freeze for Pl011

§

impl RefUnwindSafe for Pl011

§

impl Send for Pl011

§

impl Sync for Pl011

§

impl Unpin for Pl011

§

impl UnwindSafe for Pl011

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.