Enum stm32wlxx_hal::rcc::MsiRange
source · #[repr(u8)]pub enum MsiRange {
Range100k = 0,
Range200k = 1,
Range400k = 2,
Range800k = 3,
Range1M = 4,
Range2M = 5,
Range4M = 6,
Range8M = 7,
Range16M = 8,
Range24M = 9,
Range32M = 10,
Range48M = 11,
}
Expand description
MSI clock ranges.
Variants§
Range100k = 0
Range 0 around 100 kHz.
Range200k = 1
Range 1 around 200 kHz.
Range400k = 2
Range 2 around 400 kHz.
Range800k = 3
Range 3 around 800 kHz.
Range1M = 4
Range 4 around 1 MHz.
Range2M = 5
Range 5 around 2 MHz.
Range4M = 6
Range 6 around 4 MHz.
Range8M = 7
Range 7 around 8 MHz.
Range16M = 8
Range 8 around 16 MHz.
Range24M = 9
Range 9 around 24 MHz.
Range32M = 10
Range 10 around 32 MHz.
Range48M = 11
Range 11 around 48 MHz.
Implementations§
source§impl MsiRange
impl MsiRange
sourcepub const fn to_hz(&self) -> u32
pub const fn to_hz(&self) -> u32
Get the frequency for an MSI range in hertz.
Example
use stm32wlxx_hal::rcc::MsiRange;
assert_eq!(MsiRange::Range100k.to_hz(), 100_000);
assert_eq!(MsiRange::Range200k.to_hz(), 200_000);
assert_eq!(MsiRange::Range400k.to_hz(), 400_000);
assert_eq!(MsiRange::Range800k.to_hz(), 800_000);
assert_eq!(MsiRange::Range1M.to_hz(), 1_000_000);
assert_eq!(MsiRange::Range2M.to_hz(), 2_000_000);
assert_eq!(MsiRange::Range4M.to_hz(), 4_000_000);
assert_eq!(MsiRange::Range8M.to_hz(), 8_000_000);
assert_eq!(MsiRange::Range16M.to_hz(), 16_000_000);
assert_eq!(MsiRange::Range24M.to_hz(), 24_000_000);
assert_eq!(MsiRange::Range32M.to_hz(), 32_000_000);
assert_eq!(MsiRange::Range48M.to_hz(), 48_000_000);
Trait Implementations§
source§impl From<LprunRange> for MsiRange
impl From<LprunRange> for MsiRange
source§fn from(lprr: LprunRange) -> Self
fn from(lprr: LprunRange) -> Self
Converts to this type from the input type.
source§impl From<MsiRange> for MSIRANGE_A
impl From<MsiRange> for MSIRANGE_A
source§impl Ord for MsiRange
impl Ord for MsiRange
source§impl PartialEq for MsiRange
impl PartialEq for MsiRange
source§impl PartialOrd for MsiRange
impl PartialOrd for MsiRange
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for MsiRange
impl Eq for MsiRange
impl StructuralEq for MsiRange
impl StructuralPartialEq for MsiRange
Auto Trait Implementations§
impl RefUnwindSafe for MsiRange
impl Send for MsiRange
impl Sync for MsiRange
impl Unpin for MsiRange
impl UnwindSafe for MsiRange
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
Mutably borrows from an owned value. Read more