# PlicExt in k210_hal::plic - Rust
Extension trait for PLIC interrupt controller peripheral
Keywords: rust, rustlang, rust-lang, PlicExt

# Trait k210_hal::plic::PlicExt

source · [−]

    pub trait PlicExt {
        type Interrupt: Nr;
        fn is_enabled(hart_id: usize, interrupt: Self::Interrupt) -> bool;
        unsafe fn unmask(hart_id: usize, interrupt: Self::Interrupt);
        fn mask(hart_id: usize, interrupt: Self::Interrupt);
        fn get_priority(interrupt: Self::Interrupt) -> Priority;
        unsafe fn set_priority(interrupt: Self::Interrupt, prio: Priority);
        fn get_threshold(hart_id: usize) -> Priority;
        unsafe fn set_threshold(hart_id: usize, threshold: Priority);
        fn claim(hart_id: usize) -> Option<Self::Interrupt>;
        fn complete(hart_id: usize, interrupt: Self::Interrupt);
        fn is_pending(interrupt: Self::Interrupt) -> bool;
    }

Expand description

Extension trait for PLIC interrupt controller peripheral

## Associated Types

source

#### type Interrupt: Nr

Interrupt wrapper type

## Required methods

source

#### fn is_enabled(hart_id: usize, interrupt: Self::Interrupt) -> bool

Is this M-Mode interrupt enabled on given hart?

source

#### unsafe fn unmask(hart_id: usize, interrupt: Self::Interrupt)

Enable an interrupt for a given hart

source

#### fn mask(hart_id: usize, interrupt: Self::Interrupt)

Disable an interrupt for a given hart

source

#### fn get_priority(interrupt: Self::Interrupt) -> Priority

Get global priority for one interrupt

source

#### unsafe fn set_priority(interrupt: Self::Interrupt, prio: Priority)

Globally set priority for one interrupt

source

#### fn get_threshold(hart_id: usize) -> Priority

Get priority threshold for a given hart

source

#### unsafe fn set_threshold(hart_id: usize, threshold: Priority)

Set the priority threshold for a given hart

source

#### fn claim(hart_id: usize) -> Option<Self::Interrupt>

Mark that given hart have claimed to handle this interrupt

source

#### fn complete(hart_id: usize, interrupt: Self::Interrupt)

Mark that given hart have completed handling this interrupt

source

#### fn is_pending(interrupt: Self::Interrupt) -> bool

Is this interrupt claimed and under procceeding?

## Implementations on Foreign Types

source

### impl PlicExt for PLIC

#### type Interrupt = Interrupt

source

#### fn is_enabled(hart_id: usize, interrupt: Interrupt) -> bool

source

#### unsafe fn unmask(hart_id: usize, interrupt: Interrupt)

source

#### fn mask(hart_id: usize, interrupt: Interrupt)

source

#### fn get_priority(interrupt: Interrupt) -> Priority

source

#### unsafe fn set_priority(interrupt: Interrupt, prio: Priority)

source

#### fn get_threshold(hart_id: usize) -> Priority

source

#### unsafe fn set_threshold(hart_id: usize, threshold: Priority)

source

#### fn claim(hart_id: usize) -> Option<Interrupt>

source

#### fn complete(hart_id: usize, interrupt: Interrupt)

source

#### fn is_pending(interrupt: Interrupt) -> bool

## Implementors