Skip to main content

frequency_word

Function frequency_word 

Source
pub const fn frequency_word(frequency_hz: u32) -> u32
Expand description

Returns the word SetRfFrequency takes for a frequency.

The datasheet defines the frequency as the word times the crystal frequency over 2^25, so one step of the word is 0.95 Hz. The word is rounded to the nearest step.

§Arguments

  • frequency_hz - the carrier frequency in hertz.

§Returns

The 32-bit frequency word.

§Examples

use pamoja_radios::sx126x::config::frequency_word;

assert_eq!(frequency_word(868_100_000), 0x3641_999A);
assert_eq!(frequency_word(915_000_000), 0x3930_0000);