diff options
| author | xoviat <[email protected]> | 2025-12-06 10:32:51 -0600 |
|---|---|---|
| committer | xoviat <[email protected]> | 2025-12-06 10:32:51 -0600 |
| commit | 92f814962bbef71ef2f541f0d4dade54e6c58b11 (patch) | |
| tree | 6e26c0b7f99aedaf5f432d6f6f2c634e4d8c53a4 /examples/stm32wba | |
| parent | d136c8e2ff3ef3360f3e56055bcfba5b221e38fa (diff) | |
wpan: add libraries for wba
Diffstat (limited to 'examples/stm32wba')
| -rw-r--r-- | examples/stm32wba/Cargo.toml | 4 | ||||
| -rw-r--r-- | examples/stm32wba/src/bin/mac_ffd.rs | 58 |
2 files changed, 60 insertions, 2 deletions
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" | |||
| 6 | publish = false | 6 | publish = false |
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba55cg", "time-driver-any", "memory-x", "exti"] } | 9 | embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = [ "defmt", "stm32wba52cg", "time-driver-any", "memory-x", "exti"] } |
| 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wba55cg"] } | 10 | embassy-stm32-wpan = { version = "0.1.0", path = "../../embassy-stm32-wpan", features = ["defmt", "stm32wba52cg"] } |
| 11 | embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] } |
| 12 | embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] } | 12 | embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt"] } |
| 13 | embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 13 | 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 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::*; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_stm32::Config; | ||
| 7 | use embassy_stm32::rcc::{Sysclk, mux}; | ||
| 8 | use embassy_stm32_wpan::bindings::mac::ST_MAC_callbacks_t; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | ||
| 10 | |||
| 11 | static _MAC_CALLBACKS: ST_MAC_callbacks_t = ST_MAC_callbacks_t { | ||
| 12 | mlmeAssociateCnfCb: None, // ST_MAC_MLMEAssociateCnfCbPtr, | ||
| 13 | mlmeAssociateIndCb: None, // ST_MAC_MLMEAssociateIndCbPtr, | ||
| 14 | mlmeBeaconNotifyIndCb: None, // ST_MAC_MLMEBeaconNotifyIndCbPtr, | ||
| 15 | mlmeCalibrateCnfCb: None, // ST_MAC_MLMECalibrateCnfCbPtr, | ||
| 16 | mlmeCommStatusIndCb: None, // ST_MAC_MLMECommStatusIndCbPtr, | ||
| 17 | mlmeDisassociateCnfCb: None, // ST_MAC_MLMEDisassociateCnfCbPtr, | ||
| 18 | mlmeDisassociateIndCb: None, // ST_MAC_MLMEDisassociateIndCbPtr, | ||
| 19 | mlmeDpsCnfCb: None, // ST_MAC_MLMEDpsCnfCbPtr, | ||
| 20 | mlmeDpsIndCb: None, // ST_MAC_MLMEDpsIndCbPtr, | ||
| 21 | mlmeGetCnfCb: None, // ST_MAC_MLMEGetCnfCbPtr, | ||
| 22 | mlmeGtsCnfCb: None, // ST_MAC_MLMEGtsCnfCbPtr, | ||
| 23 | mlmeGtsIndCb: None, // ST_MAC_MLMEGtsIndCbPtr, | ||
| 24 | mlmeOrphanIndCb: None, // ST_MAC_MLMEOrphanIndCbPtr, | ||
| 25 | mlmePollCnfCb: None, // ST_MAC_MLMEPollCnfCbPtr, | ||
| 26 | mlmeResetCnfCb: None, // ST_MAC_MLMEResetCnfCbPtr, | ||
| 27 | mlmeRxEnableCnfCb: None, // ST_MAC_MLMERxEnableCnfCbPtr, | ||
| 28 | mlmeScanCnfCb: None, // ST_MAC_MLMEScanCnfCbPtr, | ||
| 29 | mlmeSetCnfCb: None, // ST_MAC_MLMESetCnfCbPtr, | ||
| 30 | mlmeSoundingCnfCb: None, // ST_MAC_MLMESoundingCnfCbPtr, | ||
| 31 | mlmeStartCnfCb: None, // ST_MAC_MLMEStartCnfCbPtr, | ||
| 32 | mlmeSyncLossIndCb: None, // ST_MAC_MLMESyncLossIndCbPtr, | ||
| 33 | mcpsDataIndCb: None, // ST_MAC_MCPSDataIndCbPtr, | ||
| 34 | mcpsDataCnfCb: None, // ST_MAC_MCPSDataCnfCbPtr, | ||
| 35 | mcpsPurgeCnfCb: None, // ST_MAC_MCPSPurgeCnfCbPtr, | ||
| 36 | mlmePollIndCb: None, // ST_MAC_MLMEPollIndCbPtr, | ||
| 37 | mlmeBeaconReqIndCb: None, // ST_MAC_MLMEBeaconReqIndCbPtr, | ||
| 38 | mlmeBeaconCnfCb: None, // ST_MAC_MLMEBeaconCnfCbPtr, | ||
| 39 | mlmeGetPwrInfoTableCnfCb: None, // ST_MAC_MLMEGetPwrInfoTableCnfCbPtr, | ||
| 40 | mlmeSetPwrInfoTableCnfCb: None, // ST_MAC_MLMESetPwrInfoTableCnfCbPtr, | ||
| 41 | }; | ||
| 42 | |||
| 43 | #[embassy_executor::main] | ||
| 44 | async fn main(_spawner: Spawner) { | ||
| 45 | let mut config = Config::default(); | ||
| 46 | |||
| 47 | config.rcc.sys = Sysclk::HSI; | ||
| 48 | config.rcc.mux.rngsel = mux::Rngsel::HSI; | ||
| 49 | |||
| 50 | let _p = embassy_stm32::init(config); | ||
| 51 | info!("Hello World!"); | ||
| 52 | |||
| 53 | // let status = unsafe { ST_MAC_init(&_MAC_CALLBACKS as *const _ as *mut _) }; | ||
| 54 | // | ||
| 55 | // info!("mac init: {}", status); | ||
| 56 | |||
| 57 | cortex_m::asm::bkpt(); | ||
| 58 | } | ||
