aboutsummaryrefslogtreecommitdiff
path: root/src/peripheral/dcb.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/peripheral/dcb.rs')
-rw-r--r--src/peripheral/dcb.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/peripheral/dcb.rs b/src/peripheral/dcb.rs
index 056150b..ef879ac 100644
--- a/src/peripheral/dcb.rs
+++ b/src/peripheral/dcb.rs
@@ -6,6 +6,7 @@ use crate::peripheral::DCB;
use core::ptr;
const DCB_DEMCR_TRCENA: u32 = 1 << 24;
+const DCB_DEMCR_MON_EN: u32 = 1 << 16;
/// Register block
#[repr(C)]
@@ -46,6 +47,22 @@ impl DCB {
}
}
+ /// Enables the [`DebugMonitor`](crate::peripheral::scb::Exception::DebugMonitor) exception
+ #[inline]
+ pub fn enable_debug_monitor(&mut self) {
+ unsafe {
+ self.demcr.modify(|w| w | DCB_DEMCR_MON_EN);
+ }
+ }
+
+ /// Disables the [`DebugMonitor`](crate::peripheral::scb::Exception::DebugMonitor) exception
+ #[inline]
+ pub fn disable_debug_monitor(&mut self) {
+ unsafe {
+ self.demcr.modify(|w| w & !DCB_DEMCR_MON_EN);
+ }
+ }
+
/// Is there a debugger attached? (see note)
///
/// Note: This function is [reported not to