pub struct VexRiscvInterruptController { /* private fields */ }
Expand description
Rust wrapper around the raw CSR-based VexRiscv interrupt controller
The wrapper supports saving all currently pending interrupts to an internal state, which can then be used for interrupt processing.
Implementations§
Source§impl VexRiscvInterruptController
impl VexRiscvInterruptController
Sourcepub unsafe fn save_pending(&self) -> bool
pub unsafe fn save_pending(&self) -> bool
Save the currently pending interrupts in hardware to the internal state
This should be accessed in an atomic context to ensure a consistent view on the pending interrupts is saved.
Sourcepub fn next_saved(&self) -> Option<usize>
pub fn next_saved(&self) -> Option<usize>
Return the next pending interrupts in the saved state
If no interrupt is pending in the saved state, this function
returns None
.
The ordering is determined by the interrupt number, lower having a higher priority.
Sourcepub fn complete_saved(&self, idx: usize)
pub fn complete_saved(&self, idx: usize)
Mark a saved interrupt as complete, removing it from the
next_saved
queue
If all interrupts are marked as complete, next_saved
will
return None
.
Sourcepub unsafe fn mask_interrupt(idx: usize)
pub unsafe fn mask_interrupt(idx: usize)
Suppress (mask) a specific interrupt source in the interrupt controller
Sourcepub unsafe fn unmask_interrupt(idx: usize)
pub unsafe fn unmask_interrupt(idx: usize)
Unsuppress (unmask) a specific interrupt source in the interrupt controller
Sourcepub unsafe fn mask_all_interrupts()
pub unsafe fn mask_all_interrupts()
Suppress (mask) all interrupts in the interrupt controller
Sourcepub unsafe fn unmask_all_interrupts()
pub unsafe fn unmask_all_interrupts()
Unsuppress (unmask) all interrupts in the interrupt controller