From 72fd648d92738546b03166922defd4bee2d5fa9d Mon Sep 17 00:00:00 2001 From: xoviat Date: Sun, 18 Jun 2023 18:56:53 -0500 Subject: [PATCH] stm32/wpan: add shci mac init --- embassy-stm32-wpan/src/sys.rs | 6 ++++++ examples/stm32wb/src/bin/tl_mbox_mac.rs | 18 +++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/embassy-stm32-wpan/src/sys.rs b/embassy-stm32-wpan/src/sys.rs index 5fe09a20f..65a64e090 100644 --- a/embassy-stm32-wpan/src/sys.rs +++ b/embassy-stm32-wpan/src/sys.rs @@ -61,6 +61,12 @@ impl Sys { } } + #[cfg(feature = "mac")] + pub async fn shci_c2_mac_802_15_4_init(&self) -> SchiCommandStatus { + self.write_and_get_response(ShciOpcode::Mac802_15_4Init, &[]).await + } + + #[cfg(feature = "ble")] pub async fn shci_c2_ble_init(&self, param: ShciBleInitCmdParam) -> SchiCommandStatus { self.write_and_get_response(ShciOpcode::BleInit, param.payload()).await } diff --git a/examples/stm32wb/src/bin/tl_mbox_mac.rs b/examples/stm32wb/src/bin/tl_mbox_mac.rs index f13f260b5..a42939bbd 100644 --- a/examples/stm32wb/src/bin/tl_mbox_mac.rs +++ b/examples/stm32wb/src/bin/tl_mbox_mac.rs @@ -49,15 +49,15 @@ async fn main(_spawner: Spawner) { let sys_event = mbox.sys_subsystem.read().await; info!("sys event: {}", sys_event.payload()); -// mbox.sys_subsystem.shci_c2_ble_init(Default::default()).await; -// -// info!("starting ble..."); -// mbox.ble_subsystem.write(0x0c, &[]).await; -// -// info!("waiting for ble..."); -// let ble_event = mbox.ble_subsystem.read().await; -// -// info!("ble event: {}", ble_event.payload()); + mbox.sys_subsystem.shci_c2_mac_802_15_4_init().await; + // + // info!("starting ble..."); + // mbox.ble_subsystem.write(0x0c, &[]).await; + // + // info!("waiting for ble..."); + // let ble_event = mbox.ble_subsystem.read().await; + // + // info!("ble event: {}", ble_event.payload()); info!("Test OK"); cortex_m::asm::bkpt();