pub struct Pl011 { /* private fields */ }Expand description
PL011 UART 驱动结构体
Implementations§
Source§impl Pl011
impl Pl011
Sourcepub fn new_no_clock(base: NonNull<u8>) -> Self
pub fn new_no_clock(base: NonNull<u8>) -> Self
pub fn new(base: NonNull<u8>, clock_freq: u32) -> Self
pub fn set_irq_mask(&mut self, events: SerialEventSet)
pub fn get_irq_mask(&self) -> SerialEventSet
pub fn pending(&mut self, direction: SerialDirection) -> bool
pub fn poll_status(&mut self) -> SerialEvent
pub fn try_write(&mut self, bytes: &[u8]) -> usize
pub fn try_read(&mut self, bytes: &mut [u8]) -> Result<usize, TransBytesError>
pub fn write_byte(&mut self, byte: u8)
pub fn read_byte( &mut self, status: SerialEvent, ) -> Option<Result<u8, TransferError>>
pub fn read_rx(&mut self) -> Option<RxSample>
Source§impl Pl011
impl Pl011
Sourcepub fn enable_fifo(&self, enable: bool)
pub fn enable_fifo(&self, enable: bool)
启用或禁用 FIFO
Sourcepub fn set_fifo_trigger_level(&self, rx_level: u8, tx_level: u8)
pub fn set_fifo_trigger_level(&self, rx_level: u8, tx_level: u8)
设置 FIFO 触发级别
Trait Implementations§
Source§impl PollingUart for Pl011
impl PollingUart for Pl011
fn poll_status(&mut self) -> SerialEvent
fn write_byte(&mut self, byte: u8)
fn read_byte( &mut self, status: SerialEvent, ) -> Option<Result<u8, TransferError>>
Source§impl UartPort for Pl011
impl UartPort for Pl011
Source§fn startup(&mut self, config: &Config) -> Result<(), ConfigError>
fn startup(&mut self, config: &Config) -> Result<(), ConfigError>
Initializes the UART while leaving every device interrupt source masked.
fn shutdown(&mut self)
fn set_config(&mut self, config: &Config) -> Result<(), ConfigError>
Source§fn read_rx(&mut self) -> Option<RxSample>
fn read_rx(&mut self) -> Option<RxSample>
Reads one normalized hardware sample without consulting IRQ state.
Source§fn write_tx(&mut self, bytes: &[u8]) -> usize
fn write_tx(&mut self, bytes: &[u8]) -> usize
Writes as much of
bytes as the hardware can currently accept.Source§fn tx_idle(&mut self) -> bool
fn tx_idle(&mut self) -> bool
Returns whether both the FIFO and transmitter shift register are empty.
fn mask_all(&mut self)
Source§fn rearm(&mut self, sources: SerialEventSet) -> SerialEventSet
fn rearm(&mut self, sources: SerialEventSet) -> SerialEventSet
Rearms
sources and closes the enable/readiness race. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for Pl011
impl !UnwindSafe for Pl011
impl Freeze for Pl011
impl Send for Pl011
impl Sync for Pl011
impl Unpin for Pl011
impl UnsafeUnpin 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