Skip to main content

start_delay

Function start_delay 

Source
pub fn start_delay(
    front_end: FrontEnd,
    bandwidth_hz: u32,
    chirp_lowpass: u8,
) -> Option<u16>
Expand description

How far ahead of its window a chain has to be started.

The chip does not radiate the moment it is triggered. The front end settles, the filter fills, and the modulator starts, so a send meant for a given moment is programmed by that much earlier.

§Arguments

  • front_end - which front end is wired to the chain.
  • bandwidth_hz - the bandwidth the packet goes out at.
  • chirp_lowpass - the filter setting the chain is configured with.

§Returns

The delay in the chip’s own ticks, or None for a bandwidth no front end supports. Anything that is not LoRa needs no delay at all, so a caller sends those with zero.

§Examples

use pamoja_radios::sx1302::tx::{start_delay, FrontEnd};

// The usual case: an SX1250 at 125 kHz.
let delay = start_delay(FrontEnd::Sx1250, 125_000, 6).expect("a supported bandwidth");
assert!(delay < 1500 * 32, "the chip starts early, never late");

// A bandwidth no front end covers has no answer.
assert_eq!(start_delay(FrontEnd::Sx1250, 62_500, 6), None);