pub struct Cpsr { /* private fields */ }Expand description
CPSR (Current Program Status Register)
Implementations§
Source§impl Cpsr
impl Cpsr
Sourcepub const ZERO: Self
pub const ZERO: Self
Creates a new instance with a raw value of 0. Equivalent to [Self::new_with_raw_value(0)].
Sourcepub const fn new_with_raw_value(value: u32) -> Cpsr
pub const fn new_with_raw_value(value: u32) -> Cpsr
Creates a new instance of this bitfield with the given raw value.
No checks are performed on the value, so it is possible to set bits that don’t have any accessors specified.
Sourcepub const fn mode(&self) -> Result<ProcessorMode, u8>
pub const fn mode(&self) -> Result<ProcessorMode, u8>
Processor Mode
Sourcepub const fn with_mode(&self, field_value: ProcessorMode) -> Self
pub const fn with_mode(&self, field_value: ProcessorMode) -> Self
Processor Mode
Sourcepub fn set_mode(&mut self, field_value: ProcessorMode)
pub fn set_mode(&mut self, field_value: ProcessorMode)
Processor Mode
Source§impl Cpsr
impl Cpsr
Sourcepub unsafe fn write(_value: Self)
pub unsafe fn write(_value: Self)
Write CPSR (Current Program Status Register)
§Safety
Changing the Program Status Register can affect whether interrupts are enabled, whether we are executing Arm or Thumb instructions, or which processor mode are in. You must be absolutely certain that the new CPSR value is valid and appropriate for continued Rust code execution.
You almost certainly want to follow this with an ISB instruction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Cpsr
impl RefUnwindSafe for Cpsr
impl Send for Cpsr
impl Sync for Cpsr
impl Unpin for Cpsr
impl UnwindSafe for Cpsr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more