pub struct Pl011 { /* private fields */ }
Implementations§
Source§impl Pl011
impl Pl011
Sourcepub async fn new(base: NonNull<u8>, config: Option<Config>) -> Self
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;
}
Sourcepub fn new_sync(base: NonNull<u8>, config: Option<Config>) -> Self
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());
}
pub async fn set_config(&mut self, config: Option<Config>)
pub fn set_config_sync(&mut self, config: Option<Config>)
pub fn set_tx_fifo_threadhold(&mut self, threshold: Threshold)
pub fn set_rx_fifo_threadhold(&mut self, threshold: Threshold)
pub fn write_imsc(&mut self, mask: IMSC)
pub fn read_ris(&self) -> RIS
pub fn read_mis(&self) -> MIS
pub fn write_icr(&mut self, mask: RIS)
Trait Implementations§
Source§impl Read for Pl011
impl Read for Pl011
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
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>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read moreSource§impl Read for Pl011
impl Read for Pl011
Source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
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>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read moreSource§impl Write for Pl011
impl Write for Pl011
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
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>
fn flush(&mut self) -> Result<(), Self::Error>
Flush this output stream, blocking until all intermediately buffered contents reach their destination.
Source§impl Write for Pl011
impl Write for Pl011
Source§async fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error>
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
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> 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