cortex_m/register/
faultmask.rs
1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub enum Faultmask {
6 Active,
8 Inactive,
10}
11
12impl Faultmask {
13 #[inline]
15 pub fn is_active(self) -> bool {
16 self == Faultmask::Active
17 }
18
19 #[inline]
21 pub fn is_inactive(self) -> bool {
22 self == Faultmask::Inactive
23 }
24}
25
26#[inline]
28pub fn read() -> Faultmask {
29 let r: u32 = call_asm!(__faultmask_r() -> u32);
30 if r & (1 << 0) == (1 << 0) {
31 Faultmask::Inactive
32 } else {
33 Faultmask::Active
34 }
35}