Struct rstubs::device::serial::LineCtl

source ·
#[repr(transparent)]
struct LineCtl(u8);
Expand description

Line Control Register

Tuple Fields§

§0: u8

Implementations§

source§

impl LineCtl

source

const fn new() -> Self

Creates a new default initialized bitfield.

source

const fn from_bits(bits: u8) -> Self

Convert from bits.

source

const fn into_bits(self) -> u8

Convert into bits.

source

const WORD_LENGTH_BITS: usize = 2usize

source

const WORD_LENGTH_OFFSET: usize = 0usize

source

const fn word_length(&self) -> u8

bits per character5678
word length value0123

Bits: 0..2

source

const fn with_word_length(self, value: u8) -> Self

bits per character5678
word length value0123

Bits: 0..2

source

fn set_word_length(&mut self, value: u8)

bits per character5678
word length value0123

Bits: 0..2

source

const STOP_BITS_BITS: usize = 1usize

source

const STOP_BITS_OFFSET: usize = 2usize

source

const fn stop_bits(&self) -> bool

false = one stop bit, true = 1.5/2 stop bits

Bits: 2..3

source

const fn with_stop_bits(self, value: bool) -> Self

false = one stop bit, true = 1.5/2 stop bits

Bits: 2..3

source

fn set_stop_bits(&mut self, value: bool)

false = one stop bit, true = 1.5/2 stop bits

Bits: 2..3

source

const PARITY_BITS: usize = 1usize

source

const PARITY_OFFSET: usize = 3usize

source

const fn parity(&self) -> bool

If enabled, add a parity bit

Bits: 3..4

source

const fn with_parity(self, value: bool) -> Self

If enabled, add a parity bit

Bits: 3..4

source

fn set_parity(&mut self, value: bool)

If enabled, add a parity bit

Bits: 3..4

source

const EVEN_PARITY_BITS: usize = 1usize

source

const EVEN_PARITY_OFFSET: usize = 4usize

source

const fn even_parity(&self) -> bool

Bits: 4..5

source

const fn with_even_parity(self, value: bool) -> Self

Bits: 4..5

source

fn set_even_parity(&mut self, value: bool)

Bits: 4..5

source

const STICK_PARITY_BITS: usize = 1usize

source

const STICK_PARITY_OFFSET: usize = 5usize

source

const fn stick_parity(&self) -> bool

Bits: 5..6

source

const fn with_stick_parity(self, value: bool) -> Self

Bits: 5..6

source

fn set_stick_parity(&mut self, value: bool)

Bits: 5..6

source

const SET_BREAK_BITS: usize = 1usize

source

const SET_BREAK_OFFSET: usize = 6usize

source

const fn set_break(&self) -> bool

Bits: 6..7

source

const fn with_set_break(self, value: bool) -> Self

Bits: 6..7

source

fn set_set_break(&mut self, value: bool)

Bits: 6..7

source

const DIVISOR_LATCH_ACCESS_BITS: usize = 1usize

source

const DIVISOR_LATCH_ACCESS_OFFSET: usize = 7usize

source

const fn divisor_latch_access(&self) -> bool

If enabled, the Serial::data and Serial::int_en registers set the divisor (baud rate) instead of their normal function

Bits: 7..8

source

const fn with_divisor_latch_access(self, value: bool) -> Self

If enabled, the Serial::data and Serial::int_en registers set the divisor (baud rate) instead of their normal function

Bits: 7..8

source

fn set_divisor_latch_access(&mut self, value: bool)

If enabled, the Serial::data and Serial::int_en registers set the divisor (baud rate) instead of their normal function

Bits: 7..8

Trait Implementations§

source§

impl Clone for LineCtl

source§

fn clone(&self) -> LineCtl

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 LineCtl

source§

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

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

impl Default for LineCtl

source§

fn default() -> Self

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

impl From<LineCtl> for u8

source§

fn from(v: LineCtl) -> u8

Converts to this type from the input type.
source§

impl From<u8> for LineCtl

source§

fn from(v: u8) -> Self

Converts to this type from the input type.
source§

impl PortValue for LineCtl

§

type I = u8

The underlying raw integer type, which can be [u8], [u16], or [u32].
source§

impl Copy for LineCtl

Auto Trait Implementations§

§

impl Freeze for LineCtl

§

impl RefUnwindSafe for LineCtl

§

impl Send for LineCtl

§

impl Sync for LineCtl

§

impl Unpin for LineCtl

§

impl UnwindSafe for LineCtl

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
§

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

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

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.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

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

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.