nrf52840_pac/wdt/
rren.rs

1#[doc = "Register `RREN` reader"]
2pub struct R(crate::R<RREN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RREN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RREN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RREN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `RREN` writer"]
17pub struct W(crate::W<RREN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<RREN_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<RREN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<RREN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `RR0` reader - Enable or disable RR\\[0\\]
38register"]
39pub type RR0_R = crate::BitReader<RR0_A>;
40#[doc = "Enable or disable RR\\[0\\]
41register\n\nValue on reset: 1"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43pub enum RR0_A {
44    #[doc = "0: Disable RR\\[0\\]
45register"]
46    DISABLED = 0,
47    #[doc = "1: Enable RR\\[0\\]
48register"]
49    ENABLED = 1,
50}
51impl From<RR0_A> for bool {
52    #[inline(always)]
53    fn from(variant: RR0_A) -> Self {
54        variant as u8 != 0
55    }
56}
57impl RR0_R {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> RR0_A {
61        match self.bits {
62            false => RR0_A::DISABLED,
63            true => RR0_A::ENABLED,
64        }
65    }
66    #[doc = "Checks if the value of the field is `DISABLED`"]
67    #[inline(always)]
68    pub fn is_disabled(&self) -> bool {
69        *self == RR0_A::DISABLED
70    }
71    #[doc = "Checks if the value of the field is `ENABLED`"]
72    #[inline(always)]
73    pub fn is_enabled(&self) -> bool {
74        *self == RR0_A::ENABLED
75    }
76}
77#[doc = "Field `RR0` writer - Enable or disable RR\\[0\\]
78register"]
79pub type RR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR0_A, O>;
80impl<'a, const O: u8> RR0_W<'a, O> {
81    #[doc = "Disable RR\\[0\\]
82register"]
83    #[inline(always)]
84    pub fn disabled(self) -> &'a mut W {
85        self.variant(RR0_A::DISABLED)
86    }
87    #[doc = "Enable RR\\[0\\]
88register"]
89    #[inline(always)]
90    pub fn enabled(self) -> &'a mut W {
91        self.variant(RR0_A::ENABLED)
92    }
93}
94#[doc = "Field `RR1` reader - Enable or disable RR\\[1\\]
95register"]
96pub type RR1_R = crate::BitReader<RR1_A>;
97#[doc = "Enable or disable RR\\[1\\]
98register\n\nValue on reset: 0"]
99#[derive(Clone, Copy, Debug, PartialEq)]
100pub enum RR1_A {
101    #[doc = "0: Disable RR\\[1\\]
102register"]
103    DISABLED = 0,
104    #[doc = "1: Enable RR\\[1\\]
105register"]
106    ENABLED = 1,
107}
108impl From<RR1_A> for bool {
109    #[inline(always)]
110    fn from(variant: RR1_A) -> Self {
111        variant as u8 != 0
112    }
113}
114impl RR1_R {
115    #[doc = "Get enumerated values variant"]
116    #[inline(always)]
117    pub fn variant(&self) -> RR1_A {
118        match self.bits {
119            false => RR1_A::DISABLED,
120            true => RR1_A::ENABLED,
121        }
122    }
123    #[doc = "Checks if the value of the field is `DISABLED`"]
124    #[inline(always)]
125    pub fn is_disabled(&self) -> bool {
126        *self == RR1_A::DISABLED
127    }
128    #[doc = "Checks if the value of the field is `ENABLED`"]
129    #[inline(always)]
130    pub fn is_enabled(&self) -> bool {
131        *self == RR1_A::ENABLED
132    }
133}
134#[doc = "Field `RR1` writer - Enable or disable RR\\[1\\]
135register"]
136pub type RR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR1_A, O>;
137impl<'a, const O: u8> RR1_W<'a, O> {
138    #[doc = "Disable RR\\[1\\]
139register"]
140    #[inline(always)]
141    pub fn disabled(self) -> &'a mut W {
142        self.variant(RR1_A::DISABLED)
143    }
144    #[doc = "Enable RR\\[1\\]
145register"]
146    #[inline(always)]
147    pub fn enabled(self) -> &'a mut W {
148        self.variant(RR1_A::ENABLED)
149    }
150}
151#[doc = "Field `RR2` reader - Enable or disable RR\\[2\\]
152register"]
153pub type RR2_R = crate::BitReader<RR2_A>;
154#[doc = "Enable or disable RR\\[2\\]
155register\n\nValue on reset: 0"]
156#[derive(Clone, Copy, Debug, PartialEq)]
157pub enum RR2_A {
158    #[doc = "0: Disable RR\\[2\\]
159register"]
160    DISABLED = 0,
161    #[doc = "1: Enable RR\\[2\\]
162register"]
163    ENABLED = 1,
164}
165impl From<RR2_A> for bool {
166    #[inline(always)]
167    fn from(variant: RR2_A) -> Self {
168        variant as u8 != 0
169    }
170}
171impl RR2_R {
172    #[doc = "Get enumerated values variant"]
173    #[inline(always)]
174    pub fn variant(&self) -> RR2_A {
175        match self.bits {
176            false => RR2_A::DISABLED,
177            true => RR2_A::ENABLED,
178        }
179    }
180    #[doc = "Checks if the value of the field is `DISABLED`"]
181    #[inline(always)]
182    pub fn is_disabled(&self) -> bool {
183        *self == RR2_A::DISABLED
184    }
185    #[doc = "Checks if the value of the field is `ENABLED`"]
186    #[inline(always)]
187    pub fn is_enabled(&self) -> bool {
188        *self == RR2_A::ENABLED
189    }
190}
191#[doc = "Field `RR2` writer - Enable or disable RR\\[2\\]
192register"]
193pub type RR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR2_A, O>;
194impl<'a, const O: u8> RR2_W<'a, O> {
195    #[doc = "Disable RR\\[2\\]
196register"]
197    #[inline(always)]
198    pub fn disabled(self) -> &'a mut W {
199        self.variant(RR2_A::DISABLED)
200    }
201    #[doc = "Enable RR\\[2\\]
202register"]
203    #[inline(always)]
204    pub fn enabled(self) -> &'a mut W {
205        self.variant(RR2_A::ENABLED)
206    }
207}
208#[doc = "Field `RR3` reader - Enable or disable RR\\[3\\]
209register"]
210pub type RR3_R = crate::BitReader<RR3_A>;
211#[doc = "Enable or disable RR\\[3\\]
212register\n\nValue on reset: 0"]
213#[derive(Clone, Copy, Debug, PartialEq)]
214pub enum RR3_A {
215    #[doc = "0: Disable RR\\[3\\]
216register"]
217    DISABLED = 0,
218    #[doc = "1: Enable RR\\[3\\]
219register"]
220    ENABLED = 1,
221}
222impl From<RR3_A> for bool {
223    #[inline(always)]
224    fn from(variant: RR3_A) -> Self {
225        variant as u8 != 0
226    }
227}
228impl RR3_R {
229    #[doc = "Get enumerated values variant"]
230    #[inline(always)]
231    pub fn variant(&self) -> RR3_A {
232        match self.bits {
233            false => RR3_A::DISABLED,
234            true => RR3_A::ENABLED,
235        }
236    }
237    #[doc = "Checks if the value of the field is `DISABLED`"]
238    #[inline(always)]
239    pub fn is_disabled(&self) -> bool {
240        *self == RR3_A::DISABLED
241    }
242    #[doc = "Checks if the value of the field is `ENABLED`"]
243    #[inline(always)]
244    pub fn is_enabled(&self) -> bool {
245        *self == RR3_A::ENABLED
246    }
247}
248#[doc = "Field `RR3` writer - Enable or disable RR\\[3\\]
249register"]
250pub type RR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR3_A, O>;
251impl<'a, const O: u8> RR3_W<'a, O> {
252    #[doc = "Disable RR\\[3\\]
253register"]
254    #[inline(always)]
255    pub fn disabled(self) -> &'a mut W {
256        self.variant(RR3_A::DISABLED)
257    }
258    #[doc = "Enable RR\\[3\\]
259register"]
260    #[inline(always)]
261    pub fn enabled(self) -> &'a mut W {
262        self.variant(RR3_A::ENABLED)
263    }
264}
265#[doc = "Field `RR4` reader - Enable or disable RR\\[4\\]
266register"]
267pub type RR4_R = crate::BitReader<RR4_A>;
268#[doc = "Enable or disable RR\\[4\\]
269register\n\nValue on reset: 0"]
270#[derive(Clone, Copy, Debug, PartialEq)]
271pub enum RR4_A {
272    #[doc = "0: Disable RR\\[4\\]
273register"]
274    DISABLED = 0,
275    #[doc = "1: Enable RR\\[4\\]
276register"]
277    ENABLED = 1,
278}
279impl From<RR4_A> for bool {
280    #[inline(always)]
281    fn from(variant: RR4_A) -> Self {
282        variant as u8 != 0
283    }
284}
285impl RR4_R {
286    #[doc = "Get enumerated values variant"]
287    #[inline(always)]
288    pub fn variant(&self) -> RR4_A {
289        match self.bits {
290            false => RR4_A::DISABLED,
291            true => RR4_A::ENABLED,
292        }
293    }
294    #[doc = "Checks if the value of the field is `DISABLED`"]
295    #[inline(always)]
296    pub fn is_disabled(&self) -> bool {
297        *self == RR4_A::DISABLED
298    }
299    #[doc = "Checks if the value of the field is `ENABLED`"]
300    #[inline(always)]
301    pub fn is_enabled(&self) -> bool {
302        *self == RR4_A::ENABLED
303    }
304}
305#[doc = "Field `RR4` writer - Enable or disable RR\\[4\\]
306register"]
307pub type RR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR4_A, O>;
308impl<'a, const O: u8> RR4_W<'a, O> {
309    #[doc = "Disable RR\\[4\\]
310register"]
311    #[inline(always)]
312    pub fn disabled(self) -> &'a mut W {
313        self.variant(RR4_A::DISABLED)
314    }
315    #[doc = "Enable RR\\[4\\]
316register"]
317    #[inline(always)]
318    pub fn enabled(self) -> &'a mut W {
319        self.variant(RR4_A::ENABLED)
320    }
321}
322#[doc = "Field `RR5` reader - Enable or disable RR\\[5\\]
323register"]
324pub type RR5_R = crate::BitReader<RR5_A>;
325#[doc = "Enable or disable RR\\[5\\]
326register\n\nValue on reset: 0"]
327#[derive(Clone, Copy, Debug, PartialEq)]
328pub enum RR5_A {
329    #[doc = "0: Disable RR\\[5\\]
330register"]
331    DISABLED = 0,
332    #[doc = "1: Enable RR\\[5\\]
333register"]
334    ENABLED = 1,
335}
336impl From<RR5_A> for bool {
337    #[inline(always)]
338    fn from(variant: RR5_A) -> Self {
339        variant as u8 != 0
340    }
341}
342impl RR5_R {
343    #[doc = "Get enumerated values variant"]
344    #[inline(always)]
345    pub fn variant(&self) -> RR5_A {
346        match self.bits {
347            false => RR5_A::DISABLED,
348            true => RR5_A::ENABLED,
349        }
350    }
351    #[doc = "Checks if the value of the field is `DISABLED`"]
352    #[inline(always)]
353    pub fn is_disabled(&self) -> bool {
354        *self == RR5_A::DISABLED
355    }
356    #[doc = "Checks if the value of the field is `ENABLED`"]
357    #[inline(always)]
358    pub fn is_enabled(&self) -> bool {
359        *self == RR5_A::ENABLED
360    }
361}
362#[doc = "Field `RR5` writer - Enable or disable RR\\[5\\]
363register"]
364pub type RR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR5_A, O>;
365impl<'a, const O: u8> RR5_W<'a, O> {
366    #[doc = "Disable RR\\[5\\]
367register"]
368    #[inline(always)]
369    pub fn disabled(self) -> &'a mut W {
370        self.variant(RR5_A::DISABLED)
371    }
372    #[doc = "Enable RR\\[5\\]
373register"]
374    #[inline(always)]
375    pub fn enabled(self) -> &'a mut W {
376        self.variant(RR5_A::ENABLED)
377    }
378}
379#[doc = "Field `RR6` reader - Enable or disable RR\\[6\\]
380register"]
381pub type RR6_R = crate::BitReader<RR6_A>;
382#[doc = "Enable or disable RR\\[6\\]
383register\n\nValue on reset: 0"]
384#[derive(Clone, Copy, Debug, PartialEq)]
385pub enum RR6_A {
386    #[doc = "0: Disable RR\\[6\\]
387register"]
388    DISABLED = 0,
389    #[doc = "1: Enable RR\\[6\\]
390register"]
391    ENABLED = 1,
392}
393impl From<RR6_A> for bool {
394    #[inline(always)]
395    fn from(variant: RR6_A) -> Self {
396        variant as u8 != 0
397    }
398}
399impl RR6_R {
400    #[doc = "Get enumerated values variant"]
401    #[inline(always)]
402    pub fn variant(&self) -> RR6_A {
403        match self.bits {
404            false => RR6_A::DISABLED,
405            true => RR6_A::ENABLED,
406        }
407    }
408    #[doc = "Checks if the value of the field is `DISABLED`"]
409    #[inline(always)]
410    pub fn is_disabled(&self) -> bool {
411        *self == RR6_A::DISABLED
412    }
413    #[doc = "Checks if the value of the field is `ENABLED`"]
414    #[inline(always)]
415    pub fn is_enabled(&self) -> bool {
416        *self == RR6_A::ENABLED
417    }
418}
419#[doc = "Field `RR6` writer - Enable or disable RR\\[6\\]
420register"]
421pub type RR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR6_A, O>;
422impl<'a, const O: u8> RR6_W<'a, O> {
423    #[doc = "Disable RR\\[6\\]
424register"]
425    #[inline(always)]
426    pub fn disabled(self) -> &'a mut W {
427        self.variant(RR6_A::DISABLED)
428    }
429    #[doc = "Enable RR\\[6\\]
430register"]
431    #[inline(always)]
432    pub fn enabled(self) -> &'a mut W {
433        self.variant(RR6_A::ENABLED)
434    }
435}
436#[doc = "Field `RR7` reader - Enable or disable RR\\[7\\]
437register"]
438pub type RR7_R = crate::BitReader<RR7_A>;
439#[doc = "Enable or disable RR\\[7\\]
440register\n\nValue on reset: 0"]
441#[derive(Clone, Copy, Debug, PartialEq)]
442pub enum RR7_A {
443    #[doc = "0: Disable RR\\[7\\]
444register"]
445    DISABLED = 0,
446    #[doc = "1: Enable RR\\[7\\]
447register"]
448    ENABLED = 1,
449}
450impl From<RR7_A> for bool {
451    #[inline(always)]
452    fn from(variant: RR7_A) -> Self {
453        variant as u8 != 0
454    }
455}
456impl RR7_R {
457    #[doc = "Get enumerated values variant"]
458    #[inline(always)]
459    pub fn variant(&self) -> RR7_A {
460        match self.bits {
461            false => RR7_A::DISABLED,
462            true => RR7_A::ENABLED,
463        }
464    }
465    #[doc = "Checks if the value of the field is `DISABLED`"]
466    #[inline(always)]
467    pub fn is_disabled(&self) -> bool {
468        *self == RR7_A::DISABLED
469    }
470    #[doc = "Checks if the value of the field is `ENABLED`"]
471    #[inline(always)]
472    pub fn is_enabled(&self) -> bool {
473        *self == RR7_A::ENABLED
474    }
475}
476#[doc = "Field `RR7` writer - Enable or disable RR\\[7\\]
477register"]
478pub type RR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RREN_SPEC, RR7_A, O>;
479impl<'a, const O: u8> RR7_W<'a, O> {
480    #[doc = "Disable RR\\[7\\]
481register"]
482    #[inline(always)]
483    pub fn disabled(self) -> &'a mut W {
484        self.variant(RR7_A::DISABLED)
485    }
486    #[doc = "Enable RR\\[7\\]
487register"]
488    #[inline(always)]
489    pub fn enabled(self) -> &'a mut W {
490        self.variant(RR7_A::ENABLED)
491    }
492}
493impl R {
494    #[doc = "Bit 0 - Enable or disable RR\\[0\\]
495register"]
496    #[inline(always)]
497    pub fn rr0(&self) -> RR0_R {
498        RR0_R::new((self.bits & 1) != 0)
499    }
500    #[doc = "Bit 1 - Enable or disable RR\\[1\\]
501register"]
502    #[inline(always)]
503    pub fn rr1(&self) -> RR1_R {
504        RR1_R::new(((self.bits >> 1) & 1) != 0)
505    }
506    #[doc = "Bit 2 - Enable or disable RR\\[2\\]
507register"]
508    #[inline(always)]
509    pub fn rr2(&self) -> RR2_R {
510        RR2_R::new(((self.bits >> 2) & 1) != 0)
511    }
512    #[doc = "Bit 3 - Enable or disable RR\\[3\\]
513register"]
514    #[inline(always)]
515    pub fn rr3(&self) -> RR3_R {
516        RR3_R::new(((self.bits >> 3) & 1) != 0)
517    }
518    #[doc = "Bit 4 - Enable or disable RR\\[4\\]
519register"]
520    #[inline(always)]
521    pub fn rr4(&self) -> RR4_R {
522        RR4_R::new(((self.bits >> 4) & 1) != 0)
523    }
524    #[doc = "Bit 5 - Enable or disable RR\\[5\\]
525register"]
526    #[inline(always)]
527    pub fn rr5(&self) -> RR5_R {
528        RR5_R::new(((self.bits >> 5) & 1) != 0)
529    }
530    #[doc = "Bit 6 - Enable or disable RR\\[6\\]
531register"]
532    #[inline(always)]
533    pub fn rr6(&self) -> RR6_R {
534        RR6_R::new(((self.bits >> 6) & 1) != 0)
535    }
536    #[doc = "Bit 7 - Enable or disable RR\\[7\\]
537register"]
538    #[inline(always)]
539    pub fn rr7(&self) -> RR7_R {
540        RR7_R::new(((self.bits >> 7) & 1) != 0)
541    }
542}
543impl W {
544    #[doc = "Bit 0 - Enable or disable RR\\[0\\]
545register"]
546    #[inline(always)]
547    pub fn rr0(&mut self) -> RR0_W<0> {
548        RR0_W::new(self)
549    }
550    #[doc = "Bit 1 - Enable or disable RR\\[1\\]
551register"]
552    #[inline(always)]
553    pub fn rr1(&mut self) -> RR1_W<1> {
554        RR1_W::new(self)
555    }
556    #[doc = "Bit 2 - Enable or disable RR\\[2\\]
557register"]
558    #[inline(always)]
559    pub fn rr2(&mut self) -> RR2_W<2> {
560        RR2_W::new(self)
561    }
562    #[doc = "Bit 3 - Enable or disable RR\\[3\\]
563register"]
564    #[inline(always)]
565    pub fn rr3(&mut self) -> RR3_W<3> {
566        RR3_W::new(self)
567    }
568    #[doc = "Bit 4 - Enable or disable RR\\[4\\]
569register"]
570    #[inline(always)]
571    pub fn rr4(&mut self) -> RR4_W<4> {
572        RR4_W::new(self)
573    }
574    #[doc = "Bit 5 - Enable or disable RR\\[5\\]
575register"]
576    #[inline(always)]
577    pub fn rr5(&mut self) -> RR5_W<5> {
578        RR5_W::new(self)
579    }
580    #[doc = "Bit 6 - Enable or disable RR\\[6\\]
581register"]
582    #[inline(always)]
583    pub fn rr6(&mut self) -> RR6_W<6> {
584        RR6_W::new(self)
585    }
586    #[doc = "Bit 7 - Enable or disable RR\\[7\\]
587register"]
588    #[inline(always)]
589    pub fn rr7(&mut self) -> RR7_W<7> {
590        RR7_W::new(self)
591    }
592    #[doc = "Writes raw bits to the register."]
593    #[inline(always)]
594    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
595        self.0.bits(bits);
596        self
597    }
598}
599#[doc = "Enable register for reload request registers\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 [rren](index.html) module"]
600pub struct RREN_SPEC;
601impl crate::RegisterSpec for RREN_SPEC {
602    type Ux = u32;
603}
604#[doc = "`read()` method returns [rren::R](R) reader structure"]
605impl crate::Readable for RREN_SPEC {
606    type Reader = R;
607}
608#[doc = "`write(|w| ..)` method takes [rren::W](W) writer structure"]
609impl crate::Writable for RREN_SPEC {
610    type Writer = W;
611}
612#[doc = "`reset()` method sets RREN to value 0x01"]
613impl crate::Resettable for RREN_SPEC {
614    #[inline(always)]
615    fn reset_value() -> Self::Ux {
616        0x01
617    }
618}