1#[doc = "Register `NMICR` reader"]
2pub struct R(crate::R<NMICR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<NMICR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<NMICR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<NMICR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `NMICR` writer"]
17pub struct W(crate::W<NMICR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<NMICR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<NMICR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<NMICR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `NMIMD` reader - NMI Detection Set"]
38pub type NMIMD_R = crate::BitReader<NMIMD_A>;
39#[doc = "NMI Detection Set\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum NMIMD_A {
42 #[doc = "0: Falling edge"]
43 _0 = 0,
44 #[doc = "1: Rising edge"]
45 _1 = 1,
46}
47impl From<NMIMD_A> for bool {
48 #[inline(always)]
49 fn from(variant: NMIMD_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl NMIMD_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> NMIMD_A {
57 match self.bits {
58 false => NMIMD_A::_0,
59 true => NMIMD_A::_1,
60 }
61 }
62 #[doc = "Checks if the value of the field is `_0`"]
63 #[inline(always)]
64 pub fn is_0(&self) -> bool {
65 *self == NMIMD_A::_0
66 }
67 #[doc = "Checks if the value of the field is `_1`"]
68 #[inline(always)]
69 pub fn is_1(&self) -> bool {
70 *self == NMIMD_A::_1
71 }
72}
73#[doc = "Field `NMIMD` writer - NMI Detection Set"]
74pub type NMIMD_W<'a, const O: u8> = crate::BitWriter<'a, u8, NMICR_SPEC, NMIMD_A, O>;
75impl<'a, const O: u8> NMIMD_W<'a, O> {
76 #[doc = "Falling edge"]
77 #[inline(always)]
78 pub fn _0(self) -> &'a mut W {
79 self.variant(NMIMD_A::_0)
80 }
81 #[doc = "Rising edge"]
82 #[inline(always)]
83 pub fn _1(self) -> &'a mut W {
84 self.variant(NMIMD_A::_1)
85 }
86}
87#[doc = "Field `NFCLKSEL` reader - NMI Digital Filter Sampling Clock Select"]
88pub type NFCLKSEL_R = crate::FieldReader<u8, NFCLKSEL_A>;
89#[doc = "NMI Digital Filter Sampling Clock Select\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91#[repr(u8)]
92pub enum NFCLKSEL_A {
93 #[doc = "0: PCLKB"]
94 _00 = 0,
95 #[doc = "1: PCLKB/8"]
96 _01 = 1,
97 #[doc = "2: PCLKB/32"]
98 _10 = 2,
99 #[doc = "3: PCLKB/64"]
100 _11 = 3,
101}
102impl From<NFCLKSEL_A> for u8 {
103 #[inline(always)]
104 fn from(variant: NFCLKSEL_A) -> Self {
105 variant as _
106 }
107}
108impl NFCLKSEL_R {
109 #[doc = "Get enumerated values variant"]
110 #[inline(always)]
111 pub fn variant(&self) -> NFCLKSEL_A {
112 match self.bits {
113 0 => NFCLKSEL_A::_00,
114 1 => NFCLKSEL_A::_01,
115 2 => NFCLKSEL_A::_10,
116 3 => NFCLKSEL_A::_11,
117 _ => unreachable!(),
118 }
119 }
120 #[doc = "Checks if the value of the field is `_00`"]
121 #[inline(always)]
122 pub fn is_00(&self) -> bool {
123 *self == NFCLKSEL_A::_00
124 }
125 #[doc = "Checks if the value of the field is `_01`"]
126 #[inline(always)]
127 pub fn is_01(&self) -> bool {
128 *self == NFCLKSEL_A::_01
129 }
130 #[doc = "Checks if the value of the field is `_10`"]
131 #[inline(always)]
132 pub fn is_10(&self) -> bool {
133 *self == NFCLKSEL_A::_10
134 }
135 #[doc = "Checks if the value of the field is `_11`"]
136 #[inline(always)]
137 pub fn is_11(&self) -> bool {
138 *self == NFCLKSEL_A::_11
139 }
140}
141#[doc = "Field `NFCLKSEL` writer - NMI Digital Filter Sampling Clock Select"]
142pub type NFCLKSEL_W<'a, const O: u8> =
143 crate::FieldWriterSafe<'a, u8, NMICR_SPEC, u8, NFCLKSEL_A, 2, O>;
144impl<'a, const O: u8> NFCLKSEL_W<'a, O> {
145 #[doc = "PCLKB"]
146 #[inline(always)]
147 pub fn _00(self) -> &'a mut W {
148 self.variant(NFCLKSEL_A::_00)
149 }
150 #[doc = "PCLKB/8"]
151 #[inline(always)]
152 pub fn _01(self) -> &'a mut W {
153 self.variant(NFCLKSEL_A::_01)
154 }
155 #[doc = "PCLKB/32"]
156 #[inline(always)]
157 pub fn _10(self) -> &'a mut W {
158 self.variant(NFCLKSEL_A::_10)
159 }
160 #[doc = "PCLKB/64"]
161 #[inline(always)]
162 pub fn _11(self) -> &'a mut W {
163 self.variant(NFCLKSEL_A::_11)
164 }
165}
166#[doc = "Field `NFLTEN` reader - NMI Digital Filter Enable"]
167pub type NFLTEN_R = crate::BitReader<NFLTEN_A>;
168#[doc = "NMI Digital Filter Enable\n\nValue on reset: 0"]
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
170pub enum NFLTEN_A {
171 #[doc = "0: Disabled."]
172 _0 = 0,
173 #[doc = "1: Enabled."]
174 _1 = 1,
175}
176impl From<NFLTEN_A> for bool {
177 #[inline(always)]
178 fn from(variant: NFLTEN_A) -> Self {
179 variant as u8 != 0
180 }
181}
182impl NFLTEN_R {
183 #[doc = "Get enumerated values variant"]
184 #[inline(always)]
185 pub fn variant(&self) -> NFLTEN_A {
186 match self.bits {
187 false => NFLTEN_A::_0,
188 true => NFLTEN_A::_1,
189 }
190 }
191 #[doc = "Checks if the value of the field is `_0`"]
192 #[inline(always)]
193 pub fn is_0(&self) -> bool {
194 *self == NFLTEN_A::_0
195 }
196 #[doc = "Checks if the value of the field is `_1`"]
197 #[inline(always)]
198 pub fn is_1(&self) -> bool {
199 *self == NFLTEN_A::_1
200 }
201}
202#[doc = "Field `NFLTEN` writer - NMI Digital Filter Enable"]
203pub type NFLTEN_W<'a, const O: u8> = crate::BitWriter<'a, u8, NMICR_SPEC, NFLTEN_A, O>;
204impl<'a, const O: u8> NFLTEN_W<'a, O> {
205 #[doc = "Disabled."]
206 #[inline(always)]
207 pub fn _0(self) -> &'a mut W {
208 self.variant(NFLTEN_A::_0)
209 }
210 #[doc = "Enabled."]
211 #[inline(always)]
212 pub fn _1(self) -> &'a mut W {
213 self.variant(NFLTEN_A::_1)
214 }
215}
216impl R {
217 #[doc = "Bit 0 - NMI Detection Set"]
218 #[inline(always)]
219 pub fn nmimd(&self) -> NMIMD_R {
220 NMIMD_R::new((self.bits & 1) != 0)
221 }
222 #[doc = "Bits 4:5 - NMI Digital Filter Sampling Clock Select"]
223 #[inline(always)]
224 pub fn nfclksel(&self) -> NFCLKSEL_R {
225 NFCLKSEL_R::new((self.bits >> 4) & 3)
226 }
227 #[doc = "Bit 7 - NMI Digital Filter Enable"]
228 #[inline(always)]
229 pub fn nflten(&self) -> NFLTEN_R {
230 NFLTEN_R::new(((self.bits >> 7) & 1) != 0)
231 }
232}
233impl W {
234 #[doc = "Bit 0 - NMI Detection Set"]
235 #[inline(always)]
236 #[must_use]
237 pub fn nmimd(&mut self) -> NMIMD_W<0> {
238 NMIMD_W::new(self)
239 }
240 #[doc = "Bits 4:5 - NMI Digital Filter Sampling Clock Select"]
241 #[inline(always)]
242 #[must_use]
243 pub fn nfclksel(&mut self) -> NFCLKSEL_W<4> {
244 NFCLKSEL_W::new(self)
245 }
246 #[doc = "Bit 7 - NMI Digital Filter Enable"]
247 #[inline(always)]
248 #[must_use]
249 pub fn nflten(&mut self) -> NFLTEN_W<7> {
250 NFLTEN_W::new(self)
251 }
252 #[doc = "Writes raw bits to the register."]
253 #[inline(always)]
254 pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
255 self.0.bits(bits);
256 self
257 }
258}
259#[doc = "NMI Pin Interrupt Control Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nmicr](index.html) module"]
260pub struct NMICR_SPEC;
261impl crate::RegisterSpec for NMICR_SPEC {
262 type Ux = u8;
263}
264#[doc = "`read()` method returns [nmicr::R](R) reader structure"]
265impl crate::Readable for NMICR_SPEC {
266 type Reader = R;
267}
268#[doc = "`write(|w| ..)` method takes [nmicr::W](W) writer structure"]
269impl crate::Writable for NMICR_SPEC {
270 type Writer = W;
271 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
272 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
273}
274#[doc = "`reset()` method sets NMICR to value 0"]
275impl crate::Resettable for NMICR_SPEC {
276 const RESET_VALUE: Self::Ux = 0;
277}