Skip to main content

correlator

Function correlator 

Source
pub const fn correlator(spreading_factor: u8) -> Correlator
Expand description

The correlator settings for one spreading factor.

The eight sets run seven bytes apart, starting at SF5.

§Arguments

  • spreading_factor - from 5 to 12. Anything outside is clamped into it.

§Returns

The four registers that tune detection for it.

§Examples

use pamoja_radios::sx1302::register::correlator;

// SF7 is two sets along from SF5, so fourteen bytes.
assert_eq!(correlator(5).accumulated_ratio.address + 14, correlator(7).accumulated_ratio.address);
assert_eq!(correlator(7).peaks.width, 3);