Skip to main content

UarteRegistersManager

Struct UarteRegistersManager 

pub struct UarteRegistersManager { /* private fields */ }
Expand description

Wrapper for managing MMIO for UARTE.

Implementations§

§

impl UarteRegistersManager

pub unsafe fn new_uarte0() -> UarteRegistersManager

Create a DMA-enabled register manager for UARTE.

§Safety

This controls DMA hardware. As such, it must be unique. This requires:

  • This constructor must be called at most once.
  • There must not be any other code that accesses the DMA buffer and length registers.

pub fn start_tx_dma(&self, buf: SubSliceMut<'static, u8>) -> Result<(), ()>

Start a UART transmission with DMA.

§Return

Ok(()) on successfully starting the DMA operation. Err(()) if the DMA is busy and the operation could not be started.

pub fn finish_tx_dma(&self) -> Option<(SubSliceMut<'static, u8>, usize)>

pub fn tx_dma_pending(&self) -> bool

pub fn start_rx_dma(&self, buf: SubSliceMut<'static, u8>) -> Result<(), ()>

Start a UART reception with DMA.

§Return

Ok(()) on successfully starting the DMA operation. Err(()) if the DMA is busy and the operation could not be started.

pub fn finish_rx_dma(&self) -> Option<(SubSliceMut<'static, u8>, usize)>

pub fn rx_dma_pending(&self) -> bool

Auto Trait Implementations§

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.