From b9693c0b9158159822e97a9f34745353b32a3bf2 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 1 Dec 2021 21:16:54 +0100 Subject: Update rust-lorawan to version supporting defmt 0.3 --- examples/stm32l0/Cargo.toml | 7 ++++--- examples/stm32wl55/Cargo.toml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index 6fe744f03..6d840d503 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml @@ -10,9 +10,10 @@ embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-tim3"] } -embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time"] } -lorawan-device = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "4bff2e0021103adfbccedcbf49dbcd0474adc4b2", default-features = false, features = ["async"] } -lorawan-encoding = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "4bff2e0021103adfbccedcbf49dbcd0474adc4b2", default-features = false, features = ["default-crypto"] } +embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"] } + +lorawan-device = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "53d2feb43e2f3ddcdc55f0587391b0d3f02d8d93", default-features = false, features = ["async"] } +lorawan-encoding = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "53d2feb43e2f3ddcdc55f0587391b0d3f02d8d93", default-features = false, features = ["default-crypto"] } defmt = "0.3" defmt-rtt = "0.3" diff --git a/examples/stm32wl55/Cargo.toml b/examples/stm32wl55/Cargo.toml index 7a7621230..c7344152d 100644 --- a/examples/stm32wl55/Cargo.toml +++ b/examples/stm32wl55/Cargo.toml @@ -11,8 +11,8 @@ embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-tim2", "memory-x", "subghz", "unstable-pac"] } embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time"] } -lorawan-device = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "4bff2e0021103adfbccedcbf49dbcd0474adc4b2", default-features = false, features = ["async"] } -lorawan-encoding = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "4bff2e0021103adfbccedcbf49dbcd0474adc4b2", default-features = false, features = ["default-crypto"] } +lorawan-device = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "53d2feb43e2f3ddcdc55f0587391b0d3f02d8d93", default-features = false, features = ["async"] } +lorawan-encoding = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "53d2feb43e2f3ddcdc55f0587391b0d3f02d8d93", default-features = false, features = ["default-crypto"] } defmt = "0.3" defmt-rtt = "0.3" -- cgit From 9a730ef692d2b5c529f5e1aac58e80c6d04c2458 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 1 Dec 2021 21:59:53 +0100 Subject: Refactor sx127x radio to use async SPI with DMA --- examples/stm32l0/Cargo.toml | 2 +- examples/stm32l0/src/bin/lorawan.rs | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'examples') diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml index 6d840d503..53ba6ba39 100644 --- a/examples/stm32l0/Cargo.toml +++ b/examples/stm32l0/Cargo.toml @@ -20,7 +20,7 @@ defmt-rtt = "0.3" cortex-m = "0.7.3" cortex-m-rt = "0.7.0" -embedded-hal = "0.2.6" panic-probe = { version = "0.3", features = ["print-defmt"] } futures = { version = "0.3.17", default-features = false, features = ["async-await"] } heapless = { version = "0.7.5", default-features = false } +embedded-hal = "0.2.6" diff --git a/examples/stm32l0/src/bin/lorawan.rs b/examples/stm32l0/src/bin/lorawan.rs index 5ca69f9a7..cbae88356 100644 --- a/examples/stm32l0/src/bin/lorawan.rs +++ b/examples/stm32l0/src/bin/lorawan.rs @@ -12,7 +12,6 @@ mod example_common; use embassy_lora::{sx127x::*, LoraTimer}; use embassy_stm32::{ dbgmcu::Dbgmcu, - dma::NoDma, exti::ExtiInput, gpio::{Input, Level, Output, Pull, Speed}, rcc, @@ -45,8 +44,8 @@ async fn main(_spawner: embassy::executor::Spawner, mut p: Peripherals) { p.PB3, p.PA7, p.PA6, - NoDma, - NoDma, + p.DMA1_CH3, + p.DMA1_CH2, 200_000.hz(), spi::Config::default(), ); @@ -58,15 +57,9 @@ async fn main(_spawner: embassy::executor::Spawner, mut p: Peripherals) { let ready = Input::new(p.PB4, Pull::Up); let ready_pin = ExtiInput::new(ready, p.EXTI4); - let radio = Sx127xRadio::new( - spi, - cs, - reset, - ready_pin, - DummySwitch, - &mut embassy::time::Delay, - ) - .unwrap(); + let radio = Sx127xRadio::new(spi, cs, reset, ready_pin, DummySwitch) + .await + .unwrap(); let region = region::EU868::default().into(); let mut radio_buffer = [0; 256]; -- cgit