pub struct RadioConfig {
pub frequency_hz: u32,
pub band_hz: (u32, u32),
pub link: LinkSettings,
pub power: TxPower,
pub ramp: RampTime,
pub sync_word: SyncWord,
pub invert_iq_transmit: bool,
pub invert_iq_receive: bool,
}Expand description
What a radio sends and listens with: the carrier, the LoRa link, the power, and the sync word and IQ polarity that keep one network apart from another.
§Examples
use pamoja_lora::LinkSettings;
use pamoja_radios::sx126x::config::{PowerAmplifier, SyncWord, TxPower};
use pamoja_radios::sx126x::RadioConfig;
// A LoRaWAN device on 868.1 MHz at SF9, calibrated for the whole 863 to 870 MHz band.
let config = RadioConfig::new(
868_100_000,
LinkSettings::new(9, 125_000),
TxPower::for_output(PowerAmplifier::HighPower, 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 image calibration covers, as its lower and upper edges in hertz.
link: LinkSettingsThe spreading factor, bandwidth, coding rate, preamble, header, and CRC.
power: TxPowerThe amplifier configuration and power setting.
ramp: RampTimeHow fast the amplifier ramps up.
sync_word: SyncWordThe sync word written to the registers at 0x0740.
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,
power: TxPower,
) -> RadioConfig
pub const fn new( frequency_hz: u32, link: LinkSettings, power: TxPower, ) -> RadioConfig
Builds a configuration with a private sync word and standard IQ both ways.
Image calibration covers just the carrier, and the amplifier ramps in 40 us, the time Semtech’s LoRaMac-node reference passes to SetTxParams.
§Arguments
frequency_hz- the carrier frequency in hertz.link- the LoRa link settings.power- the amplifier configuration and power setting.
§Returns
The configuration.
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_ramp(self, ramp: RampTime) -> RadioConfig
pub const fn with_ramp(self, ramp: RampTime) -> 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 ==.