Struct driver_pal::hal::linux::SpiModeFlags
source · pub struct SpiModeFlags(/* private fields */);
Implementations§
source§impl SpiModeFlags
impl SpiModeFlags
sourcepub const SPI_CPHA: SpiModeFlags = _
pub const SPI_CPHA: SpiModeFlags = _
Clock Phase
sourcepub const SPI_CPOL: SpiModeFlags = _
pub const SPI_CPOL: SpiModeFlags = _
Clock Polarity
sourcepub const SPI_CS_HIGH: SpiModeFlags = _
pub const SPI_CS_HIGH: SpiModeFlags = _
Chipselect Active High?
sourcepub const SPI_LSB_FIRST: SpiModeFlags = _
pub const SPI_LSB_FIRST: SpiModeFlags = _
Per-word Bits On Wire
sourcepub const SPI_3WIRE: SpiModeFlags = _
pub const SPI_3WIRE: SpiModeFlags = _
SI/SO Signals Shared
sourcepub const SPI_LOOP: SpiModeFlags = _
pub const SPI_LOOP: SpiModeFlags = _
Loopback Mode
sourcepub const SPI_NO_CS: SpiModeFlags = _
pub const SPI_NO_CS: SpiModeFlags = _
1 dev/bus; no chipselect
sourcepub const SPI_READY: SpiModeFlags = _
pub const SPI_READY: SpiModeFlags = _
Slave pulls low to pause
pub const SPI_MODE_0: SpiModeFlags = _
pub const SPI_MODE_1: SpiModeFlags = _
pub const SPI_MODE_2: SpiModeFlags = _
pub const SPI_MODE_3: SpiModeFlags = _
sourcepub const SPI_TX_DUAL: SpiModeFlags = _
pub const SPI_TX_DUAL: SpiModeFlags = _
Transmit with 2 wires
sourcepub const SPI_TX_QUAD: SpiModeFlags = _
pub const SPI_TX_QUAD: SpiModeFlags = _
Transmit with 4 wires
sourcepub const SPI_RX_DUAL: SpiModeFlags = _
pub const SPI_RX_DUAL: SpiModeFlags = _
Receive with 2 wires
sourcepub const SPI_RX_QUAD: SpiModeFlags = _
pub const SPI_RX_QUAD: SpiModeFlags = _
Receive with 4 wires
source§impl SpiModeFlags
impl SpiModeFlags
sourcepub const fn empty() -> SpiModeFlags
pub const fn empty() -> SpiModeFlags
Get a flags value with all bits unset.
sourcepub const fn all() -> SpiModeFlags
pub const fn all() -> SpiModeFlags
Get a flags value with all known bits set.
sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: u32) -> Option<SpiModeFlags>
pub const fn from_bits(bits: u32) -> Option<SpiModeFlags>
Convert from a bits value.
This method will return None
if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: u32) -> SpiModeFlags
pub const fn from_bits_truncate(bits: u32) -> SpiModeFlags
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: u32) -> SpiModeFlags
pub const fn from_bits_retain(bits: u32) -> SpiModeFlags
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<SpiModeFlags>
pub fn from_name(name: &str) -> Option<SpiModeFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
sourcepub const fn intersects(&self, other: SpiModeFlags) -> bool
pub const fn intersects(&self, other: SpiModeFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: SpiModeFlags) -> bool
pub const fn contains(&self, other: SpiModeFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn insert(&mut self, other: SpiModeFlags)
pub fn insert(&mut self, other: SpiModeFlags)
The bitwise or (|
) of the bits in two flags values.
sourcepub fn remove(&mut self, other: SpiModeFlags)
pub fn remove(&mut self, other: SpiModeFlags)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
sourcepub fn toggle(&mut self, other: SpiModeFlags)
pub fn toggle(&mut self, other: SpiModeFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub fn set(&mut self, other: SpiModeFlags, value: bool)
pub fn set(&mut self, other: SpiModeFlags, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
sourcepub const fn intersection(self, other: SpiModeFlags) -> SpiModeFlags
pub const fn intersection(self, other: SpiModeFlags) -> SpiModeFlags
The bitwise and (&
) of the bits in two flags values.
sourcepub const fn union(self, other: SpiModeFlags) -> SpiModeFlags
pub const fn union(self, other: SpiModeFlags) -> SpiModeFlags
The bitwise or (|
) of the bits in two flags values.
sourcepub const fn difference(self, other: SpiModeFlags) -> SpiModeFlags
pub const fn difference(self, other: SpiModeFlags) -> SpiModeFlags
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
sourcepub const fn symmetric_difference(self, other: SpiModeFlags) -> SpiModeFlags
pub const fn symmetric_difference(self, other: SpiModeFlags) -> SpiModeFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub const fn complement(self) -> SpiModeFlags
pub const fn complement(self) -> SpiModeFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
source§impl SpiModeFlags
impl SpiModeFlags
sourcepub const fn iter(&self) -> Iter<SpiModeFlags>
pub const fn iter(&self) -> Iter<SpiModeFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
sourcepub const fn iter_names(&self) -> IterNames<SpiModeFlags>
pub const fn iter_names(&self) -> IterNames<SpiModeFlags>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
source§impl Binary for SpiModeFlags
impl Binary for SpiModeFlags
source§impl BitAnd for SpiModeFlags
impl BitAnd for SpiModeFlags
source§fn bitand(self, other: SpiModeFlags) -> SpiModeFlags
fn bitand(self, other: SpiModeFlags) -> SpiModeFlags
The bitwise and (&
) of the bits in two flags values.
§type Output = SpiModeFlags
type Output = SpiModeFlags
&
operator.source§impl BitAndAssign for SpiModeFlags
impl BitAndAssign for SpiModeFlags
source§fn bitand_assign(&mut self, other: SpiModeFlags)
fn bitand_assign(&mut self, other: SpiModeFlags)
The bitwise and (&
) of the bits in two flags values.
source§impl BitOr for SpiModeFlags
impl BitOr for SpiModeFlags
source§fn bitor(self, other: SpiModeFlags) -> SpiModeFlags
fn bitor(self, other: SpiModeFlags) -> SpiModeFlags
The bitwise or (|
) of the bits in two flags values.
§type Output = SpiModeFlags
type Output = SpiModeFlags
|
operator.source§impl BitOrAssign for SpiModeFlags
impl BitOrAssign for SpiModeFlags
source§fn bitor_assign(&mut self, other: SpiModeFlags)
fn bitor_assign(&mut self, other: SpiModeFlags)
The bitwise or (|
) of the bits in two flags values.
source§impl BitXor for SpiModeFlags
impl BitXor for SpiModeFlags
source§fn bitxor(self, other: SpiModeFlags) -> SpiModeFlags
fn bitxor(self, other: SpiModeFlags) -> SpiModeFlags
The bitwise exclusive-or (^
) of the bits in two flags values.
§type Output = SpiModeFlags
type Output = SpiModeFlags
^
operator.source§impl BitXorAssign for SpiModeFlags
impl BitXorAssign for SpiModeFlags
source§fn bitxor_assign(&mut self, other: SpiModeFlags)
fn bitxor_assign(&mut self, other: SpiModeFlags)
The bitwise exclusive-or (^
) of the bits in two flags values.
source§impl Clone for SpiModeFlags
impl Clone for SpiModeFlags
source§fn clone(&self) -> SpiModeFlags
fn clone(&self) -> SpiModeFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SpiModeFlags
impl Debug for SpiModeFlags
source§impl Extend<SpiModeFlags> for SpiModeFlags
impl Extend<SpiModeFlags> for SpiModeFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SpiModeFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SpiModeFlags>,
The bitwise or (|
) of the bits in each flags value.
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl Flags for SpiModeFlags
impl Flags for SpiModeFlags
source§const FLAGS: &'static [Flag<SpiModeFlags>] = _
const FLAGS: &'static [Flag<SpiModeFlags>] = _
source§fn from_bits_retain(bits: u32) -> SpiModeFlags
fn from_bits_retain(bits: u32) -> SpiModeFlags
source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moresource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moresource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.source§impl FromIterator<SpiModeFlags> for SpiModeFlags
impl FromIterator<SpiModeFlags> for SpiModeFlags
source§fn from_iter<T>(iterator: T) -> SpiModeFlagswhere
T: IntoIterator<Item = SpiModeFlags>,
fn from_iter<T>(iterator: T) -> SpiModeFlagswhere
T: IntoIterator<Item = SpiModeFlags>,
The bitwise or (|
) of the bits in each flags value.
source§impl Hash for SpiModeFlags
impl Hash for SpiModeFlags
source§impl IntoIterator for SpiModeFlags
impl IntoIterator for SpiModeFlags
§type Item = SpiModeFlags
type Item = SpiModeFlags
§type IntoIter = Iter<SpiModeFlags>
type IntoIter = Iter<SpiModeFlags>
source§fn into_iter(self) -> <SpiModeFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <SpiModeFlags as IntoIterator>::IntoIter
source§impl LowerHex for SpiModeFlags
impl LowerHex for SpiModeFlags
source§impl Not for SpiModeFlags
impl Not for SpiModeFlags
source§fn not(self) -> SpiModeFlags
fn not(self) -> SpiModeFlags
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§type Output = SpiModeFlags
type Output = SpiModeFlags
!
operator.source§impl Octal for SpiModeFlags
impl Octal for SpiModeFlags
source§impl Ord for SpiModeFlags
impl Ord for SpiModeFlags
source§fn cmp(&self, other: &SpiModeFlags) -> Ordering
fn cmp(&self, other: &SpiModeFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for SpiModeFlags
impl PartialEq for SpiModeFlags
source§fn eq(&self, other: &SpiModeFlags) -> bool
fn eq(&self, other: &SpiModeFlags) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SpiModeFlags
impl PartialOrd for SpiModeFlags
source§fn partial_cmp(&self, other: &SpiModeFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &SpiModeFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Sub for SpiModeFlags
impl Sub for SpiModeFlags
source§fn sub(self, other: SpiModeFlags) -> SpiModeFlags
fn sub(self, other: SpiModeFlags) -> SpiModeFlags
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§type Output = SpiModeFlags
type Output = SpiModeFlags
-
operator.source§impl SubAssign for SpiModeFlags
impl SubAssign for SpiModeFlags
source§fn sub_assign(&mut self, other: SpiModeFlags)
fn sub_assign(&mut self, other: SpiModeFlags)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
source§impl UpperHex for SpiModeFlags
impl UpperHex for SpiModeFlags
impl Copy for SpiModeFlags
impl Eq for SpiModeFlags
impl StructuralPartialEq for SpiModeFlags
Auto Trait Implementations§
impl Freeze for SpiModeFlags
impl RefUnwindSafe for SpiModeFlags
impl Send for SpiModeFlags
impl Sync for SpiModeFlags
impl Unpin for SpiModeFlags
impl UnwindSafe for SpiModeFlags
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.