Skip to content

Commit f1de556

Browse files
committed
Improved comments
1 parent eb05ad4 commit f1de556

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/flash/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ const FLASH_KEY1: u32 = 0x4567_0123;
1919
const FLASH_KEY2: u32 = 0xCDEF_89AB;
2020

2121
impl FlashPage {
22+
/// This gives the starting address of a flash page in physical address
2223
pub const fn to_address(&self) -> usize {
2324
FLASH_START + self.0 * PAGE_SIZE as usize
2425
}
2526
}
2627

2728
pub trait FlashExt {
29+
/// Unlocks Flash memory for erasure and writing
2830
fn unlock(self) -> core::result::Result<UnlockedFlash, FLASH>;
2931
}
3032

3133
impl FlashExt for FLASH {
32-
/// Unlocks Flash memory for erasure and writing
3334
fn unlock(self) -> core::result::Result<UnlockedFlash, FLASH> {
3435
// Wait, while the memory interface is busy.
3536
while self.sr.read().bsy().bit_is_set() {}
@@ -47,6 +48,7 @@ impl FlashExt for FLASH {
4748
}
4849
}
4950

51+
/// Handle for an unlocked flash on which operations can be performed
5052
pub struct UnlockedFlash {
5153
f: FLASH,
5254
}

0 commit comments

Comments
 (0)