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.
Source§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.
Source§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.
Source§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 contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.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 iter_defined_names() -> IterDefinedNames<Self>
fn iter_defined_names() -> IterDefinedNames<Self>
Self::FLAGS.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
Source§type Item = SpiModeFlags
type Item = SpiModeFlags
Source§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.
Source§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§impl PartialOrd for SpiModeFlags
impl PartialOrd for SpiModeFlags
Source§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.
Source§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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.