Struct aw_soc::UART

source ·
pub struct UART<A: BaseAddress> { /* private fields */ }
Expand description

Universal Asynchronous Receiver-Transmitter.

Implementations§

source§

impl<const B: usize> UART<Static<B>>

source

pub const unsafe fn steal_static() -> UART<Static<B>>

Create a peripheral instance from statically known address.

This function is unsafe for it forces to seize ownership from possible wrapped peripheral group types. Users should normally retrieve ownership from wrapped types.

source§

impl UART<Dynamic>

source

pub unsafe fn steal_dynamic(base: *const ()) -> UART<Dynamic>

Create a peripheral instance from dynamically known address.

This function is unsafe for it forces to seize ownership from possible wrapped peripheral group types. Users should normally retrieve ownership from wrapped types.

Methods from Deref<Target = Uart16550<u32>>§

source

pub fn rbr_thr(&self) -> &RBR_THR<R>

取出接收缓冲和发送保持寄存器。

source

pub fn ier(&self) -> &IER<R>

取出中断使能寄存器。

source

pub fn iir_fcr(&self) -> &IIR_FCR<R>

取出中断识别和队列控制寄存器。

source

pub fn lcr(&self) -> &LCR<R>

取出线路控制寄存器。

source

pub fn mcr(&self) -> &MCR<R>

取出调制解调器控制寄存器。

source

pub fn lsr(&self) -> &LSR<R>

取出线路状态寄存器。

source

pub fn msr(&self) -> &MSR<R>

取出调制解调器状态寄存器。

source

pub fn write_divisor(&self, divisor: u16)

将分频系数写入锁存器。

source

pub fn read(&self, buf: &mut [u8]) -> usize

从接收队列读取字符到 buf,返回读取的字符数。

source

pub fn write(&self, buf: &[u8]) -> usize

buf 写入字符到发送队列,返回写入的字符数。

Trait Implementations§

source§

impl<A: BaseAddress> Deref for UART<A>

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<A: BaseAddress> Send for UART<A>

Auto Trait Implementations§

§

impl<A> RefUnwindSafe for UART<A>where A: RefUnwindSafe,

§

impl<A> Sync for UART<A>where A: Sync,

§

impl<A> Unpin for UART<A>where A: Unpin,

§

impl<A> UnwindSafe for UART<A>where A: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.