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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
#[doc = "Reader of register PDAC_W1_1_34"]
pub type R = crate::R<u32, super::PDAC_W1_1_34>;
#[doc = "Writer for register PDAC_W1_1_34"]
pub type W = crate::W<u32, super::PDAC_W1_1_34>;
#[doc = "Register PDAC_W1_1_34 `reset()`'s with value 0"]
impl crate::ResetValue for super::PDAC_W1_1_34 {
  type Type = u32;
  #[inline(always)]
  fn reset_value() -> Self::Type {
    0
  }
}
#[doc = "Exclusive Access Lock\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EAL_A {
  #[doc = "0: Lock disabled"]
  EAL_0,
  #[doc = "1: Lock disabled until next reset"]
  EAL_1,
  #[doc = "2: Lock enabled, lock state = available"]
  EAL_2,
  #[doc = "3: Lock enabled, lock state = not available"]
  EAL_3,
}
impl From<EAL_A> for u8 {
  #[inline(always)]
  fn from(variant: EAL_A) -> Self {
    match variant {
      EAL_A::EAL_0 => 0,
      EAL_A::EAL_1 => 1,
      EAL_A::EAL_2 => 2,
      EAL_A::EAL_3 => 3,
    }
  }
}
#[doc = "Reader of field `EAL`"]
pub type EAL_R = crate::R<u8, EAL_A>;
impl EAL_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> EAL_A {
    match self.bits {
      0 => EAL_A::EAL_0,
      1 => EAL_A::EAL_1,
      2 => EAL_A::EAL_2,
      3 => EAL_A::EAL_3,
      _ => unreachable!(),
    }
  }
  #[doc = "Checks if the value of the field is `EAL_0`"]
  #[inline(always)]
  pub fn is_eal_0(&self) -> bool {
    *self == EAL_A::EAL_0
  }
  #[doc = "Checks if the value of the field is `EAL_1`"]
  #[inline(always)]
  pub fn is_eal_1(&self) -> bool {
    *self == EAL_A::EAL_1
  }
  #[doc = "Checks if the value of the field is `EAL_2`"]
  #[inline(always)]
  pub fn is_eal_2(&self) -> bool {
    *self == EAL_A::EAL_2
  }
  #[doc = "Checks if the value of the field is `EAL_3`"]
  #[inline(always)]
  pub fn is_eal_3(&self) -> bool {
    *self == EAL_A::EAL_3
  }
}
#[doc = "Write proxy for field `EAL`"]
pub struct EAL_W<'a> {
  w: &'a mut W,
}
impl<'a> EAL_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: EAL_A) -> &'a mut W {
    {
      self.bits(variant.into())
    }
  }
  #[doc = "Lock disabled"]
  #[inline(always)]
  pub fn eal_0(self) -> &'a mut W {
    self.variant(EAL_A::EAL_0)
  }
  #[doc = "Lock disabled until next reset"]
  #[inline(always)]
  pub fn eal_1(self) -> &'a mut W {
    self.variant(EAL_A::EAL_1)
  }
  #[doc = "Lock enabled, lock state = available"]
  #[inline(always)]
  pub fn eal_2(self) -> &'a mut W {
    self.variant(EAL_A::EAL_2)
  }
  #[doc = "Lock enabled, lock state = not available"]
  #[inline(always)]
  pub fn eal_3(self) -> &'a mut W {
    self.variant(EAL_A::EAL_3)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x03 << 24)) | (((value as u32) & 0x03) << 24);
    self.w
  }
}
#[doc = "Lock\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LK2_A {
  #[doc = "0: Entire PDACs can be written."]
  LK2_0,
  #[doc = "1: Entire PDACs can be written."]
  LK2_1,
  #[doc = "2: Domain x can only update the DxACP field and the LK2 field; no other PDACs fields can be written."]
  LK2_2,
  #[doc = "3: PDACs is locked (read-only) until the next reset."]
  LK2_3,
}
impl From<LK2_A> for u8 {
  #[inline(always)]
  fn from(variant: LK2_A) -> Self {
    match variant {
      LK2_A::LK2_0 => 0,
      LK2_A::LK2_1 => 1,
      LK2_A::LK2_2 => 2,
      LK2_A::LK2_3 => 3,
    }
  }
}
#[doc = "Reader of field `LK2`"]
pub type LK2_R = crate::R<u8, LK2_A>;
impl LK2_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> LK2_A {
    match self.bits {
      0 => LK2_A::LK2_0,
      1 => LK2_A::LK2_1,
      2 => LK2_A::LK2_2,
      3 => LK2_A::LK2_3,
      _ => unreachable!(),
    }
  }
  #[doc = "Checks if the value of the field is `LK2_0`"]
  #[inline(always)]
  pub fn is_lk2_0(&self) -> bool {
    *self == LK2_A::LK2_0
  }
  #[doc = "Checks if the value of the field is `LK2_1`"]
  #[inline(always)]
  pub fn is_lk2_1(&self) -> bool {
    *self == LK2_A::LK2_1
  }
  #[doc = "Checks if the value of the field is `LK2_2`"]
  #[inline(always)]
  pub fn is_lk2_2(&self) -> bool {
    *self == LK2_A::LK2_2
  }
  #[doc = "Checks if the value of the field is `LK2_3`"]
  #[inline(always)]
  pub fn is_lk2_3(&self) -> bool {
    *self == LK2_A::LK2_3
  }
}
#[doc = "Write proxy for field `LK2`"]
pub struct LK2_W<'a> {
  w: &'a mut W,
}
impl<'a> LK2_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: LK2_A) -> &'a mut W {
    {
      self.bits(variant.into())
    }
  }
  #[doc = "Entire PDACs can be written."]
  #[inline(always)]
  pub fn lk2_0(self) -> &'a mut W {
    self.variant(LK2_A::LK2_0)
  }
  #[doc = "Entire PDACs can be written."]
  #[inline(always)]
  pub fn lk2_1(self) -> &'a mut W {
    self.variant(LK2_A::LK2_1)
  }
  #[doc = "Domain x can only update the DxACP field and the LK2 field; no other PDACs fields can be written."]
  #[inline(always)]
  pub fn lk2_2(self) -> &'a mut W {
    self.variant(LK2_A::LK2_2)
  }
  #[doc = "PDACs is locked (read-only) until the next reset."]
  #[inline(always)]
  pub fn lk2_3(self) -> &'a mut W {
    self.variant(LK2_A::LK2_3)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bits(self, value: u8) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x03 << 29)) | (((value as u32) & 0x03) << 29);
    self.w
  }
}
#[doc = "Valid\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum VLD_A {
  #[doc = "0: The PDACs assignment is invalid."]
  VLD_0,
  #[doc = "1: The PDACs assignment is valid."]
  VLD_1,
}
impl From<VLD_A> for bool {
  #[inline(always)]
  fn from(variant: VLD_A) -> Self {
    match variant {
      VLD_A::VLD_0 => false,
      VLD_A::VLD_1 => true,
    }
  }
}
#[doc = "Reader of field `VLD`"]
pub type VLD_R = crate::R<bool, VLD_A>;
impl VLD_R {
  #[doc = r"Get enumerated values variant"]
  #[inline(always)]
  pub fn variant(&self) -> VLD_A {
    match self.bits {
      false => VLD_A::VLD_0,
      true => VLD_A::VLD_1,
    }
  }
  #[doc = "Checks if the value of the field is `VLD_0`"]
  #[inline(always)]
  pub fn is_vld_0(&self) -> bool {
    *self == VLD_A::VLD_0
  }
  #[doc = "Checks if the value of the field is `VLD_1`"]
  #[inline(always)]
  pub fn is_vld_1(&self) -> bool {
    *self == VLD_A::VLD_1
  }
}
#[doc = "Write proxy for field `VLD`"]
pub struct VLD_W<'a> {
  w: &'a mut W,
}
impl<'a> VLD_W<'a> {
  #[doc = r"Writes `variant` to the field"]
  #[inline(always)]
  pub fn variant(self, variant: VLD_A) -> &'a mut W {
    {
      self.bit(variant.into())
    }
  }
  #[doc = "The PDACs assignment is invalid."]
  #[inline(always)]
  pub fn vld_0(self) -> &'a mut W {
    self.variant(VLD_A::VLD_0)
  }
  #[doc = "The PDACs assignment is valid."]
  #[inline(always)]
  pub fn vld_1(self) -> &'a mut W {
    self.variant(VLD_A::VLD_1)
  }
  #[doc = r"Sets the field bit"]
  #[inline(always)]
  pub fn set_bit(self) -> &'a mut W {
    self.bit(true)
  }
  #[doc = r"Clears the field bit"]
  #[inline(always)]
  pub fn clear_bit(self) -> &'a mut W {
    self.bit(false)
  }
  #[doc = r"Writes raw bits to the field"]
  #[inline(always)]
  pub fn bit(self, value: bool) -> &'a mut W {
    self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
    self.w
  }
}
impl R {
  #[doc = "Bits 24:25 - Exclusive Access Lock"]
  #[inline(always)]
  pub fn eal(&self) -> EAL_R {
    EAL_R::new(((self.bits >> 24) & 0x03) as u8)
  }
  #[doc = "Bits 29:30 - Lock"]
  #[inline(always)]
  pub fn lk2(&self) -> LK2_R {
    LK2_R::new(((self.bits >> 29) & 0x03) as u8)
  }
  #[doc = "Bit 31 - Valid"]
  #[inline(always)]
  pub fn vld(&self) -> VLD_R {
    VLD_R::new(((self.bits >> 31) & 0x01) != 0)
  }
}
impl W {
  #[doc = "Bits 24:25 - Exclusive Access Lock"]
  #[inline(always)]
  pub fn eal(&mut self) -> EAL_W {
    EAL_W { w: self }
  }
  #[doc = "Bits 29:30 - Lock"]
  #[inline(always)]
  pub fn lk2(&mut self) -> LK2_W {
    LK2_W { w: self }
  }
  #[doc = "Bit 31 - Valid"]
  #[inline(always)]
  pub fn vld(&mut self) -> VLD_W {
    VLD_W { w: self }
  }
}