use super::DeviceSel;
pub trait Sx126xVariant {
fn get_device_sel(&self) -> DeviceSel;
fn use_dio2_as_rfswitch(&self) -> bool {
true
}
}
pub struct Sx1261;
impl Sx126xVariant for Sx1261 {
fn get_device_sel(&self) -> super::DeviceSel {
super::DeviceSel::LowPowerPA
}
}
pub struct Sx1262;
impl Sx126xVariant for Sx1262 {
fn get_device_sel(&self) -> super::DeviceSel {
super::DeviceSel::HighPowerPA
}
}
pub struct Stm32wl {
pub use_high_power_pa: bool,
}
impl Sx126xVariant for Stm32wl {
fn get_device_sel(&self) -> super::DeviceSel {
if self.use_high_power_pa {
DeviceSel::HighPowerPA
} else {
DeviceSel::LowPowerPA
}
}
fn use_dio2_as_rfswitch(&self) -> bool {
false
}
}