lpc55_pac/puf/
allow.rs

1#[doc = "Register `ALLOW` reader"]
2pub struct R(crate::R<ALLOW_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ALLOW_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ALLOW_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ALLOW_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `ALLOW` writer"]
17pub struct W(crate::W<ALLOW_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<ALLOW_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<ALLOW_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<ALLOW_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `ALLOWENROLL` reader - Enroll operation is allowed"]
38pub struct ALLOWENROLL_R(crate::FieldReader<bool, bool>);
39impl ALLOWENROLL_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: bool) -> Self {
42        ALLOWENROLL_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for ALLOWENROLL_R {
46    type Target = crate::FieldReader<bool, bool>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `ALLOWSTART` reader - Start operation is allowed"]
53pub struct ALLOWSTART_R(crate::FieldReader<bool, bool>);
54impl ALLOWSTART_R {
55    #[inline(always)]
56    pub(crate) fn new(bits: bool) -> Self {
57        ALLOWSTART_R(crate::FieldReader::new(bits))
58    }
59}
60impl core::ops::Deref for ALLOWSTART_R {
61    type Target = crate::FieldReader<bool, bool>;
62    #[inline(always)]
63    fn deref(&self) -> &Self::Target {
64        &self.0
65    }
66}
67#[doc = "Field `ALLOWSETKEY` reader - Set Key operations are allowed"]
68pub struct ALLOWSETKEY_R(crate::FieldReader<bool, bool>);
69impl ALLOWSETKEY_R {
70    #[inline(always)]
71    pub(crate) fn new(bits: bool) -> Self {
72        ALLOWSETKEY_R(crate::FieldReader::new(bits))
73    }
74}
75impl core::ops::Deref for ALLOWSETKEY_R {
76    type Target = crate::FieldReader<bool, bool>;
77    #[inline(always)]
78    fn deref(&self) -> &Self::Target {
79        &self.0
80    }
81}
82#[doc = "Field `ALLOWGETKEY` reader - Get Key operation is allowed"]
83pub struct ALLOWGETKEY_R(crate::FieldReader<bool, bool>);
84impl ALLOWGETKEY_R {
85    #[inline(always)]
86    pub(crate) fn new(bits: bool) -> Self {
87        ALLOWGETKEY_R(crate::FieldReader::new(bits))
88    }
89}
90impl core::ops::Deref for ALLOWGETKEY_R {
91    type Target = crate::FieldReader<bool, bool>;
92    #[inline(always)]
93    fn deref(&self) -> &Self::Target {
94        &self.0
95    }
96}
97impl R {
98    #[doc = "Bit 0 - Enroll operation is allowed"]
99    #[inline(always)]
100    pub fn allowenroll(&self) -> ALLOWENROLL_R {
101        ALLOWENROLL_R::new((self.bits & 0x01) != 0)
102    }
103    #[doc = "Bit 1 - Start operation is allowed"]
104    #[inline(always)]
105    pub fn allowstart(&self) -> ALLOWSTART_R {
106        ALLOWSTART_R::new(((self.bits >> 1) & 0x01) != 0)
107    }
108    #[doc = "Bit 2 - Set Key operations are allowed"]
109    #[inline(always)]
110    pub fn allowsetkey(&self) -> ALLOWSETKEY_R {
111        ALLOWSETKEY_R::new(((self.bits >> 2) & 0x01) != 0)
112    }
113    #[doc = "Bit 3 - Get Key operation is allowed"]
114    #[inline(always)]
115    pub fn allowgetkey(&self) -> ALLOWGETKEY_R {
116        ALLOWGETKEY_R::new(((self.bits >> 3) & 0x01) != 0)
117    }
118}
119impl W {
120    #[doc = "Writes raw bits to the register."]
121    #[inline(always)]
122    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
123        self.0.bits(bits);
124        self
125    }
126}
127#[doc = "PUF Allow 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 [allow](index.html) module"]
128pub struct ALLOW_SPEC;
129impl crate::RegisterSpec for ALLOW_SPEC {
130    type Ux = u32;
131}
132#[doc = "`read()` method returns [allow::R](R) reader structure"]
133impl crate::Readable for ALLOW_SPEC {
134    type Reader = R;
135}
136#[doc = "`write(|w| ..)` method takes [allow::W](W) writer structure"]
137impl crate::Writable for ALLOW_SPEC {
138    type Writer = W;
139}
140#[doc = "`reset()` method sets ALLOW to value 0"]
141impl crate::Resettable for ALLOW_SPEC {
142    #[inline(always)]
143    fn reset_value() -> Self::Ux {
144        0
145    }
146}