Merge branch 'tl_mbox' of https://github.com/OueslatiGhaith/embassy into tl_mbox
merge
This commit is contained in:
commit
3e728d5e73
@ -39,6 +39,4 @@ async fn main(_spawner: Spawner) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
@ -11,12 +11,13 @@ stm32g071rb = ["embassy-stm32/stm32g071rb", "not-gpdma"] # Nucleo
|
||||
stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] # Nucleo
|
||||
stm32g491re = ["embassy-stm32/stm32g491re", "not-gpdma"] # Nucleo
|
||||
stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "not-gpdma"] # Nucleo
|
||||
stm32wb55rg = ["embassy-stm32/stm32wb55rg", "not-gpdma"] # Nucleo
|
||||
stm32wb55rg = ["embassy-stm32/stm32wb55rg", "ble", "not-gpdma"] # Nucleo
|
||||
stm32h563zi = ["embassy-stm32/stm32h563zi"] # Nucleo
|
||||
stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board
|
||||
|
||||
sdmmc = []
|
||||
chrono = ["embassy-stm32/chrono", "dep:chrono"]
|
||||
ble = []
|
||||
not-gpdma = []
|
||||
|
||||
[dependencies]
|
||||
@ -42,6 +43,11 @@ chrono = { version = "^0.4", default-features = false, optional = true}
|
||||
|
||||
# BEGIN TESTS
|
||||
# Generated by gen_test.py. DO NOT EDIT.
|
||||
[[bin]]
|
||||
name = "ble"
|
||||
path = "src/bin/ble.rs"
|
||||
required-features = [ "ble",]
|
||||
|
||||
[[bin]]
|
||||
name = "gpio"
|
||||
path = "src/bin/gpio.rs"
|
||||
|
51
tests/stm32/src/bin/ble.rs
Normal file
51
tests/stm32/src/bin/ble.rs
Normal file
@ -0,0 +1,51 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
// required-features: ble
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_stm32::ipcc::{Config, Ipcc};
|
||||
use embassy_stm32::tl_mbox::TlMbox;
|
||||
use embassy_time::{Duration, Timer};
|
||||
use example_common::*;
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_stm32::init(config());
|
||||
info!("Hello World!");
|
||||
|
||||
let config = Config::default();
|
||||
let mut ipcc = Ipcc::new(p.IPCC, config);
|
||||
|
||||
let mbox = TlMbox::init(&mut ipcc);
|
||||
|
||||
loop {
|
||||
let wireless_fw_info = mbox.wireless_fw_info();
|
||||
match wireless_fw_info {
|
||||
None => error!("not yet initialized"),
|
||||
Some(fw_info) => {
|
||||
let version_major = fw_info.version_major();
|
||||
let version_minor = fw_info.version_minor();
|
||||
let subversion = fw_info.subversion();
|
||||
|
||||
let sram2a_size = fw_info.sram2a_size();
|
||||
let sram2b_size = fw_info.sram2b_size();
|
||||
|
||||
info!(
|
||||
"version {}.{}.{} - SRAM2a {} - SRAM2b {}",
|
||||
version_major, version_minor, subversion, sram2a_size, sram2b_size
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Timer::after(Duration::from_millis(500)).await;
|
||||
}
|
||||
|
||||
info!("Test OK");
|
||||
cortex_m::asm::bkpt();
|
||||
}
|
Loading…
Reference in New Issue
Block a user