Skip to main content

bandwidth_value

Function bandwidth_value 

Source
pub const fn bandwidth_value(bandwidth_hz: u32) -> Option<u8>
Expand description

Turns a bandwidth into the value the modulator takes.

The values do not start at zero and they are not hertz, so a plausible guess is wrong by four.

§Arguments

  • bandwidth_hz - the bandwidth.

§Returns

The value, or None for a bandwidth this chip does not transmit at.

§Examples

use pamoja_radios::sx1302::tx::bandwidth_value;

assert_eq!(bandwidth_value(125_000), Some(4));
assert_eq!(bandwidth_value(250_000), Some(5));
assert_eq!(bandwidth_value(500_000), Some(6));
assert_eq!(bandwidth_value(62_500), None);