Struct stm32wlxx_hal::subghz::RfFreq
source · pub struct RfFreq { /* private fields */ }
Expand description
RF frequency structure.
Argument of set_rf_frequency
.
Implementations§
source§impl RfFreq
impl RfFreq
sourcepub const F915: RfFreq = _
pub const F915: RfFreq = _
915MHz, often used in Australia and North America.
Example
use stm32wlxx_hal::subghz::RfFreq;
assert_eq!(RfFreq::F915.freq(), 915_000_000);
sourcepub const F868: RfFreq = _
pub const F868: RfFreq = _
868MHz, often used in Europe.
Example
use stm32wlxx_hal::subghz::RfFreq;
assert_eq!(RfFreq::F868.freq(), 868_000_000);
sourcepub const F433: RfFreq = _
pub const F433: RfFreq = _
433MHz, often used in Europe.
Example
use stm32wlxx_hal::subghz::RfFreq;
assert_eq!(RfFreq::F433.freq(), 433_000_000);
sourcepub const fn from_raw(bits: u32) -> RfFreq
pub const fn from_raw(bits: u32) -> RfFreq
Create a new RfFreq
from a raw bit value.
The equation used to get the PLL frequency from the raw bits is:
RFPLL = 32e6 × bits / 225
Example
use stm32wlxx_hal::subghz::RfFreq;
const FREQ: RfFreq = RfFreq::from_raw(0x39300000);
assert_eq!(FREQ, RfFreq::F915);
sourcepub const fn from_frequency(freq: u32) -> RfFreq
pub const fn from_frequency(freq: u32) -> RfFreq
Create a new RfFreq
from a PLL frequency.
The equation used to get the raw bits from the PLL frequency is:
bits = RFPLL * 225 / 32e6
Example
use stm32wlxx_hal::subghz::RfFreq;
const FREQ: RfFreq = RfFreq::from_frequency(915_000_000);
assert_eq!(FREQ, RfFreq::F915);
Trait Implementations§
source§impl Ord for RfFreq
impl Ord for RfFreq
source§impl PartialEq for RfFreq
impl PartialEq for RfFreq
source§impl PartialOrd for RfFreq
impl PartialOrd for RfFreq
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 RfFreq
impl Eq for RfFreq
impl StructuralEq for RfFreq
impl StructuralPartialEq for RfFreq
Auto Trait Implementations§
impl RefUnwindSafe for RfFreq
impl Send for RfFreq
impl Sync for RfFreq
impl Unpin for RfFreq
impl UnwindSafe for RfFreq
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