From 92f814962bbef71ef2f541f0d4dade54e6c58b11 Mon Sep 17 00:00:00 2001 From: xoviat Date: Sat, 6 Dec 2025 10:32:51 -0600 Subject: wpan: add libraries for wba --- examples/stm32wba/Cargo.toml | 4 +-- examples/stm32wba/src/bin/mac_ffd.rs | 58 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 examples/stm32wba/src/bin/mac_ffd.rs (limited to 'examples') diff --git a/examples/stm32wba/Cargo.toml b/examples/stm32wba/Cargo.toml index e071b24f0..b10114420 100644 --- a/examples/stm32wba/Cargo.toml +++ b/examples/stm32wba/Cargo.toml @@ -6,8 +6,8 @@ license = "MIT OR Apache-2.0" publish = false [dependencies] -embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba55cg", "time-driver-any", "memory-x", "exti"] } -embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wba55cg"] } +embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } +embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wba52cg"] } embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] } embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] } embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } diff --git a/examples/stm32wba/src/bin/mac_ffd.rs b/examples/stm32wba/src/bin/mac_ffd.rs new file mode 100644 index 000000000..b15fb3452 --- /dev/null +++ b/examples/stm32wba/src/bin/mac_ffd.rs @@ -0,0 +1,58 @@ +#![no_std] +#![no_main] + +use defmt::*; +use embassy_executor::Spawner; +use embassy_stm32::Config; +use embassy_stm32::rcc::{Sysclk, mux}; +use embassy_stm32_wpan::bindings::mac::ST_MAC_callbacks_t; +use {defmt_rtt as _, panic_probe as _}; + +static _MAC_CALLBACKS: ST_MAC_callbacks_t = ST_MAC_callbacks_t { + mlmeAssociateCnfCb: None, // ST_MAC_MLMEAssociateCnfCbPtr, + mlmeAssociateIndCb: None, // ST_MAC_MLMEAssociateIndCbPtr, + mlmeBeaconNotifyIndCb: None, // ST_MAC_MLMEBeaconNotifyIndCbPtr, + mlmeCalibrateCnfCb: None, // ST_MAC_MLMECalibrateCnfCbPtr, + mlmeCommStatusIndCb: None, // ST_MAC_MLMECommStatusIndCbPtr, + mlmeDisassociateCnfCb: None, // ST_MAC_MLMEDisassociateCnfCbPtr, + mlmeDisassociateIndCb: None, // ST_MAC_MLMEDisassociateIndCbPtr, + mlmeDpsCnfCb: None, // ST_MAC_MLMEDpsCnfCbPtr, + mlmeDpsIndCb: None, // ST_MAC_MLMEDpsIndCbPtr, + mlmeGetCnfCb: None, // ST_MAC_MLMEGetCnfCbPtr, + mlmeGtsCnfCb: None, // ST_MAC_MLMEGtsCnfCbPtr, + mlmeGtsIndCb: None, // ST_MAC_MLMEGtsIndCbPtr, + mlmeOrphanIndCb: None, // ST_MAC_MLMEOrphanIndCbPtr, + mlmePollCnfCb: None, // ST_MAC_MLMEPollCnfCbPtr, + mlmeResetCnfCb: None, // ST_MAC_MLMEResetCnfCbPtr, + mlmeRxEnableCnfCb: None, // ST_MAC_MLMERxEnableCnfCbPtr, + mlmeScanCnfCb: None, // ST_MAC_MLMEScanCnfCbPtr, + mlmeSetCnfCb: None, // ST_MAC_MLMESetCnfCbPtr, + mlmeSoundingCnfCb: None, // ST_MAC_MLMESoundingCnfCbPtr, + mlmeStartCnfCb: None, // ST_MAC_MLMEStartCnfCbPtr, + mlmeSyncLossIndCb: None, // ST_MAC_MLMESyncLossIndCbPtr, + mcpsDataIndCb: None, // ST_MAC_MCPSDataIndCbPtr, + mcpsDataCnfCb: None, // ST_MAC_MCPSDataCnfCbPtr, + mcpsPurgeCnfCb: None, // ST_MAC_MCPSPurgeCnfCbPtr, + mlmePollIndCb: None, // ST_MAC_MLMEPollIndCbPtr, + mlmeBeaconReqIndCb: None, // ST_MAC_MLMEBeaconReqIndCbPtr, + mlmeBeaconCnfCb: None, // ST_MAC_MLMEBeaconCnfCbPtr, + mlmeGetPwrInfoTableCnfCb: None, // ST_MAC_MLMEGetPwrInfoTableCnfCbPtr, + mlmeSetPwrInfoTableCnfCb: None, // ST_MAC_MLMESetPwrInfoTableCnfCbPtr, +}; + +#[embassy_executor::main] +async fn main(_spawner: Spawner) { + let mut config = Config::default(); + + config.rcc.sys = Sysclk::HSI; + config.rcc.mux.rngsel = mux::Rngsel::HSI; + + let _p = embassy_stm32::init(config); + info!("Hello World!"); + + // let status = unsafe { ST_MAC_init(&_MAC_CALLBACKS as *const _ as *mut _) }; + // + // info!("mac init: {}", status); + + cortex_m::asm::bkpt(); +} -- cgit