pub const fn frequency_value(hertz: u32) -> u32Expand description
Turns a carrier into the value the frequency command takes.
The chip counts the carrier in steps of its crystal, so the value is the carrier times two to the twenty-fifth over the crystal. That divides exactly, which keeps this integer.
§Arguments
hertz- the carrier.
§Returns
The value, most significant byte first when it is written.
§Examples
use pamoja_radios::sx1302::sx1250::frequency_value;
assert_eq!(frequency_value(868_100_000), 0x3641_9999);
assert_eq!(frequency_value(915_000_000), 0x3930_0000);