pub struct AutoInterruptController { /* private fields */ }Expand description
Standard autovectored interrupt controller.
This controller provides the standard 68000 autovectored interrupt behavior, where each priority level maps to a fixed vector (24-30 for levels 1-7).
§Example
use r68k::interrupts::{AutoInterruptController, InterruptController};
let mut ctrl = AutoInterruptController::new();
// Request an interrupt at level 5
ctrl.request_interrupt(5);
// Check highest pending priority
assert_eq!(ctrl.highest_priority(), 5);
// Acknowledge clears the interrupt and returns vector 29
assert_eq!(ctrl.acknowledge_interrupt(5), Some(29));
assert_eq!(ctrl.highest_priority(), 0);Implementations§
Source§impl AutoInterruptController
impl AutoInterruptController
Sourcepub fn new() -> AutoInterruptController
pub fn new() -> AutoInterruptController
Creates a new autovectored interrupt controller with no pending interrupts.
Sourcepub fn request_interrupt(&mut self, irq: u8) -> u8
pub fn request_interrupt(&mut self, irq: u8) -> u8
Requests an interrupt at the given priority level (1-7).
Multiple interrupt levels can be pending simultaneously. The CPU will process the highest priority pending interrupt that exceeds its current interrupt mask.
§Panics
Panics if irq is not in the range 1-7.
Trait Implementations§
Source§impl Default for AutoInterruptController
impl Default for AutoInterruptController
Source§fn default() -> AutoInterruptController
fn default() -> AutoInterruptController
Returns the “default value” for a type. Read more
Source§impl InterruptController for AutoInterruptController
impl InterruptController for AutoInterruptController
Source§fn reset_external_devices(&mut self)
fn reset_external_devices(&mut self)
Called when a RESET instruction is executed. Read more
Source§fn highest_priority(&self) -> u8
fn highest_priority(&self) -> u8
Returns the highest pending interrupt priority level (1-7), or 0 if none.
Auto Trait Implementations§
impl Freeze for AutoInterruptController
impl RefUnwindSafe for AutoInterruptController
impl Send for AutoInterruptController
impl Sync for AutoInterruptController
impl Unpin for AutoInterruptController
impl UnwindSafe for AutoInterruptController
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