#[repr(u8)]pub enum Priority {
P1 = 1,
P2 = 2,
P3 = 3,
P4 = 4,
}
Expand description
Logical interrupt priority level.
P4 is the most urgent, and P1 is the least urgent priority.
Variants§
Implementations§
Source§impl Priority
impl Priority
Sourcepub const fn from_numeric(prio: u8) -> Option<Self>
pub const fn from_numeric(prio: u8) -> Option<Self>
Creates the Priority
from a numeric priority if possible.
Sourcepub const fn logical2hw(self) -> u8
pub const fn logical2hw(self) -> u8
Convert a logical priority (where higher priority number = higher priority level) to a hardware priority level (where lower priority number = higher priority level).
Taken from cortex-m-interrupt
See LICENSE-MIT for the license.
Sourcepub const fn hw2logical(prio: u8) -> Self
pub const fn hw2logical(prio: u8) -> Self
Convert a hardware priority level (where lower priority number = higher priority level) to a logical priority (where a higher priority number = higher priority level).
§Panics
This method may only be used with allowed hardware priority levels. Ie,
- 0x00,
- 0x20,
- 0x40,
- and so on.
Any other value will cause a panic. To save yourself some trouble, use this method only with hardware priority values gotten directly from the NVIC.