Serial

Struct Serial 

Source
pub struct Serial<UART, PINS> { /* private fields */ }
Expand description

Serial abstraction

Implementations§

Source§

impl<TX, RX> Serial<UART0, (TX, RX)>

Source

pub fn uart0( uart: UART0, pins: (TX, RX), baud_rate: Bps<u32>, mcg: &MultipurposeClockGenerator<'_>, ) -> Self
where TX: TxPin<UART0>, RX: RxPin<UART0>,

Configures a UART peripheral to provide serial communication

Source

pub fn split(self) -> (Tx<UART0>, Rx<UART0>)

Splits the Serial abstraction into a transmitter and a receiver half

Source

pub fn free(self) -> (UART0, (TX, RX))

Releases the UART peripheral and associated pins

Source§

impl<TX, RX> Serial<UART1, (TX, RX)>

Source

pub fn uart1( uart: UART1, pins: (TX, RX), baud_rate: Bps<u32>, mcg: &MultipurposeClockGenerator<'_>, ) -> Self
where TX: TxPin<UART1>, RX: RxPin<UART1>,

Configures a UART peripheral to provide serial communication

Source

pub fn split(self) -> (Tx<UART1>, Rx<UART1>)

Splits the Serial abstraction into a transmitter and a receiver half

Source

pub fn free(self) -> (UART1, (TX, RX))

Releases the UART peripheral and associated pins

Source§

impl<TX, RX> Serial<UART2, (TX, RX)>

Source

pub fn uart2( uart: UART2, pins: (TX, RX), baud_rate: Bps<u32>, mcg: &MultipurposeClockGenerator<'_>, ) -> Self
where TX: TxPin<UART2>, RX: RxPin<UART2>,

Configures a UART peripheral to provide serial communication

Source

pub fn split(self) -> (Tx<UART2>, Rx<UART2>)

Splits the Serial abstraction into a transmitter and a receiver half

Source

pub fn free(self) -> (UART2, (TX, RX))

Releases the UART peripheral and associated pins

Auto Trait Implementations§

§

impl<UART, PINS> Freeze for Serial<UART, PINS>
where UART: Freeze, PINS: Freeze,

§

impl<UART, PINS> RefUnwindSafe for Serial<UART, PINS>
where UART: RefUnwindSafe, PINS: RefUnwindSafe,

§

impl<UART, PINS> Send for Serial<UART, PINS>
where UART: Send, PINS: Send,

§

impl<UART, PINS> Sync for Serial<UART, PINS>
where UART: Sync, PINS: Sync,

§

impl<UART, PINS> Unpin for Serial<UART, PINS>
where UART: Unpin, PINS: Unpin,

§

impl<UART, PINS> UnwindSafe for Serial<UART, PINS>
where UART: UnwindSafe, PINS: UnwindSafe,

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.