pub struct Pl011Uart { /* private fields */ }
Expand description
The Pl011 Uart
The Pl011 Uart provides a programing interface for:
- Construct a new Pl011 UART instance
- Initialize the Pl011 UART
- Read a char from the UART
- Write a char to the UART
- Handle a UART IRQ
Implementations§
source§impl Pl011Uart
impl Pl011Uart
sourcepub const fn new(base: *mut u8) -> Self
pub const fn new(base: *mut u8) -> Self
Constrcut a new Pl011 UART instance from the base address.
sourcepub fn init(&mut self)
pub fn init(&mut self)
Initializes the Pl011 UART.
It clears all irqs, sets fifo trigger level, enables rx interrupt, enables receives
sourcepub fn getchar(&mut self) -> Option<u8>
pub fn getchar(&mut self) -> Option<u8>
Return a byte if pl011 has received, or it will return None
.
sourcepub fn is_receive_interrupt(&self) -> bool
pub fn is_receive_interrupt(&self) -> bool
Return true if pl011 has received an interrupt
sourcepub fn ack_interrupts(&mut self)
pub fn ack_interrupts(&mut self)
Clear all interrupts
Trait Implementations§
Auto Trait Implementations§
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