diff options
Diffstat (limited to 'embassy-embedded-hal')
| -rw-r--r-- | embassy-embedded-hal/src/flash/partition/asynch.rs | 10 | ||||
| -rw-r--r-- | embassy-embedded-hal/src/flash/partition/blocking.rs | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/embassy-embedded-hal/src/flash/partition/asynch.rs b/embassy-embedded-hal/src/flash/partition/asynch.rs index 141e0d9fc..5920436dd 100644 --- a/embassy-embedded-hal/src/flash/partition/asynch.rs +++ b/embassy-embedded-hal/src/flash/partition/asynch.rs | |||
| @@ -30,6 +30,16 @@ impl<'a, M: RawMutex, T: NorFlash> Partition<'a, M, T> { | |||
| 30 | } | 30 | } |
| 31 | Self { flash, offset, size } | 31 | Self { flash, offset, size } |
| 32 | } | 32 | } |
| 33 | |||
| 34 | /// Get the partition offset within the flash | ||
| 35 | pub const fn offset(&self) -> u32 { | ||
| 36 | self.offset | ||
| 37 | } | ||
| 38 | |||
| 39 | /// Get the partition size | ||
| 40 | pub const fn size(&self) -> u32 { | ||
| 41 | self.size | ||
| 42 | } | ||
| 33 | } | 43 | } |
| 34 | 44 | ||
| 35 | impl<M: RawMutex, T: NorFlash> ErrorType for Partition<'_, M, T> { | 45 | impl<M: RawMutex, T: NorFlash> ErrorType for Partition<'_, M, T> { |
diff --git a/embassy-embedded-hal/src/flash/partition/blocking.rs b/embassy-embedded-hal/src/flash/partition/blocking.rs index dc52e292a..2ddbe3de0 100644 --- a/embassy-embedded-hal/src/flash/partition/blocking.rs +++ b/embassy-embedded-hal/src/flash/partition/blocking.rs | |||
| @@ -31,6 +31,16 @@ impl<'a, M: RawMutex, T: NorFlash> BlockingPartition<'a, M, T> { | |||
| 31 | } | 31 | } |
| 32 | Self { flash, offset, size } | 32 | Self { flash, offset, size } |
| 33 | } | 33 | } |
| 34 | |||
| 35 | /// Get the partition offset within the flash | ||
| 36 | pub const fn offset(&self) -> u32 { | ||
| 37 | self.offset | ||
| 38 | } | ||
| 39 | |||
| 40 | /// Get the partition size | ||
| 41 | pub const fn size(&self) -> u32 { | ||
| 42 | self.size | ||
| 43 | } | ||
| 34 | } | 44 | } |
| 35 | 45 | ||
| 36 | impl<M: RawMutex, T: NorFlash> ErrorType for BlockingPartition<'_, M, T> { | 46 | impl<M: RawMutex, T: NorFlash> ErrorType for BlockingPartition<'_, M, T> { |
