diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/Cargo.toml | 4 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/radio_ble_advertising.rs | 42 |
2 files changed, 0 insertions, 46 deletions
diff --git a/examples/nrf52840/Cargo.toml b/examples/nrf52840/Cargo.toml index 0239583cd..78dabe347 100644 --- a/examples/nrf52840/Cargo.toml +++ b/examples/nrf52840/Cargo.toml | |||
| @@ -35,10 +35,6 @@ embedded-hal-async = { version = "1.0" } | |||
| 35 | embedded-hal-bus = { version = "0.1", features = ["async"] } | 35 | embedded-hal-bus = { version = "0.1", features = ["async"] } |
| 36 | num-integer = { version = "0.1.45", default-features = false } | 36 | num-integer = { version = "0.1.45", default-features = false } |
| 37 | microfft = "0.5.0" | 37 | microfft = "0.5.0" |
| 38 | jewel = { version = "0.1.0", git = "https://github.com/jewel-rs/jewel"} | ||
| 39 | |||
| 40 | [patch.crates-io] | ||
| 41 | embassy-time = { version = "0.3.0", path = "../../embassy-time"} | ||
| 42 | 38 | ||
| 43 | [profile.release] | 39 | [profile.release] |
| 44 | debug = 2 | 40 | debug = 2 |
diff --git a/examples/nrf52840/src/bin/radio_ble_advertising.rs b/examples/nrf52840/src/bin/radio_ble_advertising.rs deleted file mode 100644 index 8898c2418..000000000 --- a/examples/nrf52840/src/bin/radio_ble_advertising.rs +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | #![no_std] | ||
| 2 | #![no_main] | ||
| 3 | |||
| 4 | use defmt::{info, unwrap}; | ||
| 5 | use embassy_executor::Spawner; | ||
| 6 | use embassy_nrf::{bind_interrupts, peripherals, radio}; | ||
| 7 | use embassy_time::Timer; | ||
| 8 | use jewel::phy::Radio; | ||
| 9 | use {defmt_rtt as _, panic_probe as _}; | ||
| 10 | |||
| 11 | bind_interrupts!(struct Irqs { | ||
| 12 | RADIO => radio::InterruptHandler<peripherals::RADIO>; | ||
| 13 | }); | ||
| 14 | |||
| 15 | // For a high-level API look on jewel examples | ||
| 16 | #[embassy_executor::main] | ||
| 17 | async fn main(_spawner: Spawner) { | ||
| 18 | let mut config = embassy_nrf::config::Config::default(); | ||
| 19 | config.hfclk_source = embassy_nrf::config::HfclkSource::ExternalXtal; | ||
| 20 | let p = embassy_nrf::init(config); | ||
| 21 | |||
| 22 | info!("Starting BLE radio"); | ||
| 23 | let mut radio = radio::ble::Radio::new(p.RADIO, Irqs); | ||
| 24 | |||
| 25 | let pdu = [ | ||
| 26 | 0x46u8, // ADV_NONCONN_IND, Random address, | ||
| 27 | 0x18, // Length of payload | ||
| 28 | 0x27, 0xdc, 0xd0, 0xe8, 0xe1, 0xff, // Adress | ||
| 29 | 0x02, 0x01, 0x06, // Flags | ||
| 30 | 0x03, 0x03, 0x09, 0x18, // Complete list of 16-bit UUIDs available | ||
| 31 | 0x0A, 0x09, // Length, Type: Device name | ||
| 32 | b'H', b'e', b'l', b'l', b'o', b'R', b'u', b's', b't', | ||
| 33 | ]; | ||
| 34 | |||
| 35 | unwrap!(radio.set_buffer(pdu.as_ref())); | ||
| 36 | |||
| 37 | loop { | ||
| 38 | info!("Sending packet"); | ||
| 39 | radio.transmit().await; | ||
| 40 | Timer::after_millis(500).await; | ||
| 41 | } | ||
| 42 | } | ||
