Struct lora_phy::LoRa

source ·
pub struct LoRa<RK> { /* private fields */ }
Expand description

Provides the physical layer API to support LoRa chips

Implementations§

source§

impl<RK> LoRa<RK>where RK: RadioKind + 'static,

source

pub async fn new( radio_kind: RK, enable_public_network: bool, delay: &mut impl DelayUs ) -> Result<Self, RadioError>

Build and return a new instance of the LoRa physical layer API to control an initialized LoRa radio

source

pub fn get_board_type(&self) -> BoardType

Get the board type of the LoRa board

source

pub fn create_modulation_params( &mut self, spreading_factor: SpreadingFactor, bandwidth: Bandwidth, coding_rate: CodingRate, frequency_in_hz: u32 ) -> Result<ModulationParams, RadioError>

Create modulation parameters for a communication channel

source

pub fn create_tx_packet_params( &mut self, preamble_length: u16, implicit_header: bool, crc_on: bool, iq_inverted: bool, modulation_params: &ModulationParams ) -> Result<PacketParams, RadioError>

Create packet parameters for a send operation on a communication channel

source

pub fn create_rx_packet_params( &mut self, preamble_length: u16, implicit_header: bool, max_payload_length: u8, crc_on: bool, iq_inverted: bool, modulation_params: &ModulationParams ) -> Result<PacketParams, RadioError>

Create packet parameters for a receive operation on a communication channel

source

pub async fn init( &mut self, enable_public_network: bool, delay: &mut impl DelayUs ) -> Result<(), RadioError>

Initialize a Semtech chip as the radio for LoRa physical layer communications

source

pub async fn sleep( &mut self, delay: &mut impl DelayUs ) -> Result<(), RadioError>

Place the LoRa physical layer in low power mode, using warm start if the Semtech chip supports it

source

pub async fn prepare_for_tx( &mut self, mdltn_params: &ModulationParams, output_power: i32, tx_boosted_if_possible: bool ) -> Result<(), RadioError>

Prepare the Semtech chip for a send operation

source

pub async fn tx( &mut self, mdltn_params: &ModulationParams, tx_pkt_params: &mut PacketParams, buffer: &[u8], timeout_in_ms: u32 ) -> Result<(), RadioError>

Execute a send operation

source

pub async fn prepare_for_rx( &mut self, mdltn_params: &ModulationParams, rx_pkt_params: &PacketParams, duty_cycle_params: Option<&DutyCycleParams>, rx_continuous: bool, rx_boosted_if_supported: bool, symbol_timeout: u16, rx_timeout_in_ms: u32 ) -> Result<(), RadioError>

Prepare the Semtech chip for a receive operation (single shot, continuous, or duty cycled) and initiate the operation

source

pub async fn rx( &mut self, rx_pkt_params: &PacketParams, receiving_buffer: &mut [u8] ) -> Result<(u8, PacketStatus), RadioError>

Obtain the results of a read operation

source

pub async fn prepare_for_cad( &mut self, mdltn_params: &ModulationParams, rx_boosted_if_supported: bool ) -> Result<(), RadioError>

Prepare the Semtech chip for a channel activity detection operation and initiate the operation

source

pub async fn cad(&mut self) -> Result<bool, RadioError>

Obtain the results of a channel activity detection operation

Auto Trait Implementations§

§

impl<RK> RefUnwindSafe for LoRa<RK>where RK: RefUnwindSafe,

§

impl<RK> Send for LoRa<RK>where RK: Send,

§

impl<RK> Sync for LoRa<RK>where RK: Sync,

§

impl<RK> Unpin for LoRa<RK>where RK: Unpin,

§

impl<RK> UnwindSafe for LoRa<RK>where RK: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.