nrf5340_net_pac/timer0_ns/
inten.rs

1#[doc = "Register `INTEN` reader"]
2pub struct R(crate::R<INTEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTEN` writer"]
17pub struct W(crate::W<INTEN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTEN_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<INTEN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTEN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `COMPARE0` reader - Enable or disable interrupt for event COMPARE\\[0\\]"]
38pub type COMPARE0_R = crate::BitReader<COMPARE0_A>;
39#[doc = "Enable or disable interrupt for event COMPARE\\[0\\]\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum COMPARE0_A {
42    #[doc = "0: Disable"]
43    DISABLED = 0,
44    #[doc = "1: Enable"]
45    ENABLED = 1,
46}
47impl From<COMPARE0_A> for bool {
48    #[inline(always)]
49    fn from(variant: COMPARE0_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl COMPARE0_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> COMPARE0_A {
57        match self.bits {
58            false => COMPARE0_A::DISABLED,
59            true => COMPARE0_A::ENABLED,
60        }
61    }
62    #[doc = "Checks if the value of the field is `DISABLED`"]
63    #[inline(always)]
64    pub fn is_disabled(&self) -> bool {
65        *self == COMPARE0_A::DISABLED
66    }
67    #[doc = "Checks if the value of the field is `ENABLED`"]
68    #[inline(always)]
69    pub fn is_enabled(&self) -> bool {
70        *self == COMPARE0_A::ENABLED
71    }
72}
73#[doc = "Field `COMPARE0` writer - Enable or disable interrupt for event COMPARE\\[0\\]"]
74pub type COMPARE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE0_A, O>;
75impl<'a, const O: u8> COMPARE0_W<'a, O> {
76    #[doc = "Disable"]
77    #[inline(always)]
78    pub fn disabled(self) -> &'a mut W {
79        self.variant(COMPARE0_A::DISABLED)
80    }
81    #[doc = "Enable"]
82    #[inline(always)]
83    pub fn enabled(self) -> &'a mut W {
84        self.variant(COMPARE0_A::ENABLED)
85    }
86}
87#[doc = "Field `COMPARE1` reader - Enable or disable interrupt for event COMPARE\\[1\\]"]
88pub type COMPARE1_R = crate::BitReader<COMPARE1_A>;
89#[doc = "Enable or disable interrupt for event COMPARE\\[1\\]\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq)]
91pub enum COMPARE1_A {
92    #[doc = "0: Disable"]
93    DISABLED = 0,
94    #[doc = "1: Enable"]
95    ENABLED = 1,
96}
97impl From<COMPARE1_A> for bool {
98    #[inline(always)]
99    fn from(variant: COMPARE1_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl COMPARE1_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> COMPARE1_A {
107        match self.bits {
108            false => COMPARE1_A::DISABLED,
109            true => COMPARE1_A::ENABLED,
110        }
111    }
112    #[doc = "Checks if the value of the field is `DISABLED`"]
113    #[inline(always)]
114    pub fn is_disabled(&self) -> bool {
115        *self == COMPARE1_A::DISABLED
116    }
117    #[doc = "Checks if the value of the field is `ENABLED`"]
118    #[inline(always)]
119    pub fn is_enabled(&self) -> bool {
120        *self == COMPARE1_A::ENABLED
121    }
122}
123#[doc = "Field `COMPARE1` writer - Enable or disable interrupt for event COMPARE\\[1\\]"]
124pub type COMPARE1_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE1_A, O>;
125impl<'a, const O: u8> COMPARE1_W<'a, O> {
126    #[doc = "Disable"]
127    #[inline(always)]
128    pub fn disabled(self) -> &'a mut W {
129        self.variant(COMPARE1_A::DISABLED)
130    }
131    #[doc = "Enable"]
132    #[inline(always)]
133    pub fn enabled(self) -> &'a mut W {
134        self.variant(COMPARE1_A::ENABLED)
135    }
136}
137#[doc = "Field `COMPARE2` reader - Enable or disable interrupt for event COMPARE\\[2\\]"]
138pub type COMPARE2_R = crate::BitReader<COMPARE2_A>;
139#[doc = "Enable or disable interrupt for event COMPARE\\[2\\]\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum COMPARE2_A {
142    #[doc = "0: Disable"]
143    DISABLED = 0,
144    #[doc = "1: Enable"]
145    ENABLED = 1,
146}
147impl From<COMPARE2_A> for bool {
148    #[inline(always)]
149    fn from(variant: COMPARE2_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl COMPARE2_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> COMPARE2_A {
157        match self.bits {
158            false => COMPARE2_A::DISABLED,
159            true => COMPARE2_A::ENABLED,
160        }
161    }
162    #[doc = "Checks if the value of the field is `DISABLED`"]
163    #[inline(always)]
164    pub fn is_disabled(&self) -> bool {
165        *self == COMPARE2_A::DISABLED
166    }
167    #[doc = "Checks if the value of the field is `ENABLED`"]
168    #[inline(always)]
169    pub fn is_enabled(&self) -> bool {
170        *self == COMPARE2_A::ENABLED
171    }
172}
173#[doc = "Field `COMPARE2` writer - Enable or disable interrupt for event COMPARE\\[2\\]"]
174pub type COMPARE2_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE2_A, O>;
175impl<'a, const O: u8> COMPARE2_W<'a, O> {
176    #[doc = "Disable"]
177    #[inline(always)]
178    pub fn disabled(self) -> &'a mut W {
179        self.variant(COMPARE2_A::DISABLED)
180    }
181    #[doc = "Enable"]
182    #[inline(always)]
183    pub fn enabled(self) -> &'a mut W {
184        self.variant(COMPARE2_A::ENABLED)
185    }
186}
187#[doc = "Field `COMPARE3` reader - Enable or disable interrupt for event COMPARE\\[3\\]"]
188pub type COMPARE3_R = crate::BitReader<COMPARE3_A>;
189#[doc = "Enable or disable interrupt for event COMPARE\\[3\\]\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum COMPARE3_A {
192    #[doc = "0: Disable"]
193    DISABLED = 0,
194    #[doc = "1: Enable"]
195    ENABLED = 1,
196}
197impl From<COMPARE3_A> for bool {
198    #[inline(always)]
199    fn from(variant: COMPARE3_A) -> Self {
200        variant as u8 != 0
201    }
202}
203impl COMPARE3_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> COMPARE3_A {
207        match self.bits {
208            false => COMPARE3_A::DISABLED,
209            true => COMPARE3_A::ENABLED,
210        }
211    }
212    #[doc = "Checks if the value of the field is `DISABLED`"]
213    #[inline(always)]
214    pub fn is_disabled(&self) -> bool {
215        *self == COMPARE3_A::DISABLED
216    }
217    #[doc = "Checks if the value of the field is `ENABLED`"]
218    #[inline(always)]
219    pub fn is_enabled(&self) -> bool {
220        *self == COMPARE3_A::ENABLED
221    }
222}
223#[doc = "Field `COMPARE3` writer - Enable or disable interrupt for event COMPARE\\[3\\]"]
224pub type COMPARE3_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE3_A, O>;
225impl<'a, const O: u8> COMPARE3_W<'a, O> {
226    #[doc = "Disable"]
227    #[inline(always)]
228    pub fn disabled(self) -> &'a mut W {
229        self.variant(COMPARE3_A::DISABLED)
230    }
231    #[doc = "Enable"]
232    #[inline(always)]
233    pub fn enabled(self) -> &'a mut W {
234        self.variant(COMPARE3_A::ENABLED)
235    }
236}
237#[doc = "Field `COMPARE4` reader - Enable or disable interrupt for event COMPARE\\[4\\]"]
238pub type COMPARE4_R = crate::BitReader<COMPARE4_A>;
239#[doc = "Enable or disable interrupt for event COMPARE\\[4\\]\n\nValue on reset: 0"]
240#[derive(Clone, Copy, Debug, PartialEq)]
241pub enum COMPARE4_A {
242    #[doc = "0: Disable"]
243    DISABLED = 0,
244    #[doc = "1: Enable"]
245    ENABLED = 1,
246}
247impl From<COMPARE4_A> for bool {
248    #[inline(always)]
249    fn from(variant: COMPARE4_A) -> Self {
250        variant as u8 != 0
251    }
252}
253impl COMPARE4_R {
254    #[doc = "Get enumerated values variant"]
255    #[inline(always)]
256    pub fn variant(&self) -> COMPARE4_A {
257        match self.bits {
258            false => COMPARE4_A::DISABLED,
259            true => COMPARE4_A::ENABLED,
260        }
261    }
262    #[doc = "Checks if the value of the field is `DISABLED`"]
263    #[inline(always)]
264    pub fn is_disabled(&self) -> bool {
265        *self == COMPARE4_A::DISABLED
266    }
267    #[doc = "Checks if the value of the field is `ENABLED`"]
268    #[inline(always)]
269    pub fn is_enabled(&self) -> bool {
270        *self == COMPARE4_A::ENABLED
271    }
272}
273#[doc = "Field `COMPARE4` writer - Enable or disable interrupt for event COMPARE\\[4\\]"]
274pub type COMPARE4_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE4_A, O>;
275impl<'a, const O: u8> COMPARE4_W<'a, O> {
276    #[doc = "Disable"]
277    #[inline(always)]
278    pub fn disabled(self) -> &'a mut W {
279        self.variant(COMPARE4_A::DISABLED)
280    }
281    #[doc = "Enable"]
282    #[inline(always)]
283    pub fn enabled(self) -> &'a mut W {
284        self.variant(COMPARE4_A::ENABLED)
285    }
286}
287#[doc = "Field `COMPARE5` reader - Enable or disable interrupt for event COMPARE\\[5\\]"]
288pub type COMPARE5_R = crate::BitReader<COMPARE5_A>;
289#[doc = "Enable or disable interrupt for event COMPARE\\[5\\]\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq)]
291pub enum COMPARE5_A {
292    #[doc = "0: Disable"]
293    DISABLED = 0,
294    #[doc = "1: Enable"]
295    ENABLED = 1,
296}
297impl From<COMPARE5_A> for bool {
298    #[inline(always)]
299    fn from(variant: COMPARE5_A) -> Self {
300        variant as u8 != 0
301    }
302}
303impl COMPARE5_R {
304    #[doc = "Get enumerated values variant"]
305    #[inline(always)]
306    pub fn variant(&self) -> COMPARE5_A {
307        match self.bits {
308            false => COMPARE5_A::DISABLED,
309            true => COMPARE5_A::ENABLED,
310        }
311    }
312    #[doc = "Checks if the value of the field is `DISABLED`"]
313    #[inline(always)]
314    pub fn is_disabled(&self) -> bool {
315        *self == COMPARE5_A::DISABLED
316    }
317    #[doc = "Checks if the value of the field is `ENABLED`"]
318    #[inline(always)]
319    pub fn is_enabled(&self) -> bool {
320        *self == COMPARE5_A::ENABLED
321    }
322}
323#[doc = "Field `COMPARE5` writer - Enable or disable interrupt for event COMPARE\\[5\\]"]
324pub type COMPARE5_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE5_A, O>;
325impl<'a, const O: u8> COMPARE5_W<'a, O> {
326    #[doc = "Disable"]
327    #[inline(always)]
328    pub fn disabled(self) -> &'a mut W {
329        self.variant(COMPARE5_A::DISABLED)
330    }
331    #[doc = "Enable"]
332    #[inline(always)]
333    pub fn enabled(self) -> &'a mut W {
334        self.variant(COMPARE5_A::ENABLED)
335    }
336}
337#[doc = "Field `COMPARE6` reader - Enable or disable interrupt for event COMPARE\\[6\\]"]
338pub type COMPARE6_R = crate::BitReader<COMPARE6_A>;
339#[doc = "Enable or disable interrupt for event COMPARE\\[6\\]\n\nValue on reset: 0"]
340#[derive(Clone, Copy, Debug, PartialEq)]
341pub enum COMPARE6_A {
342    #[doc = "0: Disable"]
343    DISABLED = 0,
344    #[doc = "1: Enable"]
345    ENABLED = 1,
346}
347impl From<COMPARE6_A> for bool {
348    #[inline(always)]
349    fn from(variant: COMPARE6_A) -> Self {
350        variant as u8 != 0
351    }
352}
353impl COMPARE6_R {
354    #[doc = "Get enumerated values variant"]
355    #[inline(always)]
356    pub fn variant(&self) -> COMPARE6_A {
357        match self.bits {
358            false => COMPARE6_A::DISABLED,
359            true => COMPARE6_A::ENABLED,
360        }
361    }
362    #[doc = "Checks if the value of the field is `DISABLED`"]
363    #[inline(always)]
364    pub fn is_disabled(&self) -> bool {
365        *self == COMPARE6_A::DISABLED
366    }
367    #[doc = "Checks if the value of the field is `ENABLED`"]
368    #[inline(always)]
369    pub fn is_enabled(&self) -> bool {
370        *self == COMPARE6_A::ENABLED
371    }
372}
373#[doc = "Field `COMPARE6` writer - Enable or disable interrupt for event COMPARE\\[6\\]"]
374pub type COMPARE6_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE6_A, O>;
375impl<'a, const O: u8> COMPARE6_W<'a, O> {
376    #[doc = "Disable"]
377    #[inline(always)]
378    pub fn disabled(self) -> &'a mut W {
379        self.variant(COMPARE6_A::DISABLED)
380    }
381    #[doc = "Enable"]
382    #[inline(always)]
383    pub fn enabled(self) -> &'a mut W {
384        self.variant(COMPARE6_A::ENABLED)
385    }
386}
387#[doc = "Field `COMPARE7` reader - Enable or disable interrupt for event COMPARE\\[7\\]"]
388pub type COMPARE7_R = crate::BitReader<COMPARE7_A>;
389#[doc = "Enable or disable interrupt for event COMPARE\\[7\\]\n\nValue on reset: 0"]
390#[derive(Clone, Copy, Debug, PartialEq)]
391pub enum COMPARE7_A {
392    #[doc = "0: Disable"]
393    DISABLED = 0,
394    #[doc = "1: Enable"]
395    ENABLED = 1,
396}
397impl From<COMPARE7_A> for bool {
398    #[inline(always)]
399    fn from(variant: COMPARE7_A) -> Self {
400        variant as u8 != 0
401    }
402}
403impl COMPARE7_R {
404    #[doc = "Get enumerated values variant"]
405    #[inline(always)]
406    pub fn variant(&self) -> COMPARE7_A {
407        match self.bits {
408            false => COMPARE7_A::DISABLED,
409            true => COMPARE7_A::ENABLED,
410        }
411    }
412    #[doc = "Checks if the value of the field is `DISABLED`"]
413    #[inline(always)]
414    pub fn is_disabled(&self) -> bool {
415        *self == COMPARE7_A::DISABLED
416    }
417    #[doc = "Checks if the value of the field is `ENABLED`"]
418    #[inline(always)]
419    pub fn is_enabled(&self) -> bool {
420        *self == COMPARE7_A::ENABLED
421    }
422}
423#[doc = "Field `COMPARE7` writer - Enable or disable interrupt for event COMPARE\\[7\\]"]
424pub type COMPARE7_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, COMPARE7_A, O>;
425impl<'a, const O: u8> COMPARE7_W<'a, O> {
426    #[doc = "Disable"]
427    #[inline(always)]
428    pub fn disabled(self) -> &'a mut W {
429        self.variant(COMPARE7_A::DISABLED)
430    }
431    #[doc = "Enable"]
432    #[inline(always)]
433    pub fn enabled(self) -> &'a mut W {
434        self.variant(COMPARE7_A::ENABLED)
435    }
436}
437impl R {
438    #[doc = "Bit 16 - Enable or disable interrupt for event COMPARE\\[0\\]"]
439    #[inline(always)]
440    pub fn compare0(&self) -> COMPARE0_R {
441        COMPARE0_R::new(((self.bits >> 16) & 1) != 0)
442    }
443    #[doc = "Bit 17 - Enable or disable interrupt for event COMPARE\\[1\\]"]
444    #[inline(always)]
445    pub fn compare1(&self) -> COMPARE1_R {
446        COMPARE1_R::new(((self.bits >> 17) & 1) != 0)
447    }
448    #[doc = "Bit 18 - Enable or disable interrupt for event COMPARE\\[2\\]"]
449    #[inline(always)]
450    pub fn compare2(&self) -> COMPARE2_R {
451        COMPARE2_R::new(((self.bits >> 18) & 1) != 0)
452    }
453    #[doc = "Bit 19 - Enable or disable interrupt for event COMPARE\\[3\\]"]
454    #[inline(always)]
455    pub fn compare3(&self) -> COMPARE3_R {
456        COMPARE3_R::new(((self.bits >> 19) & 1) != 0)
457    }
458    #[doc = "Bit 20 - Enable or disable interrupt for event COMPARE\\[4\\]"]
459    #[inline(always)]
460    pub fn compare4(&self) -> COMPARE4_R {
461        COMPARE4_R::new(((self.bits >> 20) & 1) != 0)
462    }
463    #[doc = "Bit 21 - Enable or disable interrupt for event COMPARE\\[5\\]"]
464    #[inline(always)]
465    pub fn compare5(&self) -> COMPARE5_R {
466        COMPARE5_R::new(((self.bits >> 21) & 1) != 0)
467    }
468    #[doc = "Bit 22 - Enable or disable interrupt for event COMPARE\\[6\\]"]
469    #[inline(always)]
470    pub fn compare6(&self) -> COMPARE6_R {
471        COMPARE6_R::new(((self.bits >> 22) & 1) != 0)
472    }
473    #[doc = "Bit 23 - Enable or disable interrupt for event COMPARE\\[7\\]"]
474    #[inline(always)]
475    pub fn compare7(&self) -> COMPARE7_R {
476        COMPARE7_R::new(((self.bits >> 23) & 1) != 0)
477    }
478}
479impl W {
480    #[doc = "Bit 16 - Enable or disable interrupt for event COMPARE\\[0\\]"]
481    #[inline(always)]
482    pub fn compare0(&mut self) -> COMPARE0_W<16> {
483        COMPARE0_W::new(self)
484    }
485    #[doc = "Bit 17 - Enable or disable interrupt for event COMPARE\\[1\\]"]
486    #[inline(always)]
487    pub fn compare1(&mut self) -> COMPARE1_W<17> {
488        COMPARE1_W::new(self)
489    }
490    #[doc = "Bit 18 - Enable or disable interrupt for event COMPARE\\[2\\]"]
491    #[inline(always)]
492    pub fn compare2(&mut self) -> COMPARE2_W<18> {
493        COMPARE2_W::new(self)
494    }
495    #[doc = "Bit 19 - Enable or disable interrupt for event COMPARE\\[3\\]"]
496    #[inline(always)]
497    pub fn compare3(&mut self) -> COMPARE3_W<19> {
498        COMPARE3_W::new(self)
499    }
500    #[doc = "Bit 20 - Enable or disable interrupt for event COMPARE\\[4\\]"]
501    #[inline(always)]
502    pub fn compare4(&mut self) -> COMPARE4_W<20> {
503        COMPARE4_W::new(self)
504    }
505    #[doc = "Bit 21 - Enable or disable interrupt for event COMPARE\\[5\\]"]
506    #[inline(always)]
507    pub fn compare5(&mut self) -> COMPARE5_W<21> {
508        COMPARE5_W::new(self)
509    }
510    #[doc = "Bit 22 - Enable or disable interrupt for event COMPARE\\[6\\]"]
511    #[inline(always)]
512    pub fn compare6(&mut self) -> COMPARE6_W<22> {
513        COMPARE6_W::new(self)
514    }
515    #[doc = "Bit 23 - Enable or disable interrupt for event COMPARE\\[7\\]"]
516    #[inline(always)]
517    pub fn compare7(&mut self) -> COMPARE7_W<23> {
518        COMPARE7_W::new(self)
519    }
520    #[doc = "Writes raw bits to the register."]
521    #[inline(always)]
522    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
523        self.0.bits(bits);
524        self
525    }
526}
527#[doc = "Enable or disable interrupt\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 [inten](index.html) module"]
528pub struct INTEN_SPEC;
529impl crate::RegisterSpec for INTEN_SPEC {
530    type Ux = u32;
531}
532#[doc = "`read()` method returns [inten::R](R) reader structure"]
533impl crate::Readable for INTEN_SPEC {
534    type Reader = R;
535}
536#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"]
537impl crate::Writable for INTEN_SPEC {
538    type Writer = W;
539}
540#[doc = "`reset()` method sets INTEN to value 0"]
541impl crate::Resettable for INTEN_SPEC {
542    #[inline(always)]
543    fn reset_value() -> Self::Ux {
544        0
545    }
546}