[][src]Struct sunrise_kernel::devices::pic::InternalPic

struct InternalPic {
    port_cmd: Pio<u8>,
    port_data: Pio<u8>,
}

A single PIC8259 device.

Fields

port_cmd: Pio<u8>

The PIC's COMMAND IO port.

port_data: Pio<u8>

The PIC's DATA IO port.

Implementations

impl InternalPic[src]

unsafe fn new(port_base: u16, is_master: bool, vector_offset: u8) -> InternalPic[src]

Setup the 8259 pic. Redirect the IRQ to the chosen interrupt vector.

Safety

The port should map to a proper PIC device. Sending invalid data to a random device can lead to memory unsafety. Furthermore, care should be taken not to share the underlying Pio.

pub fn acknowledge(&mut self)[src]

Acknowledges an IRQ, allowing the PIC to send a new IRQ on the next cycle.

pub fn mask(&mut self, irq: u8)[src]

Mask the given IRQ

pub fn unmask(&mut self, irq: u8)[src]

Unmask the given IRQ

pub fn get_mask(&self) -> u8[src]

Read the IRQ mask. Used mostly for debug purposes.

Trait Implementations

impl Debug for InternalPic[src]

Auto Trait Implementations

impl RefUnwindSafe for InternalPic

impl Send for InternalPic

impl Sync for InternalPic

impl Unpin for InternalPic

impl UnwindSafe for InternalPic

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.