pub struct UART1<RX, TX, RTS, CTS> { /* private fields */ }
👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.
Expand description

UARTX represents the corresponding SERCOMX instance configured to act in the role of a UART Master. Objects of this type implement the HAL serial::Read, serial::Write traits.

This type is generic over any valid pad mapping where there is a defined “receive pin out transmit pin out” implementation.

Implementations§

source§

impl<RX, TX, RTS, CTS> UART1<RX, TX, RTS, CTS>

source

pub fn new<F, T>( clock: &Sercom1CoreClock, freq: F, sercom: SERCOM1, pm: &mut PM, padout: T ) -> UART1<RX, TX, RTS, CTS>where F: Into<Hertz>, T: Into<Padout<SERCOM1, RX, TX, RTS, CTS>>, Padout<SERCOM1, RX, TX, RTS, CTS>: RxpoTxpo,

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.

Power on and configure SERCOMX to work as a UART Master operating with the specified frequency. The padout specifies which pins are bound to the RX, TX and optionally RTS and CTS functions.

You can use any tuple of two or four SercomXPadY instances for which there exists a From implementation for UARTXPadout.

source

pub fn free(self) -> (Padout<SERCOM1, RX, TX, RTS, CTS>, SERCOM1)

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.
source

pub fn split(self) -> (UART1Tx<TX, RTS>, UART1Rx<RX, CTS>)

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.

Splits the UART into transmit and receive halves

source

pub fn join( tx: UART1Tx<TX, RTS>, rx: UART1Rx<RX, CTS> ) -> UART1<RX, TX, RTS, CTS>

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.

Combines transmit and receive halves back into a duplex UART

source

pub fn intenset<F>(&mut self, f: F)where F: FnOnce(&mut W<u8, Reg<u8, _INTENSET>>),

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.
source

pub fn intenclr<F>(&mut self, f: F)where F: FnOnce(&mut W<u8, Reg<u8, _INTENCLR>>),

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.
source

pub fn flags(&self) -> R<u16, Reg<u16, _STATUS>>

👎Deprecated since 0.13.0: The sercom::v1::uart module is deprecated, and will be removed in a subsequent release. Please use the sercom::v2::uart module instead.

Trait Implementations§

source§

impl<RX, TX, RTS, CTS> Read<u8> for UART1<RX, TX, RTS, CTS>

§

type Error = ()

Read error
source§

fn read( &mut self ) -> Result<u8, Error<<UART1<RX, TX, RTS, CTS> as Read<u8>>::Error>>

Reads a single word from the serial interface
source§

impl<RX, TX, RTS, CTS> Write<u8> for UART1<RX, TX, RTS, CTS>

§

type Error = ()

Write error
source§

fn write( &mut self, word: u8 ) -> Result<(), Error<<UART1<RX, TX, RTS, CTS> as Write<u8>>::Error>>

Writes a single word to the serial interface
source§

fn flush( &mut self ) -> Result<(), Error<<UART1<RX, TX, RTS, CTS> as Write<u8>>::Error>>

Ensures that none of the previously written words are still buffered
source§

impl<RX, TX, RTS, CTS> Write for UART1<RX, TX, RTS, CTS>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
source§

impl<RX, TX, RTS, CTS> Default<u8> for UART1<RX, TX, RTS, CTS>

Auto Trait Implementations§

§

impl<RX, TX, RTS, CTS> RefUnwindSafe for UART1<RX, TX, RTS, CTS>where CTS: RefUnwindSafe, RTS: RefUnwindSafe, RX: RefUnwindSafe, TX: RefUnwindSafe,

§

impl<RX, TX, RTS, CTS> Send for UART1<RX, TX, RTS, CTS>where CTS: Send, RTS: Send, RX: Send, TX: Send,

§

impl<RX, TX, RTS, CTS> !Sync for UART1<RX, TX, RTS, CTS>

§

impl<RX, TX, RTS, CTS> Unpin for UART1<RX, TX, RTS, CTS>where CTS: Unpin, RTS: Unpin, RX: Unpin, TX: Unpin,

§

impl<RX, TX, RTS, CTS> UnwindSafe for UART1<RX, TX, RTS, CTS>where CTS: UnwindSafe, RTS: UnwindSafe, RX: UnwindSafe, TX: 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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
source§

impl<S, Word> Write<Word> for Swhere S: Default<Word>, Word: Clone,

§

type Error = <S as Write<Word>>::Error

The type of error that can occur when writing
source§

fn bwrite_all( &mut self, buffer: &[Word] ) -> Result<(), <S as Write<Word>>::Error>

Writes a slice, blocking until everything has been written Read more
source§

fn bflush(&mut self) -> Result<(), <S as Write<Word>>::Error>

Block until the serial interface has sent all buffered words