aboutsummaryrefslogtreecommitdiff
path: root/embassy-lora/src/lib.rs
blob: b2da22090c4d4b721693fc9d4c85aa12aa585c7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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))
    }
}