Skip to main content

offset_bytes

Function offset_bytes 

Source
pub const fn offset_bytes(offset_hz: i32) -> [u8; 2]
Expand description

Splits a channel offset into the two bytes its registers take.

§Arguments

  • offset_hz - how far from the carrier.

§Returns

The high bits and then the low bits.

§Examples

use pamoja_radios::sx1302::channel::offset_bytes;

let [high, low] = offset_bytes(-400_000);
assert_eq!(high, 0x1c);
assert_eq!(low, 0xcd);