summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDario Nieuwenhuis <dirbaio@dirbaio.net>2021-05-10 00:24:24 +0200
committerDario Nieuwenhuis <dirbaio@dirbaio.net>2021-05-10 00:24:24 +0200
commit8201255a9d6dde4b29a5a539a1d6aeefcbd467df (patch)
tree3366939a2c4b121091eb1abb3605f82e750b5c2f /examples
parent7e0bf163f35dca8a1daba11429035a7780f5f4b7 (diff)
downloadnrf-softdevice-8201255a9d6dde4b29a5a539a1d6aeefcbd467df.zip
Update embassy
Diffstat (limited to 'examples')
-rw-r--r--examples/Cargo.toml13
-rw-r--r--examples/src/bin/ble_bas_central.rs11
-rw-r--r--examples/src/bin/ble_bas_peripheral.rs13
-rw-r--r--examples/src/bin/ble_l2cap_central.rs10
-rw-r--r--examples/src/bin/ble_l2cap_peripheral.rs17
-rw-r--r--examples/src/bin/ble_peripheral_onoff.rs36
-rw-r--r--examples/src/bin/ble_scan.rs11
-rw-r--r--examples/src/bin/flash.rs15
-rw-r--r--examples/src/bin/rtic.rs168
-rw-r--r--examples/src/example_common.rs146
10 files changed, 59 insertions, 381 deletions
diff --git a/examples/Cargo.toml b/examples/Cargo.toml
index 09449c6..6b54d8a 100644
--- a/examples/Cargo.toml
+++ b/examples/Cargo.toml
@@ -28,23 +28,16 @@ embassy-traits = { version = "0.1.0", features = ["defmt"]}
embassy-nrf = { version = "0.1.0", features = [ "defmt", "52840" ]}
cortex-m = { version = "0.6.4" }
cortex-m-rt = "0.6.13"
-cortex-m-rtic = { version = "0.5.5", optional = true }
defmt = { version = "0.2.0", features = ["alloc"] }
nrf-softdevice-defmt-rtt = { path = "../nrf-softdevice-defmt-rtt", version = "0.1.0" }
panic-probe = "0.1.0"
-nrf52840-hal = { version = "0.12.0" }
-nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["defmt", "defmt-trace", "nrf52840", "s140", "ble-peripheral", "ble-central"] }
+nrf-softdevice = { version = "0.1.0", path = "../nrf-softdevice", features = ["defmt", "defmt-trace", "nrf52840", "s140", "ble-peripheral", "ble-central", "critical-section-impl"] }
nrf-softdevice-s140 = { version = "0.1.1", path = "../nrf-softdevice-s140" }
futures = { version = "0.3.5", default-features = false }
fixed = "1.2.0"
heapless = "0.5.6"
alloc-cortex-m = "0.4.0"
-
-[[bin]]
-name = "rtic"
-required-features = ["cortex-m-rtic"]
-
[[bin]]
name = "ble_bas_peripheral"
required-features = ["ble-gatt-server"]
@@ -60,7 +53,3 @@ required-features = ["ble-gatt-server"]
[[bin]]
name = "flash"
required-features = []
-
-[[bin]]
-name = "interrupts"
-required-features = []
diff --git a/examples/src/bin/ble_bas_central.rs b/examples/src/bin/ble_bas_central.rs
index 5e56d9d..8911ca8 100644
--- a/examples/src/bin/ble_bas_central.rs
+++ b/examples/src/bin/ble_bas_central.rs
@@ -4,16 +4,16 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
#[path = "../example_common.rs"]
mod example_common;
-use example_common::*;
use core::mem;
use cortex_m_rt::entry;
use defmt::info;
use defmt::*;
-use embassy::executor::{task, Executor};
+use embassy::executor::Executor;
use embassy::util::Forever;
use nrf_softdevice::ble::{central, gatt_client, Address, AddressType};
@@ -22,7 +22,7 @@ use nrf_softdevice::Softdevice;
static EXECUTOR: Forever<Executor> = Forever::new();
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -33,7 +33,7 @@ struct BatteryServiceClient {
battery_level: u8,
}
-#[task]
+#[embassy::task]
async fn ble_central_task(sd: &'static Softdevice) {
let addrs = &[&Address::new(
AddressType::RandomStatic,
@@ -97,8 +97,7 @@ fn main() -> ! {
..Default::default()
};
- let (sdp, _p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &config);
+ let sd = Softdevice::enable(&config);
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
diff --git a/examples/src/bin/ble_bas_peripheral.rs b/examples/src/bin/ble_bas_peripheral.rs
index e2a7846..949a5cc 100644
--- a/examples/src/bin/ble_bas_peripheral.rs
+++ b/examples/src/bin/ble_bas_peripheral.rs
@@ -4,24 +4,24 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
#[path = "../example_common.rs"]
mod example_common;
-use example_common::*;
use core::mem;
use cortex_m_rt::entry;
use defmt::info;
use defmt::*;
+use embassy::executor::Executor;
+use embassy::util::Forever;
use nrf_softdevice::ble::{gatt_server, peripheral};
use nrf_softdevice::{raw, Softdevice};
-use embassy::executor::{task, Executor};
-use embassy::util::Forever;
static EXECUTOR: Forever<Executor> = Forever::new();
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -34,7 +34,7 @@ struct BatteryService {
foo: u16,
}
-#[task]
+#[embassy::task]
async fn bluetooth_task(sd: &'static Softdevice) {
let server: BatteryService = unwrap!(gatt_server::register(sd));
#[rustfmt::skip]
@@ -127,8 +127,7 @@ fn main() -> ! {
..Default::default()
};
- let (sdp, _p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &config);
+ let sd = Softdevice::enable(&config);
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
diff --git a/examples/src/bin/ble_l2cap_central.rs b/examples/src/bin/ble_l2cap_central.rs
index 179fff7..1bb4e3f 100644
--- a/examples/src/bin/ble_l2cap_central.rs
+++ b/examples/src/bin/ble_l2cap_central.rs
@@ -4,6 +4,7 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
extern crate alloc;
#[path = "../example_common.rs"]
@@ -16,7 +17,7 @@ use core::slice;
use cortex_m_rt::entry;
use defmt::info;
use defmt::*;
-use embassy::executor::{task, Executor};
+use embassy::executor::Executor;
use embassy::util::Forever;
use nrf_softdevice::ble::l2cap::Packet as _;
@@ -28,12 +29,12 @@ static EXECUTOR: Forever<Executor> = Forever::new();
const PSM: u16 = 0x2349;
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[task]
+#[embassy::task]
async fn ble_central_task(sd: &'static Softdevice) {
info!("Scanning for peer...");
@@ -173,8 +174,7 @@ fn main() -> ! {
..Default::default()
};
- let (sdp, _p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &config);
+ let sd = Softdevice::enable(&config);
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
diff --git a/examples/src/bin/ble_l2cap_peripheral.rs b/examples/src/bin/ble_l2cap_peripheral.rs
index c88869f..0ab7369 100644
--- a/examples/src/bin/ble_l2cap_peripheral.rs
+++ b/examples/src/bin/ble_l2cap_peripheral.rs
@@ -4,33 +4,33 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
extern crate alloc;
#[path = "../example_common.rs"]
mod example_common;
-use example_common::*;
use core::mem;
use core::ptr::NonNull;
use cortex_m_rt::entry;
use defmt::*;
+use embassy::executor::Executor;
+use embassy::util::Forever;
-use nrf_softdevice::ble;
use nrf_softdevice::ble::{l2cap, peripheral};
+use nrf_softdevice::{ble, RawError};
use nrf_softdevice::{raw, Softdevice};
-use embassy::executor::{task, Executor};
-use embassy::util::Forever;
static EXECUTOR: Forever<Executor> = Forever::new();
const PSM: u16 = 0x2349;
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[task]
+#[embassy::task]
async fn bluetooth_task(sd: &'static Softdevice) {
info!("My address: {:?}", ble::get_address(sd));
@@ -147,8 +147,9 @@ fn main() -> ! {
..Default::default()
};
- let (sdp, _p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &config);
+ unwrap!(RawError::convert(unsafe { raw::sd_clock_hfclk_request() }));
+
+ let sd = Softdevice::enable(&config);
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
diff --git a/examples/src/bin/ble_peripheral_onoff.rs b/examples/src/bin/ble_peripheral_onoff.rs
index b8535a0..8e53c15 100644
--- a/examples/src/bin/ble_peripheral_onoff.rs
+++ b/examples/src/bin/ble_peripheral_onoff.rs
@@ -4,28 +4,28 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
#[path = "../example_common.rs"]
mod example_common;
-use example_common::*;
use core::mem;
use cortex_m_rt::entry;
use defmt::{panic, *};
-use embassy::executor::{task, Executor};
+use embassy::executor::Executor;
use embassy::traits::gpio::WaitForLow;
use embassy::util::Forever;
-use embassy_nrf::gpiote::{Gpiote, GpiotePin};
+use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull};
+use embassy_nrf::gpiote::{self, PortInput};
use embassy_nrf::interrupt;
use futures::pin_mut;
-use nrf52840_hal::gpio;
use nrf_softdevice::ble::{gatt_server, peripheral};
-use nrf_softdevice::{pac, raw, Softdevice};
+use nrf_softdevice::{raw, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
@@ -76,18 +76,20 @@ async fn run_bluetooth(sd: &'static Softdevice, server: &FooService) {
}
}
-#[task]
-async fn bluetooth_task(sd: &'static Softdevice, gpiote: pac::GPIOTE, p0: pac::P0) {
+#[embassy::task]
+async fn bluetooth_task(
+ sd: &'static Softdevice,
+ gpiote: gpiote::Initialized,
+ button1: AnyPin,
+ button2: AnyPin,
+) {
let server: FooService = unwrap!(gatt_server::register(sd));
- let port0 = gpio::p0::Parts::new(p0);
- let (gpiote, _) = Gpiote::new(gpiote, interrupt::take!(GPIOTE));
-
info!("Bluetooth is OFF");
info!("Press nrf52840-dk button 1 to enable, button 2 to disable");
- let button1 = GpiotePin::new(gpiote, port0.p0_11.into_pullup_input().degrade());
- let button2 = GpiotePin::new(gpiote, port0.p0_12.into_pullup_input().degrade());
+ let button1 = PortInput::new(gpiote, Input::new(button1, Pull::Up));
+ let button2 = PortInput::new(gpiote, Input::new(button2, Pull::Up));
pin_mut!(button1);
pin_mut!(button2);
loop {
@@ -163,12 +165,14 @@ fn main() -> ! {
..Default::default()
};
- let (sdp, p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &config);
+ let sd = Softdevice::enable(&config);
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
+ let p = embassy_nrf::Peripherals::take().unwrap();
+ let g = gpiote::initialize(p.GPIOTE, interrupt::take!(GPIOTE));
+
unwrap!(spawner.spawn(softdevice_task(sd)));
- unwrap!(spawner.spawn(bluetooth_task(sd, p.GPIOTE, p.P0,)));
+ unwrap!(spawner.spawn(bluetooth_task(sd, g, p.P0_11.degrade(), p.P0_12.degrade())));
});
}
diff --git a/examples/src/bin/ble_scan.rs b/examples/src/bin/ble_scan.rs
index b0b3421..df23162 100644
--- a/examples/src/bin/ble_scan.rs
+++ b/examples/src/bin/ble_scan.rs
@@ -4,16 +4,16 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
#[path = "../example_common.rs"]
mod example_common;
-use example_common::*;
use core::mem;
use core::slice;
use cortex_m_rt::entry;
use defmt::*;
-use embassy::executor::{task, Executor};
+use embassy::executor::Executor;
use embassy::util::Forever;
use nrf_softdevice::ble::central;
@@ -22,12 +22,12 @@ use nrf_softdevice::Softdevice;
static EXECUTOR: Forever<Executor> = Forever::new();
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[task]
+#[embassy::task]
async fn ble_task(sd: &'static Softdevice) {
let config = central::ScanConfig::default();
let res = central::scan(sd, &config, |params| unsafe {
@@ -108,8 +108,7 @@ fn main() -> ! {
..Default::default()
};
- let (sdp, _p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &config);
+ let sd = Softdevice::enable(&config);
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
diff --git a/examples/src/bin/flash.rs b/examples/src/bin/flash.rs
index 174151d..3e5fe57 100644
--- a/examples/src/bin/flash.rs
+++ b/examples/src/bin/flash.rs
@@ -4,30 +4,30 @@
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(alloc_error_handler)]
+#![allow(incomplete_features)]
#[path = "../example_common.rs"]
mod example_common;
-use example_common::*;
use cortex_m_rt::entry;
use defmt::*;
-use embassy::executor::{task, Executor};
+use embassy::executor::Executor;
use embassy::traits::flash::Flash as _;
use embassy::util::Forever;
-
use futures::pin_mut;
+
use nrf_softdevice::{Flash, Softdevice};
static EXECUTOR: Forever<Executor> = Forever::new();
-#[task]
+#[embassy::task]
async fn softdevice_task(sd: &'static Softdevice) {
sd.run().await;
}
-#[task]
+#[embassy::task]
async fn flash_task(sd: &'static Softdevice) {
- let mut f = Flash::take(sd);
+ let f = Flash::take(sd);
pin_mut!(f);
info!("starting erase");
@@ -43,8 +43,7 @@ async fn flash_task(sd: &'static Softdevice) {
fn main() -> ! {
info!("Hello World!");
- let (sdp, _p) = take_peripherals();
- let sd = Softdevice::enable(sdp, &Default::default());
+ let sd = Softdevice::enable(&Default::default());
let executor = EXECUTOR.put(Executor::new());
executor.run(|spawner| {
diff --git a/examples/src/bin/rtic.rs b/examples/src/bin/rtic.rs
deleted file mode 100644
index f7511f6..0000000
--- a/examples/src/bin/rtic.rs
+++ /dev/null
@@ -1,168 +0,0 @@
-//! This example showcases how to use nrf-softdevice inside RTIC.
-//!
-//! It mixes RTIC's real-time interrupt-based multitasking with
-//! static-executor's cooperative async/await multitasking.
-//!
-//! static-executor is run in RTIC's idle task, at lowest priority, so all RTIC
-//! tasks will preempt async tasks if needed.
-//!
-//! Note that this is not fully safe: you must not use the softdevice's reserved
-//! priorities for RTIC tasks. There is no compile-time checking for that for now.
-
-#![no_main]
-#![no_std]
-#![feature(type_alias_impl_trait)]
-#![feature(min_type_alias_impl_trait)]
-#![feature(impl_trait_in_bindings)]
-#![feature(alloc_error_handler)]
-
-#[path = "../example_common.rs"]
-mod example_common;
-use example_common::*;
-
-use core::mem;
-use defmt::*;
-use embassy::executor::{task, Executor};
-use embassy::util::Forever;
-use nrf52840_hal::pac::TIMER1;
-use nrf52840_hal::prelude::*;
-use nrf52840_hal::timer::{Periodic, Timer};
-use rtic::app;
-
-use nrf_softdevice::ble::peripheral;
-use nrf_softdevice::{raw, temperature_celsius, Softdevice};
-
-static EXECUTOR: Forever<Executor> = Forever::new();
-
-#[task]
-async fn softdevice_task(sd: &'static Softdevice) {
- sd.run().await;
-}
-
-#[task]
-async fn bluetooth_task(sd: &'static Softdevice) {
- #[rustfmt::skip]
- let adv_data = &[
- 0x02, 0x01, raw::BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE as u8,
- 0x03, 0x03, 0x09, 0x18,
- 0x0a, 0x09, b'H', b'e', b'l', b'l', b'o', b'R', b'T', b'I', b'C',
- ];
- #[rustfmt::skip]
- let scan_data = &[
- 0x03, 0x03, 0x09, 0x18,
- ];
-
- loop {
- let config = peripheral::Config::default();
- let adv = peripheral::ConnectableAdvertisement::ScannableUndirected {
- adv_data,
- scan_data,
- };
- let _conn = unwrap!(peripheral::advertise(sd, adv, &config).await);
-
- info!("advertising done!");
- }
-}
-
-#[app(device = nrf52840_hal::pac, peripherals = true)]
-const APP: () = {
- struct Resources {
- timer: Timer<TIMER1, Periodic>,
- sd_peripherals: Option<nrf_softdevice::Peripherals>,
- }
-
- #[init()]
- fn init(cx: init::Context) -> init::LateResources {
- info!("init");
-
- let mut timer = Timer::new(cx.device.TIMER1);
- timer.enable_interrupt();
- let mut timer = timer.into_periodic();
- timer.start(1_000_000u32); // 1Mhz, so once per second
-
- let sd_peripherals = nrf_softdevice::Peripherals {
- AAR: cx.device.AAR,
- ACL: cx.device.ACL,
- CCM: cx.device.CCM,
- CLOCK: cx.device.CLOCK,
- ECB: cx.device.ECB,
- EGU1: cx.device.EGU1,
- EGU2: cx.device.EGU2,
- EGU5: cx.device.EGU5,
- MWU: cx.device.MWU,
- NVMC: cx.device.NVMC,
- POWER: cx.device.POWER,
- RADIO: cx.device.RADIO,
- RNG: cx.device.RNG,
- RTC0: cx.device.RTC0,
- SWI1: cx.device.SWI1,
- SWI2: cx.device.SWI2,
- SWI5: cx.device.SWI5,
- TEMP: cx.device.TEMP,
- TIMER0: cx.device.TIMER0,
- };
-
- init::LateResources {
- timer,
- sd_peripherals: Some(sd_peripherals),
- }
- }
-
- #[idle(resources=[sd_peripherals])]
- fn idle(cx: idle::Context) -> ! {
- let config = nrf_softdevice::Config {
- clock: Some(raw::nrf_clock_lf_cfg_t {
- source: raw::NRF_CLOCK_LF_SRC_XTAL as u8,
- rc_ctiv: 0,
- rc_temp_ctiv: 0,
- accuracy: 7,
- }),
- conn_gap: Some(raw::ble_gap_conn_cfg_t {
- conn_count: 6,
- event_length: 6,
- }),
- conn_gatt: Some(raw::ble_gatt_conn_cfg_t { att_mtu: 128 }),
- gatts_attr_tab_size: Some(raw::ble_gatts_cfg_attr_tab_size_t {
- attr_tab_size: 32768,
- }),
- gap_role_count: Some(raw::ble_gap_cfg_role_count_t {
- adv_set_count: 1,
- periph_role_count: 3,
- central_role_count: 3,
- central_sec_count: 0,
- _bitfield_1: raw::ble_gap_cfg_role_count_t::new_bitfield_1(0),
- }),
- gap_device_name: Some(raw::ble_gap_cfg_device_name_t {
- p_value: b"HelloRTIC" as *const u8 as _,
- current_len: 9,
- max_len: 9,
- write_perm: unsafe { mem::zeroed() },
- _bitfield_1: raw::ble_gap_cfg_device_name_t::new_bitfield_1(
- raw::BLE_GATTS_VLOC_STACK as u8,
- ),
- }),
- ..Default::default()
- };
-
- // Softdevice enable must not be done in RTIC init
- // because RTIC runs init with interrupts disabled, and the
- // softdevice crashes if it's enabled with interrupts disabled.
- let sdp = cx.resources.sd_peripherals.take().unwrap();
- let sd = Softdevice::enable(sdp, &config);
-
- let temp = unwrap!(temperature_celsius(&sd));
- info!("{}°C", temp.to_num::<i32>());
-
- let executor = EXECUTOR.put(Executor::new());
- executor.run(|spawner| {
- unwrap!(spawner.spawn(softdevice_task(sd)));
- unwrap!(spawner.spawn(bluetooth_task(sd)));
- });
- }
-
- #[task(binds = TIMER1, resources = [timer], priority = 1)]
- fn exec(cx: exec::Context) {
- cx.resources.timer.wait().unwrap();
- info!("tick");
- }
-};
diff --git a/examples/src/example_common.rs b/examples/src/example_common.rs
index c73099d..503e67a 100644
--- a/examples/src/example_common.rs
+++ b/examples/src/example_common.rs
@@ -1,14 +1,12 @@
#![macro_use]
-use nrf52840_hal as _;
-use nrf_softdevice::pac;
use nrf_softdevice_defmt_rtt as _; // global logger
use panic_probe as _;
use alloc_cortex_m::CortexMHeap;
use core::alloc::Layout;
use core::sync::atomic::{AtomicUsize, Ordering};
-use defmt::{panic, *};
+use defmt::panic;
// this is the allocator the application will use
#[global_allocator]
@@ -30,145 +28,3 @@ defmt::timestamp! {"{=u64}", {
n as u64
}
}
-
-// Take peripherals, split by softdevice and application
-pub fn take_peripherals() -> (nrf_softdevice::Peripherals, Peripherals) {
- // Initialize the allocator BEFORE you use it
- unsafe { ALLOCATOR.init(cortex_m_rt::heap_start() as usize, HEAP_SIZE) }
-
- let p = unwrap!(pac::Peripherals::take());
-
- (
- nrf_softdevice::Peripherals {
- AAR: p.AAR,
- ACL: p.ACL,
- CCM: p.CCM,
- CLOCK: p.CLOCK,
- ECB: p.ECB,
- EGU1: p.EGU1,
- EGU2: p.EGU2,
- EGU5: p.EGU5,
- MWU: p.MWU,
- NVMC: p.NVMC,
- POWER: p.POWER,
- RADIO: p.RADIO,
- RNG: p.RNG,
- RTC0: p.RTC0,
- SWI1: p.SWI1,
- SWI2: p.SWI2,
- SWI5: p.SWI5,
- TEMP: p.TEMP,
- TIMER0: p.TIMER0,
- },
- Peripherals {
- CC_HOST_RGF: p.CC_HOST_RGF,
- COMP: p.COMP,
- CRYPTOCELL: p.CRYPTOCELL,
- EGU0: p.EGU0,
- EGU3: p.EGU3,
- EGU4: p.EGU4,
- FICR: p.FICR,
- GPIOTE: p.GPIOTE,
- I2S: p.I2S,
- LPCOMP: p.LPCOMP,
- NFCT: p.NFCT,
- P0: p.P0,
- P1: p.P1,
- PDM: p.PDM,
- PPI: p.PPI,
- PWM0: p.PWM0,
- PWM1: p.PWM1,
- PWM2: p.PWM2,
- PWM3: p.PWM3,
- QDEC: p.QDEC,
- QSPI: p.QSPI,
- RTC2: p.RTC2,
- SAADC: p.SAADC,
- SPI0: p.SPI0,
- SPI1: p.SPI1,
- SPI2: p.SPI2,
- SPIM0: p.SPIM0,
- SPIM1: p.SPIM1,
- SPIM2: p.SPIM2,
- SPIM3: p.SPIM3,
- SPIS0: p.SPIS0,
- SPIS1: p.SPIS1,
- SPIS2: p.SPIS2,
- SWI0: p.SWI0,
- SWI3: p.SWI3,
- SWI4: p.SWI4,
- TIMER1: p.TIMER1,
- TIMER2: p.TIMER2,
- TIMER3: p.TIMER3,
- TIMER4: p.TIMER4,
- TWI0: p.TWI0,
- TWI1: p.TWI1,
- TWIM0: p.TWIM0,
- TWIM1: p.TWIM1,
- TWIS0: p.TWIS0,
- TWIS1: p.TWIS1,
- UART0: p.UART0,
- UARTE0: p.UARTE0,
- UARTE1: p.UARTE1,
- UICR: p.UICR,
- USBD: p.USBD,
- WDT: p.WDT,
- },
- )
-}
-
-#[allow(non_snake_case)]
-pub struct Peripherals {
- pub CC_HOST_RGF: pac::CC_HOST_RGF,
- pub COMP: pac::COMP,
- pub CRYPTOCELL: pac::CRYPTOCELL,
- pub EGU0: pac::EGU0,
- pub EGU3: pac::EGU3,
- pub EGU4: pac::EGU4,
- pub FICR: pac::FICR,
- pub GPIOTE: pac::GPIOTE,
- pub I2S: pac::I2S,
- pub LPCOMP: pac::LPCOMP,
- pub NFCT: pac::NFCT,
- pub P0: pac::P0,
- pub P1: pac::P1,
- pub PDM: pac::PDM,
- pub PPI: pac::PPI,
- pub PWM0: pac::PWM0,
- pub PWM1: pac::PWM1,
- pub PWM2: pac::PWM2,
- pub PWM3: pac::PWM3,
- pub QDEC: pac::QDEC,
- pub QSPI: pac::QSPI,
- pub RTC2: pac::RTC2,
- pub SAADC: pac::SAADC,
- pub SPI0: pac::SPI0,
- pub SPI1: pac::SPI1,
- pub SPI2: pac::SPI2,
- pub SPIM0: pac::SPIM0,
- pub SPIM1: pac::SPIM1,
- pub SPIM2: pac::SPIM2,
- pub SPIM3: pac::SPIM3,
- pub SPIS0: pac::SPIS0,
- pub SPIS1: pac::SPIS1,
- pub SPIS2: pac::SPIS2,
- pub SWI0: pac::SWI0,
- pub SWI3: pac::SWI3,
- pub SWI4: pac::SWI4,
- pub TIMER1: pac::TIMER1,
- pub TIMER2: pac::TIMER2,
- pub TIMER3: pac::TIMER3,
- pub TIMER4: pac::TIMER4,
- pub TWI0: pac::TWI0,
- pub TWI1: pac::TWI1,
- pub TWIM0: pac::TWIM0,
- pub TWIM1: pac::TWIM1,
- pub TWIS0: pac::TWIS0,
- pub TWIS1: pac::TWIS1,
- pub UART0: pac::UART0,
- pub UARTE0: pac::UARTE0,
- pub UARTE1: pac::UARTE1,
- pub UICR: pac::UICR,
- pub USBD: pac::USBD,
- pub WDT: pac::WDT,
-}