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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#[doc = "Register `U%s_STATUS` reader"]
pub struct R(crate::R<U_STATUS_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<U_STATUS_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<U_STATUS_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<U_STATUS_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `CNT_THR_ZERO_MODE_U0` reader - The pulse counter status of PCNT_U%s corresponding to 0. 0: pulse counter decreases from positive to 0. 1: pulse counter increases from negative to 0. 2: pulse counter is negative. 3: pulse counter is positive."]
pub struct CNT_THR_ZERO_MODE_U0_R(crate::FieldReader<u8, u8>);
impl CNT_THR_ZERO_MODE_U0_R {
    #[inline(always)]
    pub(crate) fn new(bits: u8) -> Self {
        CNT_THR_ZERO_MODE_U0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CNT_THR_ZERO_MODE_U0_R {
    type Target = crate::FieldReader<u8, u8>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CNT_THR_THRES1_LAT_U0` reader - The latched value of thres1 event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thres1 and thres1 event is valid. 0: others."]
pub struct CNT_THR_THRES1_LAT_U0_R(crate::FieldReader<bool, bool>);
impl CNT_THR_THRES1_LAT_U0_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        CNT_THR_THRES1_LAT_U0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CNT_THR_THRES1_LAT_U0_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CNT_THR_THRES0_LAT_U0` reader - The latched value of thres0 event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thres0 and thres0 event is valid. 0: others."]
pub struct CNT_THR_THRES0_LAT_U0_R(crate::FieldReader<bool, bool>);
impl CNT_THR_THRES0_LAT_U0_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        CNT_THR_THRES0_LAT_U0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CNT_THR_THRES0_LAT_U0_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CNT_THR_L_LIM_LAT_U0` reader - The latched value of low limit event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thr_l_lim and low limit event is valid. 0: others."]
pub struct CNT_THR_L_LIM_LAT_U0_R(crate::FieldReader<bool, bool>);
impl CNT_THR_L_LIM_LAT_U0_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        CNT_THR_L_LIM_LAT_U0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CNT_THR_L_LIM_LAT_U0_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CNT_THR_H_LIM_LAT_U0` reader - The latched value of high limit event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thr_h_lim and high limit event is valid. 0: others."]
pub struct CNT_THR_H_LIM_LAT_U0_R(crate::FieldReader<bool, bool>);
impl CNT_THR_H_LIM_LAT_U0_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        CNT_THR_H_LIM_LAT_U0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CNT_THR_H_LIM_LAT_U0_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
#[doc = "Field `CNT_THR_ZERO_LAT_U0` reader - The latched value of zero threshold event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to 0 and zero threshold event is valid. 0: others."]
pub struct CNT_THR_ZERO_LAT_U0_R(crate::FieldReader<bool, bool>);
impl CNT_THR_ZERO_LAT_U0_R {
    #[inline(always)]
    pub(crate) fn new(bits: bool) -> Self {
        CNT_THR_ZERO_LAT_U0_R(crate::FieldReader::new(bits))
    }
}
impl core::ops::Deref for CNT_THR_ZERO_LAT_U0_R {
    type Target = crate::FieldReader<bool, bool>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl R {
    #[doc = "Bits 0:1 - The pulse counter status of PCNT_U%s corresponding to 0. 0: pulse counter decreases from positive to 0. 1: pulse counter increases from negative to 0. 2: pulse counter is negative. 3: pulse counter is positive."]
    #[inline(always)]
    pub fn cnt_thr_zero_mode_u0(&self) -> CNT_THR_ZERO_MODE_U0_R {
        CNT_THR_ZERO_MODE_U0_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bit 2 - The latched value of thres1 event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thres1 and thres1 event is valid. 0: others."]
    #[inline(always)]
    pub fn cnt_thr_thres1_lat_u0(&self) -> CNT_THR_THRES1_LAT_U0_R {
        CNT_THR_THRES1_LAT_U0_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - The latched value of thres0 event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thres0 and thres0 event is valid. 0: others."]
    #[inline(always)]
    pub fn cnt_thr_thres0_lat_u0(&self) -> CNT_THR_THRES0_LAT_U0_R {
        CNT_THR_THRES0_LAT_U0_R::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - The latched value of low limit event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thr_l_lim and low limit event is valid. 0: others."]
    #[inline(always)]
    pub fn cnt_thr_l_lim_lat_u0(&self) -> CNT_THR_L_LIM_LAT_U0_R {
        CNT_THR_L_LIM_LAT_U0_R::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - The latched value of high limit event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to thr_h_lim and high limit event is valid. 0: others."]
    #[inline(always)]
    pub fn cnt_thr_h_lim_lat_u0(&self) -> CNT_THR_H_LIM_LAT_U0_R {
        CNT_THR_H_LIM_LAT_U0_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - The latched value of zero threshold event of PCNT_U%s when threshold event interrupt is valid. 1: the current pulse counter equals to 0 and zero threshold event is valid. 0: others."]
    #[inline(always)]
    pub fn cnt_thr_zero_lat_u0(&self) -> CNT_THR_ZERO_LAT_U0_R {
        CNT_THR_ZERO_LAT_U0_R::new(((self.bits >> 6) & 1) != 0)
    }
}
#[doc = "PNCT UNIT%s status register\n\nThis register you can [`read`]
(crate::generic::Reg::read). See [API]
(https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [u_status]
(index.html) module"]
pub struct U_STATUS_SPEC;
impl crate::RegisterSpec for U_STATUS_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [u_status::R]
(R) reader structure"]
impl crate::Readable for U_STATUS_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets U%s_STATUS to value 0"]
impl crate::Resettable for U_STATUS_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}