Struct Config

Source
#[non_exhaustive]
pub struct Config { /* private fields */ }
Expand description

UART Configuration

Implementations§

Source§

impl Config

Source

pub fn with_baudrate(self, baudrate: u32) -> Self

Assign the given value to the baudrate field.

Source

pub fn baudrate(&self) -> u32

The baud rate (speed) of the UART communication in bits per second (bps).

Source

pub fn with_baudrate_tolerance( self, baudrate_tolerance: BaudrateTolerance, ) -> Self

Assign the given value to the baudrate_tolerance field.

Source

pub fn baudrate_tolerance(&self) -> BaudrateTolerance

Determines how close to the desired baud rate value the driver should set the baud rate.

Source

pub fn with_data_bits(self, data_bits: DataBits) -> Self

Assign the given value to the data_bits field.

Source

pub fn data_bits(&self) -> DataBits

Number of data bits in each frame (5, 6, 7, or 8 bits).

Source

pub fn with_parity(self, parity: Parity) -> Self

Assign the given value to the parity field.

Source

pub fn parity(&self) -> Parity

Parity setting (None, Even, or Odd).

Source

pub fn with_stop_bits(self, stop_bits: StopBits) -> Self

Assign the given value to the stop_bits field.

Source

pub fn stop_bits(&self) -> StopBits

Number of stop bits in each frame (1, 1.5, or 2 bits).

Source

pub fn with_clock_source(self, clock_source: ClockSource) -> Self

Assign the given value to the clock_source field.

Source

pub fn clock_source(&self) -> ClockSource

Clock source used by the UART peripheral.

Source

pub fn with_rx(self, rx: RxConfig) -> Self

Assign the given value to the rx field.

Source

pub fn rx(&self) -> RxConfig

UART Receive part configuration.

Source

pub fn with_tx(self, tx: TxConfig) -> Self

Assign the given value to the tx field.

Source

pub fn tx(&self) -> TxConfig

UART Transmit part configuration.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more
Source§

impl Format for Config

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl Copy for Config

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
§

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

Performs the conversion.
§

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

§

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

The type returned in the event of a conversion error.
§

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

Performs the conversion.