Skip to main content

invert_iq

Function invert_iq 

Source
pub const fn invert_iq(receive: bool, transmit: bool) -> u8
Expand description

Returns RegInvertIQ for the IQ polarity of each path.

Bit 6 inverts the receive path as the datasheet describes. Bit 0 of the transmit path works the other way from its description: Semtech’s LoRaMac-node sets it for normal IQ and clears it to invert, which RadioLib and arduino-LoRa also do after finding the datasheet’s reading inverts the wrong frames.

§Arguments

  • receive - whether to invert the receive path, as a LoRaWAN device does for downlinks.
  • transmit - whether to invert the transmit path, as a gateway does.

§Returns

The register value.

§Examples

use pamoja_radios::sx127x::config::invert_iq;

assert_eq!(invert_iq(false, false), 0x27);
assert_eq!(invert_iq(true, true), 0x66);