pub struct TxPower {
pub pa: PaConfig,
pub setting_dbm: i8,
}Expand description
The amplifier configuration and power setting that produce an output power.
§Examples
use pamoja_lora::budget::{Decibels, LinkBudget};
use pamoja_radios::sx126x::config::{PaConfig, PowerAmplifier, TxPower};
// A 2.15 dBi whip on half a decibel of pigtail under a 16 dBm EIRP ceiling.
let whip = LinkBudget {
transmit_antenna_gain_dbi: Decibels::from_hundredths(215),
transmit_cable_loss_db: Decibels::from_tenths(5),
..LinkBudget::default()
};
let power = TxPower::under_ceiling(PowerAmplifier::HighPower, &whip, Decibels::from_db(16));
assert_eq!(power.setting_dbm, 14);
assert_eq!(power.pa, PaConfig::SX1262_22_DBM);Fields§
§pa: PaConfigThe SetPaConfig parameters.
setting_dbm: i8The power byte of SetTxParams, in dBm.
Implementations§
Source§impl TxPower
impl TxPower
Sourcepub const fn for_output(amplifier: PowerAmplifier, output_dbm: i8) -> TxPower
pub const fn for_output(amplifier: PowerAmplifier, output_dbm: i8) -> TxPower
Chooses the settings for an output power.
The high power amplifier keeps its +22 dBm configuration and takes the power in SetTxParams, clamped to -9 to +22 dBm. The low power amplifier uses its +14 dBm configuration with the power clamped to -17 to +14 dBm, and its +15 dBm configuration, which Table 13-21 drives with a setting of +14 dBm, for anything above.
§Arguments
amplifier- the chip’s power amplifier.output_dbm- the output power wanted at the antenna port.
§Returns
The configuration and the setting.
Sourcepub fn under_ceiling(
amplifier: PowerAmplifier,
budget: &LinkBudget,
eirp_ceiling_dbm: Decibels,
) -> TxPower
pub fn under_ceiling( amplifier: PowerAmplifier, budget: &LinkBudget, eirp_ceiling_dbm: Decibels, ) -> TxPower
Chooses the settings that keep a link’s EIRP at or under a ceiling.
§Arguments
amplifier- the chip’s power amplifier.budget- the link budget, whose transmitting antenna and cable apply.eirp_ceiling_dbm- the EIRP limit, such as a channel plan’s ceiling for the frequency in use.
§Returns
The configuration and the setting, rounded down to whole decibels so the EIRP stays under the ceiling.
Trait Implementations§
impl Copy for TxPower
impl Eq for TxPower
impl StructuralPartialEq for TxPower
Auto Trait Implementations§
impl Freeze for TxPower
impl RefUnwindSafe for TxPower
impl Send for TxPower
impl Sync for TxPower
impl Unpin for TxPower
impl UnsafeUnpin for TxPower
impl UnwindSafe for TxPower
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