Settings

Struct Settings 

Source
pub struct Settings<Word = u8> { /* private fields */ }
Expand description

USART settings

Expected as an argument by the various enable methods on USART.

Implementations§

Source§

impl<Word> Settings<Word>

Source

pub fn data_len_7(self) -> Settings<u8>

Set data length to 7 bits

Overwrites the previous data length setting.

Source

pub fn data_len_8(self) -> Settings<u8>

Set data length to 8 bits

Overwrites the previous data length setting. This is the default.

Source

pub fn data_len_9(self) -> Settings<u16>

Set data length to 9 bits

Overwrites the previous data length setting.

Source

pub fn parity_none(self) -> Self

Add no parity bit

Overwrites the previous parity setting. This is the default.

Source

pub fn parity_even(self) -> Self

Add even parity bit

Overwrites the previous parity setting.

Source

pub fn parity_odd(self) -> Self

Add odd parity bit

Overwrites the previous parity setting.

Source

pub fn stop_len_1(self) -> Self

Add one stop bit

Overwrites the previous stop length setting. This is the default.

Source

pub fn stop_len_2(self) -> Self

Add two stop bits

Overwrites the previous stop length setting.

Source

pub fn clock_pol_falling(self) -> Self

Sample on falling clock edge

This is only relevant when receiving data in synchronous mode.

Overwrites the previous clock polarity setting. This is the default.

Source

pub fn clock_pol_rising(self) -> Self

Sample on rising clock edge

This is only relevant when receiving data in synchronous mode.

Overwrites the previous clock polarity setting.

Source

pub fn rx_pol_standard(self) -> Self

Don’t invert RX signal

Overwrites the previous RX polarity setting. This is the default.

Source

pub fn rx_pol_inverted(self) -> Self

Invert RX signal

Overwrites the previous RX polarity setting.

Source

pub fn tx_pol_standard(self) -> Self

Don’t invert TX signal

Overwrites the previous TX polarity setting. This is the default.

Source

pub fn tx_pol_inverted(self) -> Self

Invert TX signal

Overwrites the previous TX polarity setting.

Trait Implementations§

Source§

impl Default for Settings

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<Word> Freeze for Settings<Word>

§

impl<Word> RefUnwindSafe for Settings<Word>
where Word: RefUnwindSafe,

§

impl<Word> Send for Settings<Word>
where Word: Send,

§

impl<Word> Sync for Settings<Word>
where Word: Sync,

§

impl<Word> Unpin for Settings<Word>
where Word: Unpin,

§

impl<Word> UnwindSafe for Settings<Word>
where Word: 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.