aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-06-13 02:25:45 +0000
committerGitHub <[email protected]>2023-06-13 02:25:45 +0000
commit0053a8a1a7a2cced6179f0b0303fe2ccf173a662 (patch)
treec765d9f88c3a7393533ddbb5e116136f1d990d80 /tests
parent9cfcc5b89afb8fee9371af3bfbe8480deb2ef634 (diff)
parent3c98587a884e7c13d4b3203669866e23ad05003a (diff)
Merge pull request #1555 from xoviat/old-tl-mbox
wip: old tl mbox
Diffstat (limited to 'tests')
-rw-r--r--tests/stm32/Cargo.toml5
-rw-r--r--tests/stm32/src/bin/tl_mbox.rs20
2 files changed, 18 insertions, 7 deletions
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml
index 3f48bf3f1..dcc7d9b8a 100644
--- a/tests/stm32/Cargo.toml
+++ b/tests/stm32/Cargo.toml
@@ -12,13 +12,13 @@ stm32g071rb = ["embassy-stm32/stm32g071rb", "not-gpdma"] # Nucleo
12stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] # Nucleo 12stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] # Nucleo
13stm32g491re = ["embassy-stm32/stm32g491re", "not-gpdma"] # Nucleo 13stm32g491re = ["embassy-stm32/stm32g491re", "not-gpdma"] # Nucleo
14stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "not-gpdma"] # Nucleo 14stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "not-gpdma"] # Nucleo
15stm32wb55rg = ["embassy-stm32/stm32wb55rg", "not-gpdma", "ble"] # Nucleo 15stm32wb55rg = ["embassy-stm32/stm32wb55rg", "not-gpdma" ] # Nucleo
16stm32h563zi = ["embassy-stm32/stm32h563zi"] # Nucleo 16stm32h563zi = ["embassy-stm32/stm32h563zi"] # Nucleo
17stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board 17stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board
18 18
19sdmmc = [] 19sdmmc = []
20chrono = ["embassy-stm32/chrono", "dep:chrono"] 20chrono = ["embassy-stm32/chrono", "dep:chrono"]
21ble = [] 21ble = ["dep:embassy-stm32-wpan"]
22not-gpdma = [] 22not-gpdma = []
23 23
24[dependencies] 24[dependencies]
@@ -29,6 +29,7 @@ embassy-executor = { version = "0.2.0", path = "../../embassy-executor", feature
29embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } 29embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] }
30embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } 30embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] }
31embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 31embassy-futures = { version = "0.1.0", path = "../../embassy-futures" }
32embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg"] }
32 33
33defmt = "0.3.0" 34defmt = "0.3.0"
34defmt-rtt = "0.4" 35defmt-rtt = "0.4"
diff --git a/tests/stm32/src/bin/tl_mbox.rs b/tests/stm32/src/bin/tl_mbox.rs
index fab9f0e1b..b57519a54 100644
--- a/tests/stm32/src/bin/tl_mbox.rs
+++ b/tests/stm32/src/bin/tl_mbox.rs
@@ -8,13 +8,14 @@ mod common;
8 8
9use common::*; 9use common::*;
10use embassy_executor::Spawner; 10use embassy_executor::Spawner;
11use embassy_stm32::tl_mbox::{Config, TlMbox}; 11use embassy_stm32::bind_interrupts;
12use embassy_stm32::{bind_interrupts, tl_mbox}; 12use embassy_stm32::ipcc::Config;
13use embassy_stm32_wpan::TlMbox;
13use embassy_time::{Duration, Timer}; 14use embassy_time::{Duration, Timer};
14 15
15bind_interrupts!(struct Irqs{ 16bind_interrupts!(struct Irqs{
16 IPCC_C1_RX => tl_mbox::ReceiveInterruptHandler; 17 IPCC_C1_RX => embassy_stm32_wpan::ReceiveInterruptHandler;
17 IPCC_C1_TX => tl_mbox::TransmitInterruptHandler; 18 IPCC_C1_TX => embassy_stm32_wpan::TransmitInterruptHandler;
18}); 19});
19 20
20#[embassy_executor::main] 21#[embassy_executor::main]
@@ -23,7 +24,7 @@ async fn main(_spawner: Spawner) {
23 info!("Hello World!"); 24 info!("Hello World!");
24 25
25 let config = Config::default(); 26 let config = Config::default();
26 let mbox = TlMbox::new(p.IPCC, Irqs, config); 27 let mbox = TlMbox::init(p.IPCC, Irqs, config);
27 28
28 loop { 29 loop {
29 let wireless_fw_info = mbox.wireless_fw_info(); 30 let wireless_fw_info = mbox.wireless_fw_info();
@@ -49,6 +50,15 @@ async fn main(_spawner: Spawner) {
49 Timer::after(Duration::from_millis(50)).await; 50 Timer::after(Duration::from_millis(50)).await;
50 } 51 }
51 52
53 // let mut rc = RadioCoprocessor::new(mbox);
54 //
55 // let response = rc.read().await;
56 // info!("coprocessor ready {}", response);
57 //
58 // rc.write(&[0x01, 0x03, 0x0c, 0x00, 0x00]);
59 // let response = rc.read().await;
60 // info!("ble reset rsp {}", response);
61
52 info!("Test OK"); 62 info!("Test OK");
53 cortex_m::asm::bkpt(); 63 cortex_m::asm::bkpt();
54} 64}