1#[doc = "Register `WDOGLOCK` reader"]
2pub struct R(crate::R<WDOGLOCK_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<WDOGLOCK_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<WDOGLOCK_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<WDOGLOCK_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `WDOGLOCK` writer"]
17pub struct W(crate::W<WDOGLOCK_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<WDOGLOCK_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<WDOGLOCK_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<WDOGLOCK_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "The WDOGLOCK Register diables write accesses to all other registers. This is to prevent rogue software from diabling the watchdog functionality. Writing a value 0x1ACCE551 enables write access to all other registers. Writing any other value disables write accesses.\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u32)]
40pub enum WDOGLOCK_A {
41 #[doc = "0: Write access is enabled, not locked"]
42 LOCKED = 0,
43 #[doc = "1: Write access is disabled, locked"]
44 NOT_LOCKED = 1,
45}
46impl From<WDOGLOCK_A> for u32 {
47 #[inline(always)]
48 fn from(variant: WDOGLOCK_A) -> Self {
49 variant as _
50 }
51}
52#[doc = "Field `WDOGLOCK` reader - The WDOGLOCK Register diables write accesses to all other registers. This is to prevent rogue software from diabling the watchdog functionality. Writing a value 0x1ACCE551 enables write access to all other registers. Writing any other value disables write accesses."]
53pub struct WDOGLOCK_R(crate::FieldReader<u32, WDOGLOCK_A>);
54impl WDOGLOCK_R {
55 #[inline(always)]
56 pub(crate) fn new(bits: u32) -> Self {
57 WDOGLOCK_R(crate::FieldReader::new(bits))
58 }
59 #[doc = r"Get enumerated values variant"]
60 #[inline(always)]
61 pub fn variant(&self) -> Option<WDOGLOCK_A> {
62 match self.bits {
63 0 => Some(WDOGLOCK_A::LOCKED),
64 1 => Some(WDOGLOCK_A::NOT_LOCKED),
65 _ => None,
66 }
67 }
68 #[doc = "Checks if the value of the field is `LOCKED`"]
69 #[inline(always)]
70 pub fn is_locked(&self) -> bool {
71 **self == WDOGLOCK_A::LOCKED
72 }
73 #[doc = "Checks if the value of the field is `NOT_LOCKED`"]
74 #[inline(always)]
75 pub fn is_not_locked(&self) -> bool {
76 **self == WDOGLOCK_A::NOT_LOCKED
77 }
78}
79impl core::ops::Deref for WDOGLOCK_R {
80 type Target = crate::FieldReader<u32, WDOGLOCK_A>;
81 #[inline(always)]
82 fn deref(&self) -> &Self::Target {
83 &self.0
84 }
85}
86#[doc = "Field `WDOGLOCK` writer - The WDOGLOCK Register diables write accesses to all other registers. This is to prevent rogue software from diabling the watchdog functionality. Writing a value 0x1ACCE551 enables write access to all other registers. Writing any other value disables write accesses."]
87pub struct WDOGLOCK_W<'a> {
88 w: &'a mut W,
89}
90impl<'a> WDOGLOCK_W<'a> {
91 #[doc = r"Writes `variant` to the field"]
92 #[inline(always)]
93 pub fn variant(self, variant: WDOGLOCK_A) -> &'a mut W {
94 unsafe { self.bits(variant.into()) }
95 }
96 #[doc = "Write access is enabled, not locked"]
97 #[inline(always)]
98 pub fn locked(self) -> &'a mut W {
99 self.variant(WDOGLOCK_A::LOCKED)
100 }
101 #[doc = "Write access is disabled, locked"]
102 #[inline(always)]
103 pub fn not_locked(self) -> &'a mut W {
104 self.variant(WDOGLOCK_A::NOT_LOCKED)
105 }
106 #[doc = r"Writes raw bits to the field"]
107 #[inline(always)]
108 pub unsafe fn bits(self, value: u32) -> &'a mut W {
109 self.w.bits = value as u32;
110 self.w
111 }
112}
113impl R {
114 #[doc = "Bits 0:31 - The WDOGLOCK Register diables write accesses to all other registers. This is to prevent rogue software from diabling the watchdog functionality. Writing a value 0x1ACCE551 enables write access to all other registers. Writing any other value disables write accesses."]
115 #[inline(always)]
116 pub fn wdoglock(&self) -> WDOGLOCK_R {
117 WDOGLOCK_R::new(self.bits as u32)
118 }
119}
120impl W {
121 #[doc = "Bits 0:31 - The WDOGLOCK Register diables write accesses to all other registers. This is to prevent rogue software from diabling the watchdog functionality. Writing a value 0x1ACCE551 enables write access to all other registers. Writing any other value disables write accesses."]
122 #[inline(always)]
123 pub fn wdoglock(&mut self) -> WDOGLOCK_W {
124 WDOGLOCK_W { w: self }
125 }
126 #[doc = "Writes raw bits to the register."]
127 #[inline(always)]
128 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
129 self.0.bits(bits);
130 self
131 }
132}
133#[doc = "The WDOGLOCK Register diables write accesses to all other registers. This is to prevent rogue software from diabling the watchdog functionality. Writing a value 0x1ACCE551 enables write access to all other registers. Writing any other value disables write accesses.\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 [wdoglock](index.html) module"]
134pub struct WDOGLOCK_SPEC;
135impl crate::RegisterSpec for WDOGLOCK_SPEC {
136 type Ux = u32;
137}
138#[doc = "`read()` method returns [wdoglock::R](R) reader structure"]
139impl crate::Readable for WDOGLOCK_SPEC {
140 type Reader = R;
141}
142#[doc = "`write(|w| ..)` method takes [wdoglock::W](W) writer structure"]
143impl crate::Writable for WDOGLOCK_SPEC {
144 type Writer = W;
145}
146#[doc = "`reset()` method sets WDOGLOCK to value 0"]
147impl crate::Resettable for WDOGLOCK_SPEC {
148 #[inline(always)]
149 fn reset_value() -> Self::Ux {
150 0
151 }
152}