aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-nrf/src/cracen.rs17
-rw-r--r--embassy-nrf/src/lib.rs1
2 files changed, 7 insertions, 11 deletions
diff --git a/embassy-nrf/src/cracen.rs b/embassy-nrf/src/cracen.rs
index ddc592689..62e6f8c86 100644
--- a/embassy-nrf/src/cracen.rs
+++ b/embassy-nrf/src/cracen.rs
@@ -2,10 +2,13 @@
2 2
3#![macro_use] 3#![macro_use]
4 4
5use crate::mode::{Async, Blocking, Mode}; 5use crate::mode::{Blocking, Mode};
6use crate::{Peri, interrupt, pac, peripherals}; 6use crate::{Peri, interrupt, pac, peripherals};
7use core::marker::PhantomData; 7use core::marker::PhantomData;
8 8
9/// A wrapper around an nRF54 CRACEN peripheral.
10///
11/// It has a blocking api through `rand`.
9pub struct Cracen<'d, M: Mode> { 12pub struct Cracen<'d, M: Mode> {
10 _peri: Peri<'d, peripherals::CRACEN>, 13 _peri: Peri<'d, peripherals::CRACEN>,
11 _p: PhantomData<M>, 14 _p: PhantomData<M>,
@@ -14,8 +17,6 @@ pub struct Cracen<'d, M: Mode> {
14impl<'d> Cracen<'d, Blocking> { 17impl<'d> Cracen<'d, Blocking> {
15 /// Create a new CRACEN driver. 18 /// Create a new CRACEN driver.
16 pub fn new_blocking(_peri: Peri<'d, peripherals::CRACEN>) -> Self { 19 pub fn new_blocking(_peri: Peri<'d, peripherals::CRACEN>) -> Self {
17 let r = pac::CRACEN;
18
19 let me = Self { _peri, _p: PhantomData }; 20 let me = Self { _peri, _p: PhantomData };
20 21
21 me.stop(); 22 me.stop();
@@ -136,9 +137,7 @@ impl<'d, M: Mode> rand_core_09::RngCore for Cracen<'d, M> {
136 137
137impl<'d, M: Mode> rand_core_09::CryptoRng for Cracen<'d, M> {} 138impl<'d, M: Mode> rand_core_09::CryptoRng for Cracen<'d, M> {}
138 139
139pub(crate) trait SealedInstance { 140pub(crate) trait SealedInstance {}
140 fn regs() -> pac::cracen::Cracen;
141}
142 141
143/// CRACEN peripheral instance. 142/// CRACEN peripheral instance.
144#[allow(private_bounds)] 143#[allow(private_bounds)]
@@ -149,11 +148,7 @@ pub trait Instance: SealedInstance + 'static + Send {
149 148
150macro_rules! impl_cracen { 149macro_rules! impl_cracen {
151 ($type:ident, $pac_type:ident, $irq:ident) => { 150 ($type:ident, $pac_type:ident, $irq:ident) => {
152 impl crate::cracen::SealedInstance for peripherals::$type { 151 impl crate::cracen::SealedInstance for peripherals::$type {}
153 fn regs() -> crate::pac::cracen::Cracen {
154 pac::$pac_type
155 }
156 }
157 impl crate::cracen::Instance for peripherals::$type { 152 impl crate::cracen::Instance for peripherals::$type {
158 type Interrupt = crate::interrupt::typelevel::$irq; 153 type Interrupt = crate::interrupt::typelevel::$irq;
159 } 154 }
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs
index bc386e820..69ca4e0a1 100644
--- a/embassy-nrf/src/lib.rs
+++ b/embassy-nrf/src/lib.rs
@@ -563,6 +563,7 @@ pub mod config {
563 pub time_interrupt_priority: crate::interrupt::Priority, 563 pub time_interrupt_priority: crate::interrupt::Priority,
564 /// Enable or disable the debug port. 564 /// Enable or disable the debug port.
565 pub debug: Debug, 565 pub debug: Debug,
566 /// Clock speed configuration.
566 #[cfg(feature = "_nrf54l")] 567 #[cfg(feature = "_nrf54l")]
567 pub clock_speed: ClockSpeed, 568 pub clock_speed: ClockSpeed,
568 } 569 }