Skip to content

Commit 6343027

Browse files
authored
Merge pull request #43 from diondokter/async-marker-multiwrite
Add async MultiwriteNorFlash
2 parents 20cd6ac + 3750c71 commit 6343027

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

embedded-storage-async/src/nor_flash.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,15 @@ impl<T: NorFlash> NorFlash for &mut T {
7373
T::write(self, offset, bytes).await
7474
}
7575
}
76+
77+
/// Marker trait for NorFlash relaxing the restrictions on `write`.
78+
///
79+
/// Writes to the same word twice are now allowed. The result is the logical AND of the
80+
/// previous data and the written data. That is, it is only possible to change 1 bits to 0 bits.
81+
///
82+
/// If power is lost during write:
83+
/// - Bits that were 1 on flash and are written to 1 are guaranteed to stay as 1
84+
/// - Bits that were 1 on flash and are written to 0 are undefined
85+
/// - Bits that were 0 on flash are guaranteed to stay as 0
86+
/// - Rest of the bits in the page are guaranteed to be unchanged
87+
pub trait MultiwriteNorFlash: NorFlash {}

0 commit comments

Comments
 (0)