aboutsummaryrefslogtreecommitdiff
path: root/embassy-stm32/src/flash/common.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2025-03-26 16:01:37 +0100
committerDario Nieuwenhuis <[email protected]>2025-03-27 15:18:06 +0100
commitd41eeeae79388f219bf6a84e2f7bde9f6b532516 (patch)
tree678b6fc732216e529dc38e6f65b72a309917ac32 /embassy-stm32/src/flash/common.rs
parent9edf5b7f049f95742b60b041e4443967d8a6b708 (diff)
Remove Peripheral trait, rename PeripheralRef->Peri.
Diffstat (limited to 'embassy-stm32/src/flash/common.rs')
-rw-r--r--embassy-stm32/src/flash/common.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/embassy-stm32/src/flash/common.rs b/embassy-stm32/src/flash/common.rs
index 0004a7488..1376ca4b4 100644
--- a/embassy-stm32/src/flash/common.rs
+++ b/embassy-stm32/src/flash/common.rs
@@ -2,27 +2,24 @@ use core::marker::PhantomData;
2use core::sync::atomic::{fence, Ordering}; 2use core::sync::atomic::{fence, Ordering};
3 3
4use embassy_hal_internal::drop::OnDrop; 4use embassy_hal_internal::drop::OnDrop;
5use embassy_hal_internal::{into_ref, PeripheralRef};
6 5
7use super::{ 6use super::{
8 family, Async, Blocking, Error, FlashBank, FlashLayout, FlashRegion, FlashSector, FLASH_SIZE, MAX_ERASE_SIZE, 7 family, Async, Blocking, Error, FlashBank, FlashLayout, FlashRegion, FlashSector, FLASH_SIZE, MAX_ERASE_SIZE,
9 READ_SIZE, WRITE_SIZE, 8 READ_SIZE, WRITE_SIZE,
10}; 9};
10use crate::Peri;
11use crate::_generated::FLASH_BASE; 11use crate::_generated::FLASH_BASE;
12use crate::peripherals::FLASH; 12use crate::peripherals::FLASH;
13use crate::Peripheral;
14 13
15/// Internal flash memory driver. 14/// Internal flash memory driver.
16pub struct Flash<'d, MODE = Async> { 15pub struct Flash<'d, MODE = Async> {
17 pub(crate) inner: PeripheralRef<'d, FLASH>, 16 pub(crate) inner: Peri<'d, FLASH>,
18 pub(crate) _mode: PhantomData<MODE>, 17 pub(crate) _mode: PhantomData<MODE>,
19} 18}
20 19
21impl<'d> Flash<'d, Blocking> { 20impl<'d> Flash<'d, Blocking> {
22 /// Create a new flash driver, usable in blocking mode. 21 /// Create a new flash driver, usable in blocking mode.
23 pub fn new_blocking(p: impl Peripheral<P = FLASH> + 'd) -> Self { 22 pub fn new_blocking(p: Peri<'d, FLASH>) -> Self {
24 into_ref!(p);
25
26 Self { 23 Self {
27 inner: p, 24 inner: p,
28 _mode: PhantomData, 25 _mode: PhantomData,