Trait r3_kernel::PortInterrupts
source · pub unsafe trait PortInterrupts: KernelCfg1 {
const MANAGED_INTERRUPT_PRIORITY_RANGE: Range<InterruptPriority> = _;
const MANAGED_INTERRUPT_LINES: &'static [InterruptNum] = _;
// Provided methods
unsafe fn set_interrupt_line_priority(
_line: InterruptNum,
_priority: InterruptPriority
) -> Result<(), SetInterruptLinePriorityError> { ... }
unsafe fn enable_interrupt_line(
_line: InterruptNum
) -> Result<(), EnableInterruptLineError> { ... }
unsafe fn disable_interrupt_line(
_line: InterruptNum
) -> Result<(), EnableInterruptLineError> { ... }
unsafe fn pend_interrupt_line(
_line: InterruptNum
) -> Result<(), PendInterruptLineError> { ... }
unsafe fn clear_interrupt_line(
_line: InterruptNum
) -> Result<(), ClearInterruptLineError> { ... }
unsafe fn is_interrupt_line_pending(
_line: InterruptNum
) -> Result<bool, QueryInterruptLineError> { ... }
}
Expand description
Implemented by a port. This trait contains items related to controlling interrupt lines.
Safety
Implementing a port is inherently unsafe because it’s responsible for initializing the execution environment and providing a dispatcher implementation.
These methods are only meant to be called by the kernel.
Provided Associated Constants§
sourceconst MANAGED_INTERRUPT_PRIORITY_RANGE: Range<InterruptPriority> = _
const MANAGED_INTERRUPT_PRIORITY_RANGE: Range<InterruptPriority> = _
The range of interrupt priority values considered managed.
Defaults to 0..0
(empty) when unspecified.
sourceconst MANAGED_INTERRUPT_LINES: &'static [InterruptNum] = _
const MANAGED_INTERRUPT_LINES: &'static [InterruptNum] = _
The list of interrupt lines which are considered managed.
Defaults to &[]
(empty) when unspecified.
This is useful when the driver employs a fixed priority scheme and doesn’t support changing interrupt line priorities.
Provided Methods§
sourceunsafe fn set_interrupt_line_priority(
_line: InterruptNum,
_priority: InterruptPriority
) -> Result<(), SetInterruptLinePriorityError>
unsafe fn set_interrupt_line_priority( _line: InterruptNum, _priority: InterruptPriority ) -> Result<(), SetInterruptLinePriorityError>
Set the priority of the specified interrupt line.
Precondition: CPU Lock active. Task context or boot phase.
sourceunsafe fn enable_interrupt_line(
_line: InterruptNum
) -> Result<(), EnableInterruptLineError>
unsafe fn enable_interrupt_line( _line: InterruptNum ) -> Result<(), EnableInterruptLineError>
Enable the specified interrupt line.
sourceunsafe fn disable_interrupt_line(
_line: InterruptNum
) -> Result<(), EnableInterruptLineError>
unsafe fn disable_interrupt_line( _line: InterruptNum ) -> Result<(), EnableInterruptLineError>
Disable the specified interrupt line.
sourceunsafe fn pend_interrupt_line(
_line: InterruptNum
) -> Result<(), PendInterruptLineError>
unsafe fn pend_interrupt_line( _line: InterruptNum ) -> Result<(), PendInterruptLineError>
Set the pending flag of the specified interrupt line.
sourceunsafe fn clear_interrupt_line(
_line: InterruptNum
) -> Result<(), ClearInterruptLineError>
unsafe fn clear_interrupt_line( _line: InterruptNum ) -> Result<(), ClearInterruptLineError>
Clear the pending flag of the specified interrupt line.
sourceunsafe fn is_interrupt_line_pending(
_line: InterruptNum
) -> Result<bool, QueryInterruptLineError>
unsafe fn is_interrupt_line_pending( _line: InterruptNum ) -> Result<bool, QueryInterruptLineError>
Read the pending flag of the specified interrupt line.