Skip to content

Commit 7e75be4

Browse files
calebstewartadamgreig
authored andcommitted
Expose configuration of the SEVONPEND SCR bit (#539)
1 parent c1163c7 commit 7e75be4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cortex-m/src/peripheral/scb.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,26 @@ impl SCB {
820820
}
821821
}
822822

823+
const SCB_SCR_SEVONPEND: u32 = 0x1 << 4;
824+
825+
impl SCB {
826+
/// Set the SEVONPEND bit in the SCR register
827+
#[inline]
828+
pub fn set_sevonpend(&mut self) {
829+
unsafe {
830+
self.scr.modify(|scr| scr | SCB_SCR_SEVONPEND);
831+
}
832+
}
833+
834+
/// Clear the SEVONPEND bit in the SCR register
835+
#[inline]
836+
pub fn clear_sevonpend(&mut self) {
837+
unsafe {
838+
self.scr.modify(|scr| scr & !SCB_SCR_SEVONPEND);
839+
}
840+
}
841+
}
842+
823843
const SCB_AIRCR_VECTKEY: u32 = 0x05FA << 16;
824844
const SCB_AIRCR_PRIGROUP_MASK: u32 = 0x7 << 8;
825845
const SCB_AIRCR_SYSRESETREQ: u32 = 1 << 2;

0 commit comments

Comments
 (0)