aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/nrf52840/Cargo.toml4
-rw-r--r--examples/nrf52840/src/bin/radio_ble_advertising.rs42
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" }
35embedded-hal-bus = { version = "0.1", features = ["async"] } 35embedded-hal-bus = { version = "0.1", features = ["async"] }
36num-integer = { version = "0.1.45", default-features = false } 36num-integer = { version = "0.1.45", default-features = false }
37microfft = "0.5.0" 37microfft = "0.5.0"
38jewel = { version = "0.1.0", git = "https://github.com/jewel-rs/jewel"}
39
40[patch.crates-io]
41embassy-time = { version = "0.3.0", path = "../../embassy-time"}
42 38
43[profile.release] 39[profile.release]
44debug = 2 40debug = 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
4use defmt::{info, unwrap};
5use embassy_executor::Spawner;
6use embassy_nrf::{bind_interrupts, peripherals, radio};
7use embassy_time::Timer;
8use jewel::phy::Radio;
9use {defmt_rtt as _, panic_probe as _};
10
11bind_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]
17async 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}