PicOperationMode

Enum PicOperationMode 

Source
pub enum PicOperationMode {
    FullyNested,
    AutomaticRotation,
    SpecialMask,
    PolledMode,
}
Expand description

Operation Mode for PIC Controller.

PIC supports several operation mode, most of which are most likely to be ignored on x86 architecture, however some of them can be used to obtain some interesting results. See more information for each of them below.

Variants§

§

FullyNested

Fully Nested Mode (Default Mode)

This mode is entered after initialization unless another mode is programmed. The interrupt requests are ordered in priority from 0 through 7, where 0 is the highest priority. When interrupt is acknowledged the highest priority interrupt will be issued before the rest.

On a regular x86 PC with two chained PICs, the IRQ0, which is an output of a PIT timer, will be handled before others IRQ lines. Slave PIC has even smaller priority than first 7 masters IRQ lines, because it is mapped after the master PIC.

§Use Case

Use when the default priority level suits your needs. For example, if a PS/2 keyboard interrupt (IRQ1) will be always services before the real time clock (IRQ8).

§

AutomaticRotation

Automatic Rotation Mode (Equal Priority Mode)

Rotates the priority by the value specified in the current highest priority interrupt within the ISR register. Basically each time the highest priority interrupt occur, it will then be defined as a lowest priority interrupt. This way giving all interrupt sources an equal service time from the CPU.

§Use Case

Use if you think that all interrupts deserve to be handled equally. This sometimes might cause troubles with timers, specifically the PIT and RTC.

§

SpecialMask

Special Mask Mode (Manual Priority Mode)

Some applications might want to have a different priority mapping for the full software control over the sequence of interrupts. During this mode the mask register is now used to temporary disable certain interrupt levels as well as manually changing the priority level.

§Use Case

Critical sections that wish to disable some interrupts from the PIC but not all of them, or some applications with specific timing requirements that require to temporary inhibit some of interrupt levels to make sure that lower priority interrupts will meet timings accordingly.

§

PolledMode

Polled Mode (No interrupts)

Do not use interrupts to obtain information from the peripherals but only listen for upcoming changes. After the polled mode is enabled, data bus will provide a binary value of a highest priority issued interrupt. Each read from the data port will be treated as an interrupt acknowledge.

§Use Case

Probably the most useless one. Since it is very quick to turn this mode on and off, it can be used to handle several interrupts in one handler by reading all values from the data port until it will be equal to zero.

Trait Implementations§

Source§

impl Clone for PicOperationMode

Source§

fn clone(&self) -> PicOperationMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PicOperationMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PicOperationMode

Source§

fn eq(&self, other: &PicOperationMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PicOperationMode

Source§

impl Eq for PicOperationMode

Source§

impl StructuralPartialEq for PicOperationMode

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.