Struct stm32wlxx_hal::subghz::PaConfig  
source · pub struct PaConfig { /* private fields */ }Expand description
Power amplifier configuration parameters.
Argument of set_pa_config.
Implementations§
source§impl PaConfig
 
impl PaConfig
sourcepub const LP_15: PaConfig = _
 
pub const LP_15: PaConfig = _
Optimal settings for +15dBm output power with the low-power PA.
This must be used with TxParams::LP_15.
sourcepub const LP_14: PaConfig = _
 
pub const LP_14: PaConfig = _
Optimal settings for +14dBm output power with the low-power PA.
This must be used with TxParams::LP_14.
sourcepub const LP_10: PaConfig = _
 
pub const LP_10: PaConfig = _
Optimal settings for +10dBm output power with the low-power PA.
This must be used with TxParams::LP_10.
sourcepub const HP_22: PaConfig = _
 
pub const HP_22: PaConfig = _
Optimal settings for +22dBm output power with the high-power PA.
This must be used with TxParams::HP.
sourcepub const HP_20: PaConfig = _
 
pub const HP_20: PaConfig = _
Optimal settings for +20dBm output power with the high-power PA.
This must be used with TxParams::HP.
sourcepub const HP_17: PaConfig = _
 
pub const HP_17: PaConfig = _
Optimal settings for +17dBm output power with the high-power PA.
This must be used with TxParams::HP.
sourcepub const HP_14: PaConfig = _
 
pub const HP_14: PaConfig = _
Optimal settings for +14dBm output power with the high-power PA.
This must be used with TxParams::HP.
sourcepub const fn new() -> PaConfig
 
pub const fn new() -> PaConfig
Create a new PaConfig struct.
This is the same as default, but in a const function.
Example
use stm32wlxx_hal::subghz::PaConfig;
const PA_CONFIG: PaConfig = PaConfig::new();sourcepub const fn set_pa_duty_cycle(self, pa_duty_cycle: u8) -> PaConfig
 
pub const fn set_pa_duty_cycle(self, pa_duty_cycle: u8) -> PaConfig
Set the power amplifier duty cycle (conduit angle) control.
Note: Only the first 3 bits of the pa_duty_cycle argument are used.
Duty cycle = 0.2 + 0.04 × bits
Caution
The following restrictions must be observed to avoid over-stress on the PA:
- LP PA mode with synthesis frequency > 400 MHz, 
pa_duty_cyclemust be < 0x7. - LP PA mode with synthesis frequency < 400 MHz, 
pa_duty_cyclemust be < 0x4. - HP PA mode, 
pa_duty_cyclemust be < 0x4 
Example
use stm32wlxx_hal::subghz::{PaConfig, PaSel};
const PA_CONFIG: PaConfig = PaConfig::new().set_pa(PaSel::Lp).set_pa_duty_cycle(0x4);sourcepub const fn set_hp_max(self, hp_max: u8) -> PaConfig
 
pub const fn set_hp_max(self, hp_max: u8) -> PaConfig
Set the high power amplifier output power.
Note: Only the first 3 bits of the hp_max argument are used.
Example
use stm32wlxx_hal::subghz::{PaConfig, PaSel};
const PA_CONFIG: PaConfig = PaConfig::new().set_pa(PaSel::Hp).set_hp_max(0x2);sourcepub const fn set_pa(self, pa: PaSel) -> PaConfig
 
pub const fn set_pa(self, pa: PaSel) -> PaConfig
Set the power amplifier to use, low or high power.
Example
use stm32wlxx_hal::subghz::{PaConfig, PaSel};
const PA_CONFIG_HP: PaConfig = PaConfig::new().set_pa(PaSel::Hp);
const PA_CONFIG_LP: PaConfig = PaConfig::new().set_pa(PaSel::Lp);sourcepub const fn as_slice(&self) -> &[u8]
 
pub const fn as_slice(&self) -> &[u8]
Extracts a slice containing the packet.
Example
use stm32wlxx_hal::subghz::{PaConfig, PaSel};
const PA_CONFIG: PaConfig = PaConfig::new()
    .set_pa(PaSel::Hp)
    .set_pa_duty_cycle(0x2)
    .set_hp_max(0x3);
assert_eq!(PA_CONFIG.as_slice(), &[0x95, 0x2, 0x03, 0x00, 0x01]);