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

source

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);
source

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

source§

fn clone(&self) -> FskBandwidth

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FskBandwidth

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for FskBandwidth

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for FskBandwidth

source§

fn eq(&self, other: &FskBandwidth) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for FskBandwidth

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for FskBandwidth

source§

impl Eq for FskBandwidth

source§

impl StructuralEq for FskBandwidth

source§

impl StructuralPartialEq for FskBandwidth

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.