Struct rp2040_pac::SCB

source ·
pub struct SCB { /* private fields */ }
Expand description

System Control Block

Implementations§

source§

impl SCB

source

pub fn vect_active() -> VectActive

Returns the active exception number

source§

impl SCB

source

pub fn set_sleepdeep(&mut self)

Set the SLEEPDEEP bit in the SCR register

source

pub fn clear_sleepdeep(&mut self)

Clear the SLEEPDEEP bit in the SCR register

source§

impl SCB

source

pub fn set_sleeponexit(&mut self)

Set the SLEEPONEXIT bit in the SCR register

source

pub fn clear_sleeponexit(&mut self)

Clear the SLEEPONEXIT bit in the SCR register

source§

impl SCB

source

pub fn sys_reset() -> !

Initiate a system reset request to reset the MCU

source§

impl SCB

source

pub fn set_pendsv()

Set the PENDSVSET bit in the ICSR register which will pend the PendSV interrupt

source

pub fn is_pendsv_pending() -> bool

Check if PENDSVSET bit in the ICSR register is set meaning PendSV interrupt is pending

source

pub fn clear_pendsv()

Set the PENDSVCLR bit in the ICSR register which will clear a pending PendSV interrupt

source

pub fn set_pendst()

Set the PENDSTSET bit in the ICSR register which will pend a SysTick interrupt

source

pub fn is_pendst_pending() -> bool

Check if PENDSTSET bit in the ICSR register is set meaning SysTick interrupt is pending

source

pub fn clear_pendst()

Set the PENDSTCLR bit in the ICSR register which will clear a pending SysTick interrupt

source§

impl SCB

source

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.

source

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.

source§

impl SCB

source

pub const PTR: *const RegisterBlock = {0xe000ed04 as *const cortex_m::peripheral::scb::RegisterBlock}

Pointer to the register block

source

pub const fn ptr() -> *const RegisterBlock

👎Deprecated since 0.7.5: Use the associated constant PTR instead

Returns a pointer to the register block

Trait Implementations§

source§

impl Deref for SCB

§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &<SCB as Deref>::Target

Dereferences the value.
source§

impl Send for SCB

Auto Trait Implementations§

§

impl RefUnwindSafe for SCB

§

impl !Sync for SCB

§

impl Unpin for SCB

§

impl UnwindSafe for SCB

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.