AutoInterruptController

Struct AutoInterruptController 

Source
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

Source

pub fn new() -> AutoInterruptController

Creates a new autovectored interrupt controller with no pending interrupts.

Source

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

Source§

fn default() -> AutoInterruptController

Returns the “default value” for a type. Read more
Source§

impl InterruptController for AutoInterruptController

Source§

fn reset_external_devices(&mut self)

Called when a RESET instruction is executed. Read more
Source§

fn highest_priority(&self) -> u8

Returns the highest pending interrupt priority level (1-7), or 0 if none.
Source§

fn acknowledge_interrupt(&mut self, priority: u8) -> Option<u8>

Acknowledge an interrupt and return its vector number. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.