pub struct SCB { /* private fields */ }
Expand description
System Control Block
Implementations§
Source§impl SCB
impl SCB
Sourcepub fn vect_active() -> VectActive
pub fn vect_active() -> VectActive
Returns the active exception number
Source§impl SCB
impl SCB
Sourcepub fn set_sleepdeep(&mut self)
pub fn set_sleepdeep(&mut self)
Set the SLEEPDEEP bit in the SCR register
Sourcepub fn clear_sleepdeep(&mut self)
pub fn clear_sleepdeep(&mut self)
Clear the SLEEPDEEP bit in the SCR register
Source§impl SCB
impl SCB
Sourcepub fn set_sleeponexit(&mut self)
pub fn set_sleeponexit(&mut self)
Set the SLEEPONEXIT bit in the SCR register
Sourcepub fn clear_sleeponexit(&mut self)
pub fn clear_sleeponexit(&mut self)
Clear the SLEEPONEXIT bit in the SCR register
Source§impl SCB
impl SCB
Sourcepub fn set_pendsv()
pub fn set_pendsv()
Set the PENDSVSET bit in the ICSR register which will pend the PendSV interrupt
Sourcepub fn is_pendsv_pending() -> bool
pub fn is_pendsv_pending() -> bool
Check if PENDSVSET bit in the ICSR register is set meaning PendSV interrupt is pending
Sourcepub fn clear_pendsv()
pub fn clear_pendsv()
Set the PENDSVCLR bit in the ICSR register which will clear a pending PendSV interrupt
Sourcepub fn set_pendst()
pub fn set_pendst()
Set the PENDSTSET bit in the ICSR register which will pend a SysTick interrupt
Sourcepub fn is_pendst_pending() -> bool
pub fn is_pendst_pending() -> bool
Check if PENDSTSET bit in the ICSR register is set meaning SysTick interrupt is pending
Sourcepub fn clear_pendst()
pub fn clear_pendst()
Set the PENDSTCLR bit in the ICSR register which will clear a pending SysTick interrupt
Source§impl SCB
impl SCB
Sourcepub fn get_priority(system_handler: SystemHandler) -> u8
pub fn get_priority(system_handler: SystemHandler) -> u8
Returns the hardware priority of system_handler
NOTE: Hardware priority does not exactly match logical priority levels. See
NVIC.get_priority
for more details.
Sourcepub unsafe fn set_priority(&mut self, system_handler: SystemHandler, prio: u8)
pub unsafe fn set_priority(&mut self, system_handler: SystemHandler, prio: u8)
Sets the hardware priority of system_handler
to prio
NOTE: Hardware priority does not exactly match logical priority levels. See
NVIC.get_priority
for more details.
On ARMv6-M, updating a system handler priority requires a read-modify-write operation. On ARMv7-M, the operation is performed in a single, atomic write operation.
§Unsafety
Changing priority levels can break priority-based critical sections (see
register::basepri
) and compromise memory safety.