nrf: replace PhantomData usages with PeripheralRef.
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
//! Nvmcerature sensor interface.
|
||||
|
||||
use core::marker::PhantomData;
|
||||
use core::{ptr, slice};
|
||||
|
||||
use embassy_hal_common::into_ref;
|
||||
use embassy_hal_common::{into_ref, PeripheralRef};
|
||||
use embedded_storage::nor_flash::{
|
||||
ErrorType, MultiwriteNorFlash, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash,
|
||||
};
|
||||
@ -31,14 +30,13 @@ impl NorFlashError for Error {
|
||||
}
|
||||
|
||||
pub struct Nvmc<'d> {
|
||||
_p: PhantomData<&'d NVMC>,
|
||||
_p: PeripheralRef<'d, NVMC>,
|
||||
}
|
||||
|
||||
impl<'d> Nvmc<'d> {
|
||||
pub fn new(_p: impl Peripheral<P = NVMC> + 'd) -> Self {
|
||||
into_ref!(_p);
|
||||
|
||||
Self { _p: PhantomData }
|
||||
Self { _p }
|
||||
}
|
||||
|
||||
fn regs() -> &'static pac::nvmc::RegisterBlock {
|
||||
|
Reference in New Issue
Block a user