diff options
| author | Lofty Inclination <[email protected]> | 2025-01-01 01:31:03 +0000 |
|---|---|---|
| committer | Lofty Inclination <[email protected]> | 2025-01-01 01:38:30 +0000 |
| commit | c6e0508da0e5a8689b833c60e0d8e59b922ebd8f (patch) | |
| tree | 2c2a1f10bdafbdd2bed2f655c544f91af4503417 | |
| parent | 81948b3f2f0cf8f5b671b05e8d16f077ad4483bd (diff) | |
Add example to doc for BLE initialisation
| -rw-r--r-- | embassy-stm32-wpan/src/sub/ble.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/embassy-stm32-wpan/src/sub/ble.rs b/embassy-stm32-wpan/src/sub/ble.rs index 37a2f3b0c..0f770d92c 100644 --- a/embassy-stm32-wpan/src/sub/ble.rs +++ b/embassy-stm32-wpan/src/sub/ble.rs | |||
| @@ -17,6 +17,25 @@ use crate::{channels, evt}; | |||
| 17 | /// [crate::sub::sys::Sys::read] before sending any of these commands, and to call | 17 | /// [crate::sub::sys::Sys::read] before sending any of these commands, and to call |
| 18 | /// [crate::sub::sys::Sys::shci_c2_ble_init] and await the HCI_COMMAND_COMPLETE_EVENT before | 18 | /// [crate::sub::sys::Sys::shci_c2_ble_init] and await the HCI_COMMAND_COMPLETE_EVENT before |
| 19 | /// sending any other commands. | 19 | /// sending any other commands. |
| 20 | /// | ||
| 21 | /// # Example | ||
| 22 | /// | ||
| 23 | /// ``` | ||
| 24 | /// # embassy_stm32::bind_interrupts!(struct Irqs{ | ||
| 25 | /// # IPCC_C1_RX => ReceiveInterruptHandler; | ||
| 26 | /// # IPCC_C1_TX => TransmitInterruptHandler; | ||
| 27 | /// # }); | ||
| 28 | /// # | ||
| 29 | /// # let p = embassy_stm32::init(embassy_stm32::Config::default()); | ||
| 30 | /// # let mut mbox = embassy_stm32_wpan::TlMbox::init(p.IPCC, Irqs, embassy_stm32::ipcc::Config::default()); | ||
| 31 | /// # | ||
| 32 | /// # let sys_event = mbox.sys_subsystem.read().await; | ||
| 33 | /// # let _command_status = mbox.sys_subsystem.shci_c2_ble_init(Default::default()); | ||
| 34 | /// # // BLE commands may now be sent | ||
| 35 | /// # | ||
| 36 | /// # mbox.ble_subsystem.reset().await; | ||
| 37 | /// # let _reset_response = mbox.ble_subsystem.read().await; | ||
| 38 | /// ``` | ||
| 20 | pub struct Ble { | 39 | pub struct Ble { |
| 21 | _private: (), | 40 | _private: (), |
| 22 | } | 41 | } |
