Skip to content

Commit ab31964

Browse files
authored
Merge pull request #539 from calebstewart/master
Expose configuration of the SEVONPEND bit within the System Control Register (SCR)
2 parents 27f34e9 + 4b0adbf commit ab31964

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
@@ -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)