diff options
| author | Ulf Lilleengen <[email protected]> | 2025-11-04 13:29:04 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2025-11-04 13:29:04 +0100 |
| commit | f2c1da56eb9690c9fa3edcd73d430e669fa7baa7 (patch) | |
| tree | fa6a86a8fc8e9ba83f63c69bd9bb8672322955f6 /embassy-nrf | |
| parent | a863db9fbae05d154e78d5d19db4dde786285d13 (diff) | |
fix: warnings
Diffstat (limited to 'embassy-nrf')
| -rw-r--r-- | embassy-nrf/src/cracen.rs | 17 | ||||
| -rw-r--r-- | embassy-nrf/src/lib.rs | 1 |
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 | ||
| 5 | use crate::mode::{Async, Blocking, Mode}; | 5 | use crate::mode::{Blocking, Mode}; |
| 6 | use crate::{Peri, interrupt, pac, peripherals}; | 6 | use crate::{Peri, interrupt, pac, peripherals}; |
| 7 | use core::marker::PhantomData; | 7 | use core::marker::PhantomData; |
| 8 | 8 | ||
| 9 | /// A wrapper around an nRF54 CRACEN peripheral. | ||
| 10 | /// | ||
| 11 | /// It has a blocking api through `rand`. | ||
| 9 | pub struct Cracen<'d, M: Mode> { | 12 | pub 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> { | |||
| 14 | impl<'d> Cracen<'d, Blocking> { | 17 | impl<'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 | ||
| 137 | impl<'d, M: Mode> rand_core_09::CryptoRng for Cracen<'d, M> {} | 138 | impl<'d, M: Mode> rand_core_09::CryptoRng for Cracen<'d, M> {} |
| 138 | 139 | ||
| 139 | pub(crate) trait SealedInstance { | 140 | pub(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 | ||
| 150 | macro_rules! impl_cracen { | 149 | macro_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 | } |
