Rx

Struct Rx 

Source
pub struct Rx { /* private fields */ }
Expand description

Serial receiver.

Can be created by using the Uart::split API.

Implementations§

Source§

impl Rx

Source

pub unsafe fn steal(id: Bank) -> Self

Retrieve a TX pin without expecting an explicit UART structure

§Safety

Circumvents the HAL safety guarantees.

Source

pub fn poll_errors(&self) -> Option<UartErrors>

Source

pub fn perid(&self) -> u32

Source

pub fn clear_fifo(&mut self)

Source

pub fn disable_interrupts(&mut self)

Source

pub fn enable_interrupts(&mut self, timeout: bool)

Source

pub fn enable(&mut self)

Source

pub fn disable(&mut self)

Source

pub fn read_fifo(&mut self) -> Result<u32, Infallible>

Low level function to read a word from the UART FIFO.

Uses the nb API to allow usage in blocking and non-blocking contexts.

Please note that you might have to mask the returned value with 0xff to retrieve the actual value if you use the manual parity mode. See chapter 4.6.2 for more information.

Source

pub fn read_fifo_unchecked(&mut self) -> u32

Low level function to read a word from from the UART FIFO.

This does not necesarily mean there is a word in the FIFO available. Use the Self::read_fifo function to read a word from the FIFO reliably using the nb API.

Please note that you might have to mask the returned value with 0xff to retrieve the actual value if you use the manual parity mode. See chapter 4.6.2 for more information.

Source

pub fn into_rx_with_irq(self) -> RxWithInterrupt

Trait Implementations§

Source§

impl ErrorType for Rx

Source§

type Error = Infallible

Error type of all the IO operations on this type.
Source§

impl ErrorType for Rx

Source§

type Error = Infallible

Error type
Source§

impl Read for Rx

Source§

fn read(&mut self) -> Result<u8, Self::Error>

Reads a single word from the serial interface
Source§

impl Read for Rx

Source§

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>>

Read the exact number of bytes required to fill buf. Read more

Auto Trait Implementations§

§

impl Freeze for Rx

§

impl RefUnwindSafe for Rx

§

impl Send for Rx

§

impl !Sync for Rx

§

impl Unpin for Rx

§

impl UnwindSafe for Rx

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.