diff options
| author | xoviat <[email protected]> | 2023-06-13 02:25:45 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-13 02:25:45 +0000 |
| commit | 0053a8a1a7a2cced6179f0b0303fe2ccf173a662 (patch) | |
| tree | c765d9f88c3a7393533ddbb5e116136f1d990d80 /tests | |
| parent | 9cfcc5b89afb8fee9371af3bfbe8480deb2ef634 (diff) | |
| parent | 3c98587a884e7c13d4b3203669866e23ad05003a (diff) | |
Merge pull request #1555 from xoviat/old-tl-mbox
wip: old tl mbox
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/Cargo.toml | 5 | ||||
| -rw-r--r-- | tests/stm32/src/bin/tl_mbox.rs | 20 |
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 | |||
| 12 | stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] # Nucleo | 12 | stm32c031c6 = ["embassy-stm32/stm32c031c6", "not-gpdma"] # Nucleo |
| 13 | stm32g491re = ["embassy-stm32/stm32g491re", "not-gpdma"] # Nucleo | 13 | stm32g491re = ["embassy-stm32/stm32g491re", "not-gpdma"] # Nucleo |
| 14 | stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "not-gpdma"] # Nucleo | 14 | stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "not-gpdma"] # Nucleo |
| 15 | stm32wb55rg = ["embassy-stm32/stm32wb55rg", "not-gpdma", "ble"] # Nucleo | 15 | stm32wb55rg = ["embassy-stm32/stm32wb55rg", "not-gpdma" ] # Nucleo |
| 16 | stm32h563zi = ["embassy-stm32/stm32h563zi"] # Nucleo | 16 | stm32h563zi = ["embassy-stm32/stm32h563zi"] # Nucleo |
| 17 | stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board | 17 | stm32u585ai = ["embassy-stm32/stm32u585ai"] # IoT board |
| 18 | 18 | ||
| 19 | sdmmc = [] | 19 | sdmmc = [] |
| 20 | chrono = ["embassy-stm32/chrono", "dep:chrono"] | 20 | chrono = ["embassy-stm32/chrono", "dep:chrono"] |
| 21 | ble = [] | 21 | ble = ["dep:embassy-stm32-wpan"] |
| 22 | not-gpdma = [] | 22 | not-gpdma = [] |
| 23 | 23 | ||
| 24 | [dependencies] | 24 | [dependencies] |
| @@ -29,6 +29,7 @@ embassy-executor = { version = "0.2.0", path = "../../embassy-executor", feature | |||
| 29 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } | 29 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } |
| 30 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } | 30 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } |
| 31 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 31 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 32 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", optional = true, features = ["defmt", "stm32wb55rg"] } | ||
| 32 | 33 | ||
| 33 | defmt = "0.3.0" | 34 | defmt = "0.3.0" |
| 34 | defmt-rtt = "0.4" | 35 | defmt-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 | ||
| 9 | use common::*; | 9 | use common::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_stm32::tl_mbox::{Config, TlMbox}; | 11 | use embassy_stm32::bind_interrupts; |
| 12 | use embassy_stm32::{bind_interrupts, tl_mbox}; | 12 | use embassy_stm32::ipcc::Config; |
| 13 | use embassy_stm32_wpan::TlMbox; | ||
| 13 | use embassy_time::{Duration, Timer}; | 14 | use embassy_time::{Duration, Timer}; |
| 14 | 15 | ||
| 15 | bind_interrupts!(struct Irqs{ | 16 | bind_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 | } |
