Enum stm32wlxx_hal::subghz::FskBandwidth
source · pub enum FskBandwidth {
Show 21 variants
Bw4 = 31,
Bw5 = 23,
Bw7 = 15,
Bw9 = 30,
Bw11 = 22,
Bw14 = 14,
Bw19 = 29,
Bw23 = 21,
Bw29 = 13,
Bw39 = 28,
Bw46 = 20,
Bw58 = 12,
Bw78 = 27,
Bw93 = 19,
Bw117 = 11,
Bw156 = 26,
Bw187 = 18,
Bw234 = 10,
Bw312 = 25,
Bw373 = 17,
Bw467 = 9,
}
Expand description
Bandwidth options for FskModParams
.
Variants§
Bw4 = 31
4.8 kHz double-sideband
Bw5 = 23
5.8 kHz double-sideband
Bw7 = 15
7.3 kHz double-sideband
Bw9 = 30
9.7 kHz double-sideband
Bw11 = 22
11.7 kHz double-sideband
Bw14 = 14
14.6 kHz double-sideband
Bw19 = 29
19.5 kHz double-sideband
Bw23 = 21
23.4 kHz double-sideband
Bw29 = 13
29.3 kHz double-sideband
Bw39 = 28
39.0 kHz double-sideband
Bw46 = 20
46.9 kHz double-sideband
Bw58 = 12
58.6 kHz double-sideband
Bw78 = 27
78.2 kHz double-sideband
Bw93 = 19
93.8 kHz double-sideband
Bw117 = 11
117.3 kHz double-sideband
Bw156 = 26
156.2 kHz double-sideband
Bw187 = 18
187.2 kHz double-sideband
Bw234 = 10
234.3 kHz double-sideband
Bw312 = 25
312.0 kHz double-sideband
Bw373 = 17
373.6 kHz double-sideband
Bw467 = 9
467.0 kHz double-sideband
Implementations§
source§impl FskBandwidth
impl FskBandwidth
sourcepub const fn hertz(&self) -> u32
pub const fn hertz(&self) -> u32
Get the bandwidth in hertz.
Example
use stm32wlxx_hal::subghz::FskBandwidth;
assert_eq!(FskBandwidth::Bw4.hertz(), 4_800);
assert_eq!(FskBandwidth::Bw5.hertz(), 5_800);
assert_eq!(FskBandwidth::Bw7.hertz(), 7_300);
assert_eq!(FskBandwidth::Bw9.hertz(), 9_700);
assert_eq!(FskBandwidth::Bw11.hertz(), 11_700);
assert_eq!(FskBandwidth::Bw14.hertz(), 14_600);
assert_eq!(FskBandwidth::Bw19.hertz(), 19_500);
assert_eq!(FskBandwidth::Bw23.hertz(), 23_400);
assert_eq!(FskBandwidth::Bw29.hertz(), 29_300);
assert_eq!(FskBandwidth::Bw39.hertz(), 39_000);
assert_eq!(FskBandwidth::Bw46.hertz(), 46_900);
assert_eq!(FskBandwidth::Bw58.hertz(), 58_600);
assert_eq!(FskBandwidth::Bw78.hertz(), 78_200);
assert_eq!(FskBandwidth::Bw93.hertz(), 93_800);
assert_eq!(FskBandwidth::Bw117.hertz(), 117_300);
assert_eq!(FskBandwidth::Bw156.hertz(), 156_200);
assert_eq!(FskBandwidth::Bw187.hertz(), 187_200);
assert_eq!(FskBandwidth::Bw234.hertz(), 234_300);
assert_eq!(FskBandwidth::Bw312.hertz(), 312_000);
assert_eq!(FskBandwidth::Bw373.hertz(), 373_600);
assert_eq!(FskBandwidth::Bw467.hertz(), 467_000);
sourcepub const fn from_bits(bits: u8) -> Result<Self, u8>
pub const fn from_bits(bits: u8) -> Result<Self, u8>
Convert from a raw bit value.
Invalid values will be returned in the Err
variant of the result.
Example
use stm32wlxx_hal::subghz::FskBandwidth;
assert_eq!(FskBandwidth::from_bits(0x1F), Ok(FskBandwidth::Bw4));
assert_eq!(FskBandwidth::from_bits(0x17), Ok(FskBandwidth::Bw5));
assert_eq!(FskBandwidth::from_bits(0x0F), Ok(FskBandwidth::Bw7));
assert_eq!(FskBandwidth::from_bits(0x1E), Ok(FskBandwidth::Bw9));
assert_eq!(FskBandwidth::from_bits(0x16), Ok(FskBandwidth::Bw11));
assert_eq!(FskBandwidth::from_bits(0x0E), Ok(FskBandwidth::Bw14));
assert_eq!(FskBandwidth::from_bits(0x1D), Ok(FskBandwidth::Bw19));
assert_eq!(FskBandwidth::from_bits(0x15), Ok(FskBandwidth::Bw23));
assert_eq!(FskBandwidth::from_bits(0x0D), Ok(FskBandwidth::Bw29));
assert_eq!(FskBandwidth::from_bits(0x1C), Ok(FskBandwidth::Bw39));
assert_eq!(FskBandwidth::from_bits(0x14), Ok(FskBandwidth::Bw46));
assert_eq!(FskBandwidth::from_bits(0x0C), Ok(FskBandwidth::Bw58));
assert_eq!(FskBandwidth::from_bits(0x1B), Ok(FskBandwidth::Bw78));
assert_eq!(FskBandwidth::from_bits(0x13), Ok(FskBandwidth::Bw93));
assert_eq!(FskBandwidth::from_bits(0x0B), Ok(FskBandwidth::Bw117));
assert_eq!(FskBandwidth::from_bits(0x1A), Ok(FskBandwidth::Bw156));
assert_eq!(FskBandwidth::from_bits(0x12), Ok(FskBandwidth::Bw187));
assert_eq!(FskBandwidth::from_bits(0x0A), Ok(FskBandwidth::Bw234));
assert_eq!(FskBandwidth::from_bits(0x19), Ok(FskBandwidth::Bw312));
assert_eq!(FskBandwidth::from_bits(0x11), Ok(FskBandwidth::Bw373));
assert_eq!(FskBandwidth::from_bits(0x09), Ok(FskBandwidth::Bw467));
assert_eq!(FskBandwidth::from_bits(0x00), Err(0x00));
Trait Implementations§
source§impl Clone for FskBandwidth
impl Clone for FskBandwidth
source§fn clone(&self) -> FskBandwidth
fn clone(&self) -> FskBandwidth
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FskBandwidth
impl Debug for FskBandwidth
source§impl Ord for FskBandwidth
impl Ord for FskBandwidth
source§impl PartialEq for FskBandwidth
impl PartialEq for FskBandwidth
source§fn eq(&self, other: &FskBandwidth) -> bool
fn eq(&self, other: &FskBandwidth) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FskBandwidth
impl PartialOrd for FskBandwidth
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 FskBandwidth
impl Eq for FskBandwidth
impl StructuralEq for FskBandwidth
impl StructuralPartialEq for FskBandwidth
Auto Trait Implementations§
impl RefUnwindSafe for FskBandwidth
impl Send for FskBandwidth
impl Sync for FskBandwidth
impl Unpin for FskBandwidth
impl UnwindSafe for FskBandwidth
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