s32k142w_pac/aips/
opacrb.rs

1#[doc = "Register `OPACRB` reader"]
2pub struct R(crate::R<OPACRB_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<OPACRB_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<OPACRB_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<OPACRB_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `OPACRB` writer"]
17pub struct W(crate::W<OPACRB_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<OPACRB_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<OPACRB_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<OPACRB_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Trusted Protect\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum TP6_A {
40    #[doc = "0: Accesses from an untrusted master are allowed."]
41    TP6_0 = 0,
42    #[doc = "1: Accesses from an untrusted master are not allowed."]
43    TP6_1 = 1,
44}
45impl From<TP6_A> for bool {
46    #[inline(always)]
47    fn from(variant: TP6_A) -> Self {
48        variant as u8 != 0
49    }
50}
51#[doc = "Field `TP6` reader - Trusted Protect"]
52pub struct TP6_R(crate::FieldReader<bool, TP6_A>);
53impl TP6_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        TP6_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> TP6_A {
61        match self.bits {
62            false => TP6_A::TP6_0,
63            true => TP6_A::TP6_1,
64        }
65    }
66    #[doc = "Checks if the value of the field is `TP6_0`"]
67    #[inline(always)]
68    pub fn is_tp6_0(&self) -> bool {
69        **self == TP6_A::TP6_0
70    }
71    #[doc = "Checks if the value of the field is `TP6_1`"]
72    #[inline(always)]
73    pub fn is_tp6_1(&self) -> bool {
74        **self == TP6_A::TP6_1
75    }
76}
77impl core::ops::Deref for TP6_R {
78    type Target = crate::FieldReader<bool, TP6_A>;
79    #[inline(always)]
80    fn deref(&self) -> &Self::Target {
81        &self.0
82    }
83}
84#[doc = "Field `TP6` writer - Trusted Protect"]
85pub struct TP6_W<'a> {
86    w: &'a mut W,
87}
88impl<'a> TP6_W<'a> {
89    #[doc = r"Writes `variant` to the field"]
90    #[inline(always)]
91    pub fn variant(self, variant: TP6_A) -> &'a mut W {
92        self.bit(variant.into())
93    }
94    #[doc = "Accesses from an untrusted master are allowed."]
95    #[inline(always)]
96    pub fn tp6_0(self) -> &'a mut W {
97        self.variant(TP6_A::TP6_0)
98    }
99    #[doc = "Accesses from an untrusted master are not allowed."]
100    #[inline(always)]
101    pub fn tp6_1(self) -> &'a mut W {
102        self.variant(TP6_A::TP6_1)
103    }
104    #[doc = r"Sets the field bit"]
105    #[inline(always)]
106    pub fn set_bit(self) -> &'a mut W {
107        self.bit(true)
108    }
109    #[doc = r"Clears the field bit"]
110    #[inline(always)]
111    pub fn clear_bit(self) -> &'a mut W {
112        self.bit(false)
113    }
114    #[doc = r"Writes raw bits to the field"]
115    #[inline(always)]
116    pub fn bit(self, value: bool) -> &'a mut W {
117        self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
118        self.w
119    }
120}
121#[doc = "Write Protect\n\nValue on reset: 0"]
122#[derive(Clone, Copy, Debug, PartialEq)]
123pub enum WP6_A {
124    #[doc = "0: This peripheral allows write accesses."]
125    WP6_0 = 0,
126    #[doc = "1: This peripheral is write protected."]
127    WP6_1 = 1,
128}
129impl From<WP6_A> for bool {
130    #[inline(always)]
131    fn from(variant: WP6_A) -> Self {
132        variant as u8 != 0
133    }
134}
135#[doc = "Field `WP6` reader - Write Protect"]
136pub struct WP6_R(crate::FieldReader<bool, WP6_A>);
137impl WP6_R {
138    #[inline(always)]
139    pub(crate) fn new(bits: bool) -> Self {
140        WP6_R(crate::FieldReader::new(bits))
141    }
142    #[doc = r"Get enumerated values variant"]
143    #[inline(always)]
144    pub fn variant(&self) -> WP6_A {
145        match self.bits {
146            false => WP6_A::WP6_0,
147            true => WP6_A::WP6_1,
148        }
149    }
150    #[doc = "Checks if the value of the field is `WP6_0`"]
151    #[inline(always)]
152    pub fn is_wp6_0(&self) -> bool {
153        **self == WP6_A::WP6_0
154    }
155    #[doc = "Checks if the value of the field is `WP6_1`"]
156    #[inline(always)]
157    pub fn is_wp6_1(&self) -> bool {
158        **self == WP6_A::WP6_1
159    }
160}
161impl core::ops::Deref for WP6_R {
162    type Target = crate::FieldReader<bool, WP6_A>;
163    #[inline(always)]
164    fn deref(&self) -> &Self::Target {
165        &self.0
166    }
167}
168#[doc = "Field `WP6` writer - Write Protect"]
169pub struct WP6_W<'a> {
170    w: &'a mut W,
171}
172impl<'a> WP6_W<'a> {
173    #[doc = r"Writes `variant` to the field"]
174    #[inline(always)]
175    pub fn variant(self, variant: WP6_A) -> &'a mut W {
176        self.bit(variant.into())
177    }
178    #[doc = "This peripheral allows write accesses."]
179    #[inline(always)]
180    pub fn wp6_0(self) -> &'a mut W {
181        self.variant(WP6_A::WP6_0)
182    }
183    #[doc = "This peripheral is write protected."]
184    #[inline(always)]
185    pub fn wp6_1(self) -> &'a mut W {
186        self.variant(WP6_A::WP6_1)
187    }
188    #[doc = r"Sets the field bit"]
189    #[inline(always)]
190    pub fn set_bit(self) -> &'a mut W {
191        self.bit(true)
192    }
193    #[doc = r"Clears the field bit"]
194    #[inline(always)]
195    pub fn clear_bit(self) -> &'a mut W {
196        self.bit(false)
197    }
198    #[doc = r"Writes raw bits to the field"]
199    #[inline(always)]
200    pub fn bit(self, value: bool) -> &'a mut W {
201        self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
202        self.w
203    }
204}
205#[doc = "Supervisor Protect\n\nValue on reset: 1"]
206#[derive(Clone, Copy, Debug, PartialEq)]
207pub enum SP6_A {
208    #[doc = "0: This peripheral does not require supervisor privilege level for accesses."]
209    SP6_0 = 0,
210    #[doc = "1: This peripheral requires supervisor privilege level for accesses."]
211    SP6_1 = 1,
212}
213impl From<SP6_A> for bool {
214    #[inline(always)]
215    fn from(variant: SP6_A) -> Self {
216        variant as u8 != 0
217    }
218}
219#[doc = "Field `SP6` reader - Supervisor Protect"]
220pub struct SP6_R(crate::FieldReader<bool, SP6_A>);
221impl SP6_R {
222    #[inline(always)]
223    pub(crate) fn new(bits: bool) -> Self {
224        SP6_R(crate::FieldReader::new(bits))
225    }
226    #[doc = r"Get enumerated values variant"]
227    #[inline(always)]
228    pub fn variant(&self) -> SP6_A {
229        match self.bits {
230            false => SP6_A::SP6_0,
231            true => SP6_A::SP6_1,
232        }
233    }
234    #[doc = "Checks if the value of the field is `SP6_0`"]
235    #[inline(always)]
236    pub fn is_sp6_0(&self) -> bool {
237        **self == SP6_A::SP6_0
238    }
239    #[doc = "Checks if the value of the field is `SP6_1`"]
240    #[inline(always)]
241    pub fn is_sp6_1(&self) -> bool {
242        **self == SP6_A::SP6_1
243    }
244}
245impl core::ops::Deref for SP6_R {
246    type Target = crate::FieldReader<bool, SP6_A>;
247    #[inline(always)]
248    fn deref(&self) -> &Self::Target {
249        &self.0
250    }
251}
252#[doc = "Field `SP6` writer - Supervisor Protect"]
253pub struct SP6_W<'a> {
254    w: &'a mut W,
255}
256impl<'a> SP6_W<'a> {
257    #[doc = r"Writes `variant` to the field"]
258    #[inline(always)]
259    pub fn variant(self, variant: SP6_A) -> &'a mut W {
260        self.bit(variant.into())
261    }
262    #[doc = "This peripheral does not require supervisor privilege level for accesses."]
263    #[inline(always)]
264    pub fn sp6_0(self) -> &'a mut W {
265        self.variant(SP6_A::SP6_0)
266    }
267    #[doc = "This peripheral requires supervisor privilege level for accesses."]
268    #[inline(always)]
269    pub fn sp6_1(self) -> &'a mut W {
270        self.variant(SP6_A::SP6_1)
271    }
272    #[doc = r"Sets the field bit"]
273    #[inline(always)]
274    pub fn set_bit(self) -> &'a mut W {
275        self.bit(true)
276    }
277    #[doc = r"Clears the field bit"]
278    #[inline(always)]
279    pub fn clear_bit(self) -> &'a mut W {
280        self.bit(false)
281    }
282    #[doc = r"Writes raw bits to the field"]
283    #[inline(always)]
284    pub fn bit(self, value: bool) -> &'a mut W {
285        self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
286        self.w
287    }
288}
289#[doc = "Trusted Protect\n\nValue on reset: 0"]
290#[derive(Clone, Copy, Debug, PartialEq)]
291pub enum TP5_A {
292    #[doc = "0: Accesses from an untrusted master are allowed."]
293    TP5_0 = 0,
294    #[doc = "1: Accesses from an untrusted master are not allowed."]
295    TP5_1 = 1,
296}
297impl From<TP5_A> for bool {
298    #[inline(always)]
299    fn from(variant: TP5_A) -> Self {
300        variant as u8 != 0
301    }
302}
303#[doc = "Field `TP5` reader - Trusted Protect"]
304pub struct TP5_R(crate::FieldReader<bool, TP5_A>);
305impl TP5_R {
306    #[inline(always)]
307    pub(crate) fn new(bits: bool) -> Self {
308        TP5_R(crate::FieldReader::new(bits))
309    }
310    #[doc = r"Get enumerated values variant"]
311    #[inline(always)]
312    pub fn variant(&self) -> TP5_A {
313        match self.bits {
314            false => TP5_A::TP5_0,
315            true => TP5_A::TP5_1,
316        }
317    }
318    #[doc = "Checks if the value of the field is `TP5_0`"]
319    #[inline(always)]
320    pub fn is_tp5_0(&self) -> bool {
321        **self == TP5_A::TP5_0
322    }
323    #[doc = "Checks if the value of the field is `TP5_1`"]
324    #[inline(always)]
325    pub fn is_tp5_1(&self) -> bool {
326        **self == TP5_A::TP5_1
327    }
328}
329impl core::ops::Deref for TP5_R {
330    type Target = crate::FieldReader<bool, TP5_A>;
331    #[inline(always)]
332    fn deref(&self) -> &Self::Target {
333        &self.0
334    }
335}
336#[doc = "Field `TP5` writer - Trusted Protect"]
337pub struct TP5_W<'a> {
338    w: &'a mut W,
339}
340impl<'a> TP5_W<'a> {
341    #[doc = r"Writes `variant` to the field"]
342    #[inline(always)]
343    pub fn variant(self, variant: TP5_A) -> &'a mut W {
344        self.bit(variant.into())
345    }
346    #[doc = "Accesses from an untrusted master are allowed."]
347    #[inline(always)]
348    pub fn tp5_0(self) -> &'a mut W {
349        self.variant(TP5_A::TP5_0)
350    }
351    #[doc = "Accesses from an untrusted master are not allowed."]
352    #[inline(always)]
353    pub fn tp5_1(self) -> &'a mut W {
354        self.variant(TP5_A::TP5_1)
355    }
356    #[doc = r"Sets the field bit"]
357    #[inline(always)]
358    pub fn set_bit(self) -> &'a mut W {
359        self.bit(true)
360    }
361    #[doc = r"Clears the field bit"]
362    #[inline(always)]
363    pub fn clear_bit(self) -> &'a mut W {
364        self.bit(false)
365    }
366    #[doc = r"Writes raw bits to the field"]
367    #[inline(always)]
368    pub fn bit(self, value: bool) -> &'a mut W {
369        self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
370        self.w
371    }
372}
373#[doc = "Write Protect\n\nValue on reset: 0"]
374#[derive(Clone, Copy, Debug, PartialEq)]
375pub enum WP5_A {
376    #[doc = "0: This peripheral allows write accesses."]
377    WP5_0 = 0,
378    #[doc = "1: This peripheral is write protected."]
379    WP5_1 = 1,
380}
381impl From<WP5_A> for bool {
382    #[inline(always)]
383    fn from(variant: WP5_A) -> Self {
384        variant as u8 != 0
385    }
386}
387#[doc = "Field `WP5` reader - Write Protect"]
388pub struct WP5_R(crate::FieldReader<bool, WP5_A>);
389impl WP5_R {
390    #[inline(always)]
391    pub(crate) fn new(bits: bool) -> Self {
392        WP5_R(crate::FieldReader::new(bits))
393    }
394    #[doc = r"Get enumerated values variant"]
395    #[inline(always)]
396    pub fn variant(&self) -> WP5_A {
397        match self.bits {
398            false => WP5_A::WP5_0,
399            true => WP5_A::WP5_1,
400        }
401    }
402    #[doc = "Checks if the value of the field is `WP5_0`"]
403    #[inline(always)]
404    pub fn is_wp5_0(&self) -> bool {
405        **self == WP5_A::WP5_0
406    }
407    #[doc = "Checks if the value of the field is `WP5_1`"]
408    #[inline(always)]
409    pub fn is_wp5_1(&self) -> bool {
410        **self == WP5_A::WP5_1
411    }
412}
413impl core::ops::Deref for WP5_R {
414    type Target = crate::FieldReader<bool, WP5_A>;
415    #[inline(always)]
416    fn deref(&self) -> &Self::Target {
417        &self.0
418    }
419}
420#[doc = "Field `WP5` writer - Write Protect"]
421pub struct WP5_W<'a> {
422    w: &'a mut W,
423}
424impl<'a> WP5_W<'a> {
425    #[doc = r"Writes `variant` to the field"]
426    #[inline(always)]
427    pub fn variant(self, variant: WP5_A) -> &'a mut W {
428        self.bit(variant.into())
429    }
430    #[doc = "This peripheral allows write accesses."]
431    #[inline(always)]
432    pub fn wp5_0(self) -> &'a mut W {
433        self.variant(WP5_A::WP5_0)
434    }
435    #[doc = "This peripheral is write protected."]
436    #[inline(always)]
437    pub fn wp5_1(self) -> &'a mut W {
438        self.variant(WP5_A::WP5_1)
439    }
440    #[doc = r"Sets the field bit"]
441    #[inline(always)]
442    pub fn set_bit(self) -> &'a mut W {
443        self.bit(true)
444    }
445    #[doc = r"Clears the field bit"]
446    #[inline(always)]
447    pub fn clear_bit(self) -> &'a mut W {
448        self.bit(false)
449    }
450    #[doc = r"Writes raw bits to the field"]
451    #[inline(always)]
452    pub fn bit(self, value: bool) -> &'a mut W {
453        self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
454        self.w
455    }
456}
457#[doc = "Supervisor Protect\n\nValue on reset: 1"]
458#[derive(Clone, Copy, Debug, PartialEq)]
459pub enum SP5_A {
460    #[doc = "0: This peripheral does not require supervisor privilege level for accesses."]
461    SP5_0 = 0,
462    #[doc = "1: This peripheral requires supervisor privilege level for accesses."]
463    SP5_1 = 1,
464}
465impl From<SP5_A> for bool {
466    #[inline(always)]
467    fn from(variant: SP5_A) -> Self {
468        variant as u8 != 0
469    }
470}
471#[doc = "Field `SP5` reader - Supervisor Protect"]
472pub struct SP5_R(crate::FieldReader<bool, SP5_A>);
473impl SP5_R {
474    #[inline(always)]
475    pub(crate) fn new(bits: bool) -> Self {
476        SP5_R(crate::FieldReader::new(bits))
477    }
478    #[doc = r"Get enumerated values variant"]
479    #[inline(always)]
480    pub fn variant(&self) -> SP5_A {
481        match self.bits {
482            false => SP5_A::SP5_0,
483            true => SP5_A::SP5_1,
484        }
485    }
486    #[doc = "Checks if the value of the field is `SP5_0`"]
487    #[inline(always)]
488    pub fn is_sp5_0(&self) -> bool {
489        **self == SP5_A::SP5_0
490    }
491    #[doc = "Checks if the value of the field is `SP5_1`"]
492    #[inline(always)]
493    pub fn is_sp5_1(&self) -> bool {
494        **self == SP5_A::SP5_1
495    }
496}
497impl core::ops::Deref for SP5_R {
498    type Target = crate::FieldReader<bool, SP5_A>;
499    #[inline(always)]
500    fn deref(&self) -> &Self::Target {
501        &self.0
502    }
503}
504#[doc = "Field `SP5` writer - Supervisor Protect"]
505pub struct SP5_W<'a> {
506    w: &'a mut W,
507}
508impl<'a> SP5_W<'a> {
509    #[doc = r"Writes `variant` to the field"]
510    #[inline(always)]
511    pub fn variant(self, variant: SP5_A) -> &'a mut W {
512        self.bit(variant.into())
513    }
514    #[doc = "This peripheral does not require supervisor privilege level for accesses."]
515    #[inline(always)]
516    pub fn sp5_0(self) -> &'a mut W {
517        self.variant(SP5_A::SP5_0)
518    }
519    #[doc = "This peripheral requires supervisor privilege level for accesses."]
520    #[inline(always)]
521    pub fn sp5_1(self) -> &'a mut W {
522        self.variant(SP5_A::SP5_1)
523    }
524    #[doc = r"Sets the field bit"]
525    #[inline(always)]
526    pub fn set_bit(self) -> &'a mut W {
527        self.bit(true)
528    }
529    #[doc = r"Clears the field bit"]
530    #[inline(always)]
531    pub fn clear_bit(self) -> &'a mut W {
532        self.bit(false)
533    }
534    #[doc = r"Writes raw bits to the field"]
535    #[inline(always)]
536    pub fn bit(self, value: bool) -> &'a mut W {
537        self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
538        self.w
539    }
540}
541#[doc = "Trusted Protect\n\nValue on reset: 0"]
542#[derive(Clone, Copy, Debug, PartialEq)]
543pub enum TP4_A {
544    #[doc = "0: Accesses from an untrusted master are allowed."]
545    TP4_0 = 0,
546    #[doc = "1: Accesses from an untrusted master are not allowed."]
547    TP4_1 = 1,
548}
549impl From<TP4_A> for bool {
550    #[inline(always)]
551    fn from(variant: TP4_A) -> Self {
552        variant as u8 != 0
553    }
554}
555#[doc = "Field `TP4` reader - Trusted Protect"]
556pub struct TP4_R(crate::FieldReader<bool, TP4_A>);
557impl TP4_R {
558    #[inline(always)]
559    pub(crate) fn new(bits: bool) -> Self {
560        TP4_R(crate::FieldReader::new(bits))
561    }
562    #[doc = r"Get enumerated values variant"]
563    #[inline(always)]
564    pub fn variant(&self) -> TP4_A {
565        match self.bits {
566            false => TP4_A::TP4_0,
567            true => TP4_A::TP4_1,
568        }
569    }
570    #[doc = "Checks if the value of the field is `TP4_0`"]
571    #[inline(always)]
572    pub fn is_tp4_0(&self) -> bool {
573        **self == TP4_A::TP4_0
574    }
575    #[doc = "Checks if the value of the field is `TP4_1`"]
576    #[inline(always)]
577    pub fn is_tp4_1(&self) -> bool {
578        **self == TP4_A::TP4_1
579    }
580}
581impl core::ops::Deref for TP4_R {
582    type Target = crate::FieldReader<bool, TP4_A>;
583    #[inline(always)]
584    fn deref(&self) -> &Self::Target {
585        &self.0
586    }
587}
588#[doc = "Field `TP4` writer - Trusted Protect"]
589pub struct TP4_W<'a> {
590    w: &'a mut W,
591}
592impl<'a> TP4_W<'a> {
593    #[doc = r"Writes `variant` to the field"]
594    #[inline(always)]
595    pub fn variant(self, variant: TP4_A) -> &'a mut W {
596        self.bit(variant.into())
597    }
598    #[doc = "Accesses from an untrusted master are allowed."]
599    #[inline(always)]
600    pub fn tp4_0(self) -> &'a mut W {
601        self.variant(TP4_A::TP4_0)
602    }
603    #[doc = "Accesses from an untrusted master are not allowed."]
604    #[inline(always)]
605    pub fn tp4_1(self) -> &'a mut W {
606        self.variant(TP4_A::TP4_1)
607    }
608    #[doc = r"Sets the field bit"]
609    #[inline(always)]
610    pub fn set_bit(self) -> &'a mut W {
611        self.bit(true)
612    }
613    #[doc = r"Clears the field bit"]
614    #[inline(always)]
615    pub fn clear_bit(self) -> &'a mut W {
616        self.bit(false)
617    }
618    #[doc = r"Writes raw bits to the field"]
619    #[inline(always)]
620    pub fn bit(self, value: bool) -> &'a mut W {
621        self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
622        self.w
623    }
624}
625#[doc = "Write Protect\n\nValue on reset: 0"]
626#[derive(Clone, Copy, Debug, PartialEq)]
627pub enum WP4_A {
628    #[doc = "0: This peripheral allows write accesses."]
629    WP4_0 = 0,
630    #[doc = "1: This peripheral is write protected."]
631    WP4_1 = 1,
632}
633impl From<WP4_A> for bool {
634    #[inline(always)]
635    fn from(variant: WP4_A) -> Self {
636        variant as u8 != 0
637    }
638}
639#[doc = "Field `WP4` reader - Write Protect"]
640pub struct WP4_R(crate::FieldReader<bool, WP4_A>);
641impl WP4_R {
642    #[inline(always)]
643    pub(crate) fn new(bits: bool) -> Self {
644        WP4_R(crate::FieldReader::new(bits))
645    }
646    #[doc = r"Get enumerated values variant"]
647    #[inline(always)]
648    pub fn variant(&self) -> WP4_A {
649        match self.bits {
650            false => WP4_A::WP4_0,
651            true => WP4_A::WP4_1,
652        }
653    }
654    #[doc = "Checks if the value of the field is `WP4_0`"]
655    #[inline(always)]
656    pub fn is_wp4_0(&self) -> bool {
657        **self == WP4_A::WP4_0
658    }
659    #[doc = "Checks if the value of the field is `WP4_1`"]
660    #[inline(always)]
661    pub fn is_wp4_1(&self) -> bool {
662        **self == WP4_A::WP4_1
663    }
664}
665impl core::ops::Deref for WP4_R {
666    type Target = crate::FieldReader<bool, WP4_A>;
667    #[inline(always)]
668    fn deref(&self) -> &Self::Target {
669        &self.0
670    }
671}
672#[doc = "Field `WP4` writer - Write Protect"]
673pub struct WP4_W<'a> {
674    w: &'a mut W,
675}
676impl<'a> WP4_W<'a> {
677    #[doc = r"Writes `variant` to the field"]
678    #[inline(always)]
679    pub fn variant(self, variant: WP4_A) -> &'a mut W {
680        self.bit(variant.into())
681    }
682    #[doc = "This peripheral allows write accesses."]
683    #[inline(always)]
684    pub fn wp4_0(self) -> &'a mut W {
685        self.variant(WP4_A::WP4_0)
686    }
687    #[doc = "This peripheral is write protected."]
688    #[inline(always)]
689    pub fn wp4_1(self) -> &'a mut W {
690        self.variant(WP4_A::WP4_1)
691    }
692    #[doc = r"Sets the field bit"]
693    #[inline(always)]
694    pub fn set_bit(self) -> &'a mut W {
695        self.bit(true)
696    }
697    #[doc = r"Clears the field bit"]
698    #[inline(always)]
699    pub fn clear_bit(self) -> &'a mut W {
700        self.bit(false)
701    }
702    #[doc = r"Writes raw bits to the field"]
703    #[inline(always)]
704    pub fn bit(self, value: bool) -> &'a mut W {
705        self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13);
706        self.w
707    }
708}
709#[doc = "Supervisor Protect\n\nValue on reset: 1"]
710#[derive(Clone, Copy, Debug, PartialEq)]
711pub enum SP4_A {
712    #[doc = "0: This peripheral does not require supervisor privilege level for accesses."]
713    SP4_0 = 0,
714    #[doc = "1: This peripheral requires supervisor privilege level for accesses."]
715    SP4_1 = 1,
716}
717impl From<SP4_A> for bool {
718    #[inline(always)]
719    fn from(variant: SP4_A) -> Self {
720        variant as u8 != 0
721    }
722}
723#[doc = "Field `SP4` reader - Supervisor Protect"]
724pub struct SP4_R(crate::FieldReader<bool, SP4_A>);
725impl SP4_R {
726    #[inline(always)]
727    pub(crate) fn new(bits: bool) -> Self {
728        SP4_R(crate::FieldReader::new(bits))
729    }
730    #[doc = r"Get enumerated values variant"]
731    #[inline(always)]
732    pub fn variant(&self) -> SP4_A {
733        match self.bits {
734            false => SP4_A::SP4_0,
735            true => SP4_A::SP4_1,
736        }
737    }
738    #[doc = "Checks if the value of the field is `SP4_0`"]
739    #[inline(always)]
740    pub fn is_sp4_0(&self) -> bool {
741        **self == SP4_A::SP4_0
742    }
743    #[doc = "Checks if the value of the field is `SP4_1`"]
744    #[inline(always)]
745    pub fn is_sp4_1(&self) -> bool {
746        **self == SP4_A::SP4_1
747    }
748}
749impl core::ops::Deref for SP4_R {
750    type Target = crate::FieldReader<bool, SP4_A>;
751    #[inline(always)]
752    fn deref(&self) -> &Self::Target {
753        &self.0
754    }
755}
756#[doc = "Field `SP4` writer - Supervisor Protect"]
757pub struct SP4_W<'a> {
758    w: &'a mut W,
759}
760impl<'a> SP4_W<'a> {
761    #[doc = r"Writes `variant` to the field"]
762    #[inline(always)]
763    pub fn variant(self, variant: SP4_A) -> &'a mut W {
764        self.bit(variant.into())
765    }
766    #[doc = "This peripheral does not require supervisor privilege level for accesses."]
767    #[inline(always)]
768    pub fn sp4_0(self) -> &'a mut W {
769        self.variant(SP4_A::SP4_0)
770    }
771    #[doc = "This peripheral requires supervisor privilege level for accesses."]
772    #[inline(always)]
773    pub fn sp4_1(self) -> &'a mut W {
774        self.variant(SP4_A::SP4_1)
775    }
776    #[doc = r"Sets the field bit"]
777    #[inline(always)]
778    pub fn set_bit(self) -> &'a mut W {
779        self.bit(true)
780    }
781    #[doc = r"Clears the field bit"]
782    #[inline(always)]
783    pub fn clear_bit(self) -> &'a mut W {
784        self.bit(false)
785    }
786    #[doc = r"Writes raw bits to the field"]
787    #[inline(always)]
788    pub fn bit(self, value: bool) -> &'a mut W {
789        self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14);
790        self.w
791    }
792}
793impl R {
794    #[doc = "Bit 4 - Trusted Protect"]
795    #[inline(always)]
796    pub fn tp6(&self) -> TP6_R {
797        TP6_R::new(((self.bits >> 4) & 0x01) != 0)
798    }
799    #[doc = "Bit 5 - Write Protect"]
800    #[inline(always)]
801    pub fn wp6(&self) -> WP6_R {
802        WP6_R::new(((self.bits >> 5) & 0x01) != 0)
803    }
804    #[doc = "Bit 6 - Supervisor Protect"]
805    #[inline(always)]
806    pub fn sp6(&self) -> SP6_R {
807        SP6_R::new(((self.bits >> 6) & 0x01) != 0)
808    }
809    #[doc = "Bit 8 - Trusted Protect"]
810    #[inline(always)]
811    pub fn tp5(&self) -> TP5_R {
812        TP5_R::new(((self.bits >> 8) & 0x01) != 0)
813    }
814    #[doc = "Bit 9 - Write Protect"]
815    #[inline(always)]
816    pub fn wp5(&self) -> WP5_R {
817        WP5_R::new(((self.bits >> 9) & 0x01) != 0)
818    }
819    #[doc = "Bit 10 - Supervisor Protect"]
820    #[inline(always)]
821    pub fn sp5(&self) -> SP5_R {
822        SP5_R::new(((self.bits >> 10) & 0x01) != 0)
823    }
824    #[doc = "Bit 12 - Trusted Protect"]
825    #[inline(always)]
826    pub fn tp4(&self) -> TP4_R {
827        TP4_R::new(((self.bits >> 12) & 0x01) != 0)
828    }
829    #[doc = "Bit 13 - Write Protect"]
830    #[inline(always)]
831    pub fn wp4(&self) -> WP4_R {
832        WP4_R::new(((self.bits >> 13) & 0x01) != 0)
833    }
834    #[doc = "Bit 14 - Supervisor Protect"]
835    #[inline(always)]
836    pub fn sp4(&self) -> SP4_R {
837        SP4_R::new(((self.bits >> 14) & 0x01) != 0)
838    }
839}
840impl W {
841    #[doc = "Bit 4 - Trusted Protect"]
842    #[inline(always)]
843    pub fn tp6(&mut self) -> TP6_W {
844        TP6_W { w: self }
845    }
846    #[doc = "Bit 5 - Write Protect"]
847    #[inline(always)]
848    pub fn wp6(&mut self) -> WP6_W {
849        WP6_W { w: self }
850    }
851    #[doc = "Bit 6 - Supervisor Protect"]
852    #[inline(always)]
853    pub fn sp6(&mut self) -> SP6_W {
854        SP6_W { w: self }
855    }
856    #[doc = "Bit 8 - Trusted Protect"]
857    #[inline(always)]
858    pub fn tp5(&mut self) -> TP5_W {
859        TP5_W { w: self }
860    }
861    #[doc = "Bit 9 - Write Protect"]
862    #[inline(always)]
863    pub fn wp5(&mut self) -> WP5_W {
864        WP5_W { w: self }
865    }
866    #[doc = "Bit 10 - Supervisor Protect"]
867    #[inline(always)]
868    pub fn sp5(&mut self) -> SP5_W {
869        SP5_W { w: self }
870    }
871    #[doc = "Bit 12 - Trusted Protect"]
872    #[inline(always)]
873    pub fn tp4(&mut self) -> TP4_W {
874        TP4_W { w: self }
875    }
876    #[doc = "Bit 13 - Write Protect"]
877    #[inline(always)]
878    pub fn wp4(&mut self) -> WP4_W {
879        WP4_W { w: self }
880    }
881    #[doc = "Bit 14 - Supervisor Protect"]
882    #[inline(always)]
883    pub fn sp4(&mut self) -> SP4_W {
884        SP4_W { w: self }
885    }
886    #[doc = "Writes raw bits to the register."]
887    #[inline(always)]
888    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
889        self.0.bits(bits);
890        self
891    }
892}
893#[doc = "Off-Platform Peripheral Access 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 [opacrb](index.html) module"]
894pub struct OPACRB_SPEC;
895impl crate::RegisterSpec for OPACRB_SPEC {
896    type Ux = u32;
897}
898#[doc = "`read()` method returns [opacrb::R](R) reader structure"]
899impl crate::Readable for OPACRB_SPEC {
900    type Reader = R;
901}
902#[doc = "`write(|w| ..)` method takes [opacrb::W](W) writer structure"]
903impl crate::Writable for OPACRB_SPEC {
904    type Writer = W;
905}
906#[doc = "`reset()` method sets OPACRB to value 0x4440"]
907impl crate::Resettable for OPACRB_SPEC {
908    #[inline(always)]
909    fn reset_value() -> Self::Ux {
910        0x4440
911    }
912}