pub struct RadioConfig {
pub frequency_hz: u32,
pub band_hz: (u32, u32),
pub link: LinkSettings,
pub output_dbm: i8,
pub sync_word: SyncWord,
pub invert_iq_transmit: bool,
pub invert_iq_receive: bool,
}Expand description
What a radio of either family sends and listens with.
The output power is what the amplifier is asked for, in whole dBm. Each driver clamps it
to the range of the amplifier its board names, so a regional ceiling is kept by choosing
the power first, with
LinkBudget::max_transmit_power_dbm
rounded down.
§Examples
use pamoja_lora::LinkSettings;
use pamoja_radios::radio::{RadioConfig, SyncWord};
// A LoRaWAN device on 868.1 MHz at SF9 with 14 dBm, calibrated for the whole band.
let config = RadioConfig::new(868_100_000, LinkSettings::new(9, 125_000), 14)
.with_band(863_000_000, 870_000_000)
.lorawan_device();
assert_eq!(config.sync_word, SyncWord::Public);
assert!(config.invert_iq_receive && !config.invert_iq_transmit);Fields§
§frequency_hz: u32The carrier frequency in hertz.
band_hz: (u32, u32)The band an SX126x calibrates its receiver image for, as its lower and upper edges in hertz. The SX127x calibrates at the carrier instead, once per RF port.
link: LinkSettingsThe spreading factor, bandwidth, coding rate, preamble, header, and CRC.
output_dbm: i8The output power asked of the amplifier, in dBm.
sync_word: SyncWordThe sync word.
invert_iq_transmit: boolWhether frames go out with inverted IQ, as a LoRaWAN gateway sends downlinks.
invert_iq_receive: boolWhether the receiver expects inverted IQ, as a LoRaWAN device hears downlinks.
Implementations§
Source§impl RadioConfig
impl RadioConfig
Sourcepub const fn new(
frequency_hz: u32,
link: LinkSettings,
output_dbm: i8,
) -> RadioConfig
pub const fn new( frequency_hz: u32, link: LinkSettings, output_dbm: i8, ) -> RadioConfig
Builds a configuration with a private sync word and standard IQ both ways.
§Arguments
frequency_hz- the carrier frequency in hertz.link- the LoRa link settings.output_dbm- the output power asked of the amplifier, in dBm.
§Returns
The configuration, with the SX126x calibration band covering just the carrier.
Sourcepub const fn with_band(self, low_hz: u32, high_hz: u32) -> RadioConfig
pub const fn with_band(self, low_hz: u32, high_hz: u32) -> RadioConfig
Sourcepub const fn with_sync_word(self, sync_word: SyncWord) -> RadioConfig
pub const fn with_sync_word(self, sync_word: SyncWord) -> RadioConfig
Sourcepub const fn with_inverted_iq(
self,
transmit: bool,
receive: bool,
) -> RadioConfig
pub const fn with_inverted_iq( self, transmit: bool, receive: bool, ) -> RadioConfig
Sourcepub const fn lorawan_device(self) -> RadioConfig
pub const fn lorawan_device(self) -> RadioConfig
Returns the configuration a LoRaWAN end device uses: the public sync word, uplinks with standard IQ, and downlinks heard with inverted IQ.
§Returns
The configuration.
Trait Implementations§
Source§impl Clone for RadioConfig
impl Clone for RadioConfig
Source§fn clone(&self) -> RadioConfig
fn clone(&self) -> RadioConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RadioConfig
Source§impl Debug for RadioConfig
impl Debug for RadioConfig
impl Eq for RadioConfig
Source§impl PartialEq for RadioConfig
impl PartialEq for RadioConfig
Source§fn eq(&self, other: &RadioConfig) -> bool
fn eq(&self, other: &RadioConfig) -> bool
self and other values to be equal, and is used by ==.