diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-03-26 16:01:37 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-03-27 15:18:06 +0100 |
| commit | d41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch) | |
| tree | 678b6fc732216e529dc38e6f65b72a309917ac32 /embassy-nrf/src/nvmc.rs | |
| parent | 9edf5b7f049f95742b60b041e4443967d8a6b708 (diff) | |
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'embassy-nrf/src/nvmc.rs')
| -rw-r--r-- | embassy-nrf/src/nvmc.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-nrf/src/nvmc.rs b/embassy-nrf/src/nvmc.rs index 6973b4847..c46af0b34 100644 --- a/embassy-nrf/src/nvmc.rs +++ b/embassy-nrf/src/nvmc.rs | |||
| @@ -2,14 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | use core::{ptr, slice}; | 3 | use core::{ptr, slice}; |
| 4 | 4 | ||
| 5 | use embassy_hal_internal::{into_ref, PeripheralRef}; | ||
| 6 | use embedded_storage::nor_flash::{ | 5 | use embedded_storage::nor_flash::{ |
| 7 | ErrorType, MultiwriteNorFlash, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash, | 6 | ErrorType, MultiwriteNorFlash, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash, |
| 8 | }; | 7 | }; |
| 9 | 8 | ||
| 10 | use crate::pac::nvmc::vals; | 9 | use crate::pac::nvmc::vals; |
| 11 | use crate::peripherals::NVMC; | 10 | use crate::peripherals::NVMC; |
| 12 | use crate::{pac, Peripheral}; | 11 | use crate::{pac, Peri}; |
| 13 | 12 | ||
| 14 | #[cfg(not(feature = "_nrf5340-net"))] | 13 | #[cfg(not(feature = "_nrf5340-net"))] |
| 15 | /// Erase size of NVMC flash in bytes. | 14 | /// Erase size of NVMC flash in bytes. |
| @@ -42,13 +41,12 @@ impl NorFlashError for Error { | |||
| 42 | 41 | ||
| 43 | /// Non-Volatile Memory Controller (NVMC) that implements the `embedded-storage` traits. | 42 | /// Non-Volatile Memory Controller (NVMC) that implements the `embedded-storage` traits. |
| 44 | pub struct Nvmc<'d> { | 43 | pub struct Nvmc<'d> { |
| 45 | _p: PeripheralRef<'d, NVMC>, | 44 | _p: Peri<'d, NVMC>, |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | impl<'d> Nvmc<'d> { | 47 | impl<'d> Nvmc<'d> { |
| 49 | /// Create Nvmc driver. | 48 | /// Create Nvmc driver. |
| 50 | pub fn new(_p: impl Peripheral<P = NVMC> + 'd) -> Self { | 49 | pub fn new(_p: Peri<'d, NVMC>) -> Self { |
| 51 | into_ref!(_p); | ||
| 52 | Self { _p } | 50 | Self { _p } |
| 53 | } | 51 | } |
| 54 | 52 | ||
