Add embassy-lora crate
This crate contains async radio drivers for various lora drivers that work with embassy timers. The code is imported from Drogue Device ( https://github.com/drogue-iot/drogue-device) The radio drivers integrate with the async LoRaWAN MAC layer in the lorawan-device crate. Also added is an example for the STM32WL55 and for STM32L0 (requires the LoRa Discovery board) for LoRaWAN. Future work is to make the underlying radio drivers using fully async SPI when communicating with the peripheral.
This commit is contained in:
23
embassy-lora/src/lib.rs
Normal file
23
embassy-lora/src/lib.rs
Normal file
@ -0,0 +1,23 @@
|
||||
#![no_std]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(generic_associated_types)]
|
||||
//! embassy-lora is a collection of async radio drivers that integrate with the lorawan-device
|
||||
//! crate's async LoRaWAN MAC implementation.
|
||||
|
||||
pub(crate) mod fmt;
|
||||
|
||||
#[cfg(feature = "stm32wl")]
|
||||
pub mod stm32wl;
|
||||
#[cfg(feature = "sx127x")]
|
||||
pub mod sx127x;
|
||||
|
||||
/// A convenience timer to use with the LoRaWAN crate
|
||||
pub struct LoraTimer;
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
impl lorawan_device::async_device::radio::Timer for LoraTimer {
|
||||
type DelayFuture<'m> = impl core::future::Future<Output = ()> + 'm;
|
||||
fn delay_ms<'m>(&'m mut self, millis: u64) -> Self::DelayFuture<'m> {
|
||||
embassy::time::Timer::after(embassy::time::Duration::from_millis(millis))
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user