Skip to main content

image_calibration

Function image_calibration 

Source
pub const fn image_calibration(low_hz: u32, high_hz: u32) -> [u8; 2]
Expand description

Returns the two CalibrateImage codes that cover a band.

Section 9.2.1 calibrates image rejection between two codes in steps of 4 MHz, taking the floor of the lower edge and the ceiling of the upper one, so the calibrated range always covers the band.

§Arguments

  • low_hz - the lower edge of the band in hertz.
  • high_hz - the upper edge of the band in hertz.

§Returns

freq1 and freq2, the parameters of CalibrateImage.

§Examples

use pamoja_radios::sx126x::config::image_calibration;

assert_eq!(image_calibration(863_000_000, 870_000_000), [0xD7, 0xDA]);
assert_eq!(image_calibration(902_000_000, 928_000_000), [0xE1, 0xE8]);