Struct lora_e5_bsp::RfSwitch [−][src]
pub struct RfSwitch { /* fields omitted */ }Expand description
RF switch
Implementations
Create a new RfSwitch struct from GPIOs.
Example
use lora_e5_bsp::{
hal::{cortex_m, gpio::PortA, pac},
RfSwitch,
};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
let gpioa: PortA = PortA::split(dp.GPIOA, &mut dp.RCC);
let rfs: RfSwitch = cortex_m::interrupt::free(|cs| RfSwitch::new(gpioa.a4, gpioa.a5, cs));Set the RF switch to receive.
Example
use lora_e5_bsp::{
hal::{cortex_m, gpio::PortA, pac},
RfSwitch,
};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
let gpioa: PortA = PortA::split(dp.GPIOA, &mut dp.RCC);
let mut rfs: RfSwitch = cortex_m::interrupt::free(|cs| RfSwitch::new(gpioa.a4, gpioa.a5, cs));
rfs.set_rx();Set the RF switch to high power transmit.
Example
use lora_e5_bsp::{
hal::{cortex_m, gpio::PortA, pac},
RfSwitch,
};
let mut dp: pac::Peripherals = pac::Peripherals::take().unwrap();
let gpioa: PortA = PortA::split(dp.GPIOA, &mut dp.RCC);
let mut rfs: RfSwitch = cortex_m::interrupt::free(|cs| RfSwitch::new(gpioa.a4, gpioa.a5, cs));
rfs.set_tx_hp();