pub struct Plic { /* private fields */ }
Implementations§
Source§impl Plic
impl Plic
pub const fn new(base: StaticRef<PlicRegisters>) -> Self
Sourcepub fn clear_all_pending(&self)
pub fn clear_all_pending(&self)
Clear all pending interrupts.
Sourcepub fn enable_all(&self)
pub fn enable_all(&self)
Enable all interrupts.
Sourcepub fn disable_all(&self)
pub fn disable_all(&self)
Disable all interrupts.
Sourcepub fn next_pending(&self) -> Option<u32>
pub fn next_pending(&self) -> Option<u32>
Get the index (0-256) of the lowest number pending interrupt, or None
if
none is pending. RISC-V PLIC has a “claim” register which makes it easy
to grab the highest priority pending interrupt.
Sourcepub unsafe fn save_interrupt(&self, index: u32)
pub unsafe fn save_interrupt(&self, index: u32)
Save the current interrupt to be handled later
This will save the interrupt at index internally to be handled later.
Interrupts must be disabled before this is called.
Saved interrupts can be retrieved by calling get_saved_interrupts()
.
Saved interrupts are cleared when 'complete()
is called.
Sourcepub fn get_saved_interrupts(&self) -> Option<u32>
pub fn get_saved_interrupts(&self) -> Option<u32>
The next_pending()
function will only return enabled interrupts.
This function will return a pending interrupt that has been disabled by
save_interrupt()
.
Auto Trait Implementations§
impl !Freeze for Plic
impl !RefUnwindSafe for Plic
impl !Send for Plic
impl !Sync for Plic
impl Unpin for Plic
impl !UnwindSafe for Plic
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