1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#[doc = "Register `DC_LATCH1_STAT` reader"]
pub type R = crate::R<DC_LATCH1_STAT_SPEC>;
#[doc = "Event Latch1 positive edge\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EV_L1_POS_A {
    #[doc = "0: Positive edge not detected or continuous mode"]
    VALUE1 = 0,
    #[doc = "1: Positive edge detected in single event mode only"]
    VALUE2 = 1,
}
impl From<EV_L1_POS_A> for bool {
    #[inline(always)]
    fn from(variant: EV_L1_POS_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EV_L1_POS` reader - Event Latch1 positive edge"]
pub type EV_L1_POS_R = crate::BitReader<EV_L1_POS_A>;
impl EV_L1_POS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> EV_L1_POS_A {
        match self.bits {
            false => EV_L1_POS_A::VALUE1,
            true => EV_L1_POS_A::VALUE2,
        }
    }
    #[doc = "Positive edge not detected or continuous mode"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == EV_L1_POS_A::VALUE1
    }
    #[doc = "Positive edge detected in single event mode only"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == EV_L1_POS_A::VALUE2
    }
}
#[doc = "Event Latch1 negative edge\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EV_L1_NEG_A {
    #[doc = "0: Negative edge not detected or continuous mode"]
    VALUE1 = 0,
    #[doc = "1: Negative edge detected in single event mode only"]
    VALUE2 = 1,
}
impl From<EV_L1_NEG_A> for bool {
    #[inline(always)]
    fn from(variant: EV_L1_NEG_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `EV_L1_NEG` reader - Event Latch1 negative edge"]
pub type EV_L1_NEG_R = crate::BitReader<EV_L1_NEG_A>;
impl EV_L1_NEG_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> EV_L1_NEG_A {
        match self.bits {
            false => EV_L1_NEG_A::VALUE1,
            true => EV_L1_NEG_A::VALUE2,
        }
    }
    #[doc = "Negative edge not detected or continuous mode"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == EV_L1_NEG_A::VALUE1
    }
    #[doc = "Negative edge detected in single event mode only"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == EV_L1_NEG_A::VALUE2
    }
}
#[doc = "Field `L1_PIN` reader - Latch1 pin state"]
pub type L1_PIN_R = crate::BitReader;
impl R {
    #[doc = "Bit 0 - Event Latch1 positive edge"]
    #[inline(always)]
    pub fn ev_l1_pos(&self) -> EV_L1_POS_R {
        EV_L1_POS_R::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Event Latch1 negative edge"]
    #[inline(always)]
    pub fn ev_l1_neg(&self) -> EV_L1_NEG_R {
        EV_L1_NEG_R::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Latch1 pin state"]
    #[inline(always)]
    pub fn l1_pin(&self) -> L1_PIN_R {
        L1_PIN_R::new(((self.bits >> 2) & 1) != 0)
    }
}
#[doc = "Latch1 Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dc_latch1_stat::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct DC_LATCH1_STAT_SPEC;
impl crate::RegisterSpec for DC_LATCH1_STAT_SPEC {
    type Ux = u8;
}
#[doc = "`read()` method returns [`dc_latch1_stat::R`](R) reader structure"]
impl crate::Readable for DC_LATCH1_STAT_SPEC {}
#[doc = "`reset()` method sets DC_LATCH1_STAT to value 0"]
impl crate::Resettable for DC_LATCH1_STAT_SPEC {
    const RESET_VALUE: u8 = 0;
}