Struct lc3_ensemble::sim::PSR
source · #[repr(transparent)]pub struct PSR(pub u16);Expand description
A wrapper over u16 in order to faciliate the PSR.
The word is encoded as the following:
PSR[15..16]: Privilege mode (0 = supervisor, 1 = user)PSR[8..11]: Interrupt priorityPSR[0..3]: Condition codes
Each of these are exposed as the PSR::privileged, PSR::priority, and PSR::cc values.
Tuple Fields§
§0: u16Implementations§
source§impl PSR
impl PSR
sourcepub fn privileged(&self) -> bool
pub fn privileged(&self) -> bool
Checks whether the simulator is in privileged mode.
true= supervisor modefalse= user mode
sourcepub fn set_privileged(&mut self, privl: bool)
pub fn set_privileged(&mut self, privl: bool)
Sets whether the simulator is in privileged mode.
sourcepub fn set_priority(&mut self, prio: u8)
pub fn set_priority(&mut self, prio: u8)
Sets the current interrupt priority of the simulator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PSR
impl RefUnwindSafe for PSR
impl Send for PSR
impl Sync for PSR
impl Unpin for PSR
impl UnwindSafe for PSR
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