Struct stm32wlxx_hal::subghz::TxParams
source · pub struct TxParams { /* private fields */ }
Expand description
Transmit parameters, output power and power amplifier ramp up time.
Argument of set_tx_params
.
Implementations§
source§impl TxParams
impl TxParams
sourcepub const LP_15: TxParams = _
pub const LP_15: TxParams = _
Optimal power setting for +15dBm output power with the low-power PA.
This must be used with PaConfig::LP_15
.
sourcepub const LP_14: TxParams = _
pub const LP_14: TxParams = _
Optimal power setting for +14dBm output power with the low-power PA.
This must be used with PaConfig::LP_14
.
sourcepub const LP_10: TxParams = _
pub const LP_10: TxParams = _
Optimal power setting for +10dBm output power with the low-power PA.
This must be used with PaConfig::LP_10
.
sourcepub const HP: TxParams = _
pub const HP: TxParams = _
Optimal power setting for the high-power PA.
This must be used with one of:
sourcepub const fn new() -> TxParams
pub const fn new() -> TxParams
Create a new TxParams
struct.
This is the same as default
, but in a const
function.
Example
use stm32wlxx_hal::subghz::TxParams;
const TX_PARAMS: TxParams = TxParams::new();
assert_eq!(TX_PARAMS, TxParams::default());
sourcepub const fn set_power(self, power: u8) -> TxParams
pub const fn set_power(self, power: u8) -> TxParams
Set the output power.
For low power selected in set_pa_config
:
- 0x0E: +14 dB
- …
- 0x00: 0 dB
- …
- 0xEF: -17 dB
- Others: reserved
For high power selected in set_pa_config
:
- 0x16: +22 dB
- …
- 0x00: 0 dB
- …
- 0xF7: -9 dB
- Others: reserved
Example
Set the output power to 0 dB.
use stm32wlxx_hal::subghz::{RampTime, TxParams};
const TX_PARAMS: TxParams = TxParams::new().set_power(0x00);
sourcepub const fn set_ramp_time(self, rt: RampTime) -> TxParams
pub const fn set_ramp_time(self, rt: RampTime) -> TxParams
Set the Power amplifier ramp time for FSK, MSK, and LoRa modulation.
Example
Set the ramp time to 200 microseconds.
use stm32wlxx_hal::subghz::{RampTime, TxParams};
const TX_PARAMS: TxParams = TxParams::new().set_ramp_time(RampTime::Micros200);