Skip to content

Commit 4b0adbf

Browse files
committed
Expose configuration of the SEVONPEND SCR bit
1 parent f3f85e6 commit 4b0adbf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cortex-m/src/peripheral/scb.rs

+20
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,26 @@ impl SCB {
832832
}
833833
}
834834

835+
const SCB_SCR_SEVONPEND: u32 = 0x1 << 4;
836+
837+
impl SCB {
838+
/// Set the SEVONPEND bit in the SCR register
839+
#[inline]
840+
pub fn set_sevonpend(&mut self) {
841+
unsafe {
842+
self.scr.modify(|scr| scr | SCB_SCR_SEVONPEND);
843+
}
844+
}
845+
846+
/// Clear the SEVONPEND bit in the SCR register
847+
#[inline]
848+
pub fn clear_sevonpend(&mut self) {
849+
unsafe {
850+
self.scr.modify(|scr| scr & !SCB_SCR_SEVONPEND);
851+
}
852+
}
853+
}
854+
835855
const SCB_AIRCR_VECTKEY: u32 = 0x05FA << 16;
836856
const SCB_AIRCR_PRIGROUP_MASK: u32 = 0x7 << 8;
837857
const SCB_AIRCR_SYSRESETREQ: u32 = 1 << 2;

0 commit comments

Comments
 (0)