pub struct RadioConfig {
pub frequency_hz: u32,
pub link: LinkSettings,
pub power: TxPower,
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::sx127x::config::{PaOutput, SyncWord, TxPower};
use pamoja_radios::sx127x::RadioConfig;
// A LoRaWAN device on 868.1 MHz at SF9 with 14 dBm on PA_BOOST.
let config = RadioConfig::new(
868_100_000,
LinkSettings::new(9, 125_000),
TxPower::for_output(PaOutput::PaBoost, 14),
)
.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.
link: LinkSettingsThe LoRa link settings frames are sent and received with.
power: TxPowerThe amplifier settings.
sync_word: SyncWordThe sync word.
invert_iq_transmit: boolWhether transmitted frames have inverted IQ.
invert_iq_receive: boolWhether received frames are expected with inverted IQ.
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
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 for a LoRaWAN end device: the public sync word, standard IQ on uplinks, and inverted IQ on downlinks.
§Returns
The configuration.
Trait Implementations§
Source§impl Clone for RadioConfig
impl Clone for RadioConfig
Source§fn clone(&self) -> RadioConfig
fn clone(&self) -> RadioConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RadioConfig
Auto Trait Implementations§
impl Freeze for RadioConfig
impl RefUnwindSafe for RadioConfig
impl Send for RadioConfig
impl Sync for RadioConfig
impl Unpin for RadioConfig
impl UnsafeUnpin for RadioConfig
impl UnwindSafe for RadioConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more