diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index 7019224f..c7fcd79b 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -429,6 +429,18 @@ pub struct SCB { unsafe impl Send for SCB {} impl SCB { + /// Unsafely obtains an `SCB` instance from nothing. + /// + /// # Safety + /// + /// The caller has to ensure that all SCB access is synchronized across all + /// `SCB` instances to avoid race conditions. + pub unsafe fn steal() -> Self { + Self { + _marker: PhantomData, + } + } + /// Returns a pointer to the register block pub fn ptr() -> *const scb::RegisterBlock { 0xE000_ED04 as *const _