muscab1_pac/system_control/
scsecctrl.rs

1#[doc = "Register `SCSECCTRL` reader"]
2pub type R = crate::R<ScsecctrlSpec>;
3#[doc = "Register `SCSECCTRL` writer"]
4pub type W = crate::W<ScsecctrlSpec>;
5#[doc = "Control to disable certification path\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum Certdisable {
8    #[doc = "1: control to disable certification path"]
9    Disable = 1,
10    #[doc = "0: control to enable certification path"]
11    Enable = 0,
12}
13impl From<Certdisable> for bool {
14    #[inline(always)]
15    fn from(variant: Certdisable) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `CERTDISABLE` reader - Control to disable certification path"]
20pub type CertdisableR = crate::BitReader<Certdisable>;
21impl CertdisableR {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> Certdisable {
25        match self.bits {
26            true => Certdisable::Disable,
27            false => Certdisable::Enable,
28        }
29    }
30    #[doc = "control to disable certification path"]
31    #[inline(always)]
32    pub fn is_disable(&self) -> bool {
33        *self == Certdisable::Disable
34    }
35    #[doc = "control to enable certification path"]
36    #[inline(always)]
37    pub fn is_enable(&self) -> bool {
38        *self == Certdisable::Enable
39    }
40}
41#[doc = "Field `CERTDISABLE` writer - Control to disable certification path"]
42pub type CertdisableW<'a, REG> = crate::BitWriter<'a, REG, Certdisable>;
43impl<'a, REG> CertdisableW<'a, REG>
44where
45    REG: crate::Writable + crate::RegisterSpec,
46{
47    #[doc = "control to disable certification path"]
48    #[inline(always)]
49    pub fn disable(self) -> &'a mut crate::W<REG> {
50        self.variant(Certdisable::Disable)
51    }
52    #[doc = "control to enable certification path"]
53    #[inline(always)]
54    pub fn enable(self) -> &'a mut crate::W<REG> {
55        self.variant(Certdisable::Enable)
56    }
57}
58#[doc = "Control to enable read access on the certification path as long as CERTDISABLE is also LOW\n\nValue on reset: 0"]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60pub enum Certreaden {
61    #[doc = "1: control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
62    Enable = 1,
63    #[doc = "0: control to disable read access on the certification path as long as CERTDISABLE is also LOW"]
64    Disable = 0,
65}
66impl From<Certreaden> for bool {
67    #[inline(always)]
68    fn from(variant: Certreaden) -> Self {
69        variant as u8 != 0
70    }
71}
72#[doc = "Field `CERTREADEN` reader - Control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
73pub type CertreadenR = crate::BitReader<Certreaden>;
74impl CertreadenR {
75    #[doc = "Get enumerated values variant"]
76    #[inline(always)]
77    pub const fn variant(&self) -> Certreaden {
78        match self.bits {
79            true => Certreaden::Enable,
80            false => Certreaden::Disable,
81        }
82    }
83    #[doc = "control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
84    #[inline(always)]
85    pub fn is_enable(&self) -> bool {
86        *self == Certreaden::Enable
87    }
88    #[doc = "control to disable read access on the certification path as long as CERTDISABLE is also LOW"]
89    #[inline(always)]
90    pub fn is_disable(&self) -> bool {
91        *self == Certreaden::Disable
92    }
93}
94#[doc = "Field `CERTREADEN` writer - Control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
95pub type CertreadenW<'a, REG> = crate::BitWriter<'a, REG, Certreaden>;
96impl<'a, REG> CertreadenW<'a, REG>
97where
98    REG: crate::Writable + crate::RegisterSpec,
99{
100    #[doc = "control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
101    #[inline(always)]
102    pub fn enable(self) -> &'a mut crate::W<REG> {
103        self.variant(Certreaden::Enable)
104    }
105    #[doc = "control to disable read access on the certification path as long as CERTDISABLE is also LOW"]
106    #[inline(always)]
107    pub fn disable(self) -> &'a mut crate::W<REG> {
108        self.variant(Certreaden::Disable)
109    }
110}
111#[doc = "Control to disable writes to security-related control registers in this register block\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum Scseccfglock {
114    #[doc = "1: control to disable writes to security-related control registers in this register block"]
115    Disable = 1,
116    #[doc = "0: control to enable writes to security-related control registers in this register block"]
117    Enable = 0,
118}
119impl From<Scseccfglock> for bool {
120    #[inline(always)]
121    fn from(variant: Scseccfglock) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `SCSECCFGLOCK` reader - Control to disable writes to security-related control registers in this register block"]
126pub type ScseccfglockR = crate::BitReader<Scseccfglock>;
127impl ScseccfglockR {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> Scseccfglock {
131        match self.bits {
132            true => Scseccfglock::Disable,
133            false => Scseccfglock::Enable,
134        }
135    }
136    #[doc = "control to disable writes to security-related control registers in this register block"]
137    #[inline(always)]
138    pub fn is_disable(&self) -> bool {
139        *self == Scseccfglock::Disable
140    }
141    #[doc = "control to enable writes to security-related control registers in this register block"]
142    #[inline(always)]
143    pub fn is_enable(&self) -> bool {
144        *self == Scseccfglock::Enable
145    }
146}
147#[doc = "Field `SCSECCFGLOCK` writer - Control to disable writes to security-related control registers in this register block"]
148pub type ScseccfglockW<'a, REG> = crate::BitWriter<'a, REG, Scseccfglock>;
149impl<'a, REG> ScseccfglockW<'a, REG>
150where
151    REG: crate::Writable + crate::RegisterSpec,
152{
153    #[doc = "control to disable writes to security-related control registers in this register block"]
154    #[inline(always)]
155    pub fn disable(self) -> &'a mut crate::W<REG> {
156        self.variant(Scseccfglock::Disable)
157    }
158    #[doc = "control to enable writes to security-related control registers in this register block"]
159    #[inline(always)]
160    pub fn enable(self) -> &'a mut crate::W<REG> {
161        self.variant(Scseccfglock::Enable)
162    }
163}
164#[doc = "Indicates that the Certification write path has been disabled\n\nValue on reset: 0"]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum Certdisabled {
167    #[doc = "1: Certification write path has been disabled"]
168    Disabled = 1,
169    #[doc = "0: Certification write path has been enabled"]
170    Enabled = 0,
171}
172impl From<Certdisabled> for bool {
173    #[inline(always)]
174    fn from(variant: Certdisabled) -> Self {
175        variant as u8 != 0
176    }
177}
178#[doc = "Field `CERTDISABLED` reader - Indicates that the Certification write path has been disabled"]
179pub type CertdisabledR = crate::BitReader<Certdisabled>;
180impl CertdisabledR {
181    #[doc = "Get enumerated values variant"]
182    #[inline(always)]
183    pub const fn variant(&self) -> Certdisabled {
184        match self.bits {
185            true => Certdisabled::Disabled,
186            false => Certdisabled::Enabled,
187        }
188    }
189    #[doc = "Certification write path has been disabled"]
190    #[inline(always)]
191    pub fn is_disabled(&self) -> bool {
192        *self == Certdisabled::Disabled
193    }
194    #[doc = "Certification write path has been enabled"]
195    #[inline(always)]
196    pub fn is_enabled(&self) -> bool {
197        *self == Certdisabled::Enabled
198    }
199}
200#[doc = "Field `CERTDISABLED` writer - Indicates that the Certification write path has been disabled"]
201pub type CertdisabledW<'a, REG> = crate::BitWriter<'a, REG, Certdisabled>;
202impl<'a, REG> CertdisabledW<'a, REG>
203where
204    REG: crate::Writable + crate::RegisterSpec,
205{
206    #[doc = "Certification write path has been disabled"]
207    #[inline(always)]
208    pub fn disabled(self) -> &'a mut crate::W<REG> {
209        self.variant(Certdisabled::Disabled)
210    }
211    #[doc = "Certification write path has been enabled"]
212    #[inline(always)]
213    pub fn enabled(self) -> &'a mut crate::W<REG> {
214        self.variant(Certdisabled::Enabled)
215    }
216}
217#[doc = "Indicates whether the certification read access is enabled\n\nValue on reset: 0"]
218#[derive(Clone, Copy, Debug, PartialEq, Eq)]
219pub enum Certreadenabled {
220    #[doc = "1: certification read access is enabled"]
221    Enabled = 1,
222    #[doc = "0: certification read access is disabled"]
223    Disabled = 0,
224}
225impl From<Certreadenabled> for bool {
226    #[inline(always)]
227    fn from(variant: Certreadenabled) -> Self {
228        variant as u8 != 0
229    }
230}
231#[doc = "Field `CERTREADENABLED` reader - Indicates whether the certification read access is enabled"]
232pub type CertreadenabledR = crate::BitReader<Certreadenabled>;
233impl CertreadenabledR {
234    #[doc = "Get enumerated values variant"]
235    #[inline(always)]
236    pub const fn variant(&self) -> Certreadenabled {
237        match self.bits {
238            true => Certreadenabled::Enabled,
239            false => Certreadenabled::Disabled,
240        }
241    }
242    #[doc = "certification read access is enabled"]
243    #[inline(always)]
244    pub fn is_enabled(&self) -> bool {
245        *self == Certreadenabled::Enabled
246    }
247    #[doc = "certification read access is disabled"]
248    #[inline(always)]
249    pub fn is_disabled(&self) -> bool {
250        *self == Certreadenabled::Disabled
251    }
252}
253#[doc = "Field `CERTREADENABLED` writer - Indicates whether the certification read access is enabled"]
254pub type CertreadenabledW<'a, REG> = crate::BitWriter<'a, REG, Certreadenabled>;
255impl<'a, REG> CertreadenabledW<'a, REG>
256where
257    REG: crate::Writable + crate::RegisterSpec,
258{
259    #[doc = "certification read access is enabled"]
260    #[inline(always)]
261    pub fn enabled(self) -> &'a mut crate::W<REG> {
262        self.variant(Certreadenabled::Enabled)
263    }
264    #[doc = "certification read access is disabled"]
265    #[inline(always)]
266    pub fn disabled(self) -> &'a mut crate::W<REG> {
267        self.variant(Certreadenabled::Disabled)
268    }
269}
270impl R {
271    #[doc = "Bit 0 - Control to disable certification path"]
272    #[inline(always)]
273    pub fn certdisable(&self) -> CertdisableR {
274        CertdisableR::new((self.bits & 1) != 0)
275    }
276    #[doc = "Bit 1 - Control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
277    #[inline(always)]
278    pub fn certreaden(&self) -> CertreadenR {
279        CertreadenR::new(((self.bits >> 1) & 1) != 0)
280    }
281    #[doc = "Bit 2 - Control to disable writes to security-related control registers in this register block"]
282    #[inline(always)]
283    pub fn scseccfglock(&self) -> ScseccfglockR {
284        ScseccfglockR::new(((self.bits >> 2) & 1) != 0)
285    }
286    #[doc = "Bit 16 - Indicates that the Certification write path has been disabled"]
287    #[inline(always)]
288    pub fn certdisabled(&self) -> CertdisabledR {
289        CertdisabledR::new(((self.bits >> 16) & 1) != 0)
290    }
291    #[doc = "Bit 17 - Indicates whether the certification read access is enabled"]
292    #[inline(always)]
293    pub fn certreadenabled(&self) -> CertreadenabledR {
294        CertreadenabledR::new(((self.bits >> 17) & 1) != 0)
295    }
296}
297impl W {
298    #[doc = "Bit 0 - Control to disable certification path"]
299    #[inline(always)]
300    pub fn certdisable(&mut self) -> CertdisableW<ScsecctrlSpec> {
301        CertdisableW::new(self, 0)
302    }
303    #[doc = "Bit 1 - Control to enable read access on the certification path as long as CERTDISABLE is also LOW"]
304    #[inline(always)]
305    pub fn certreaden(&mut self) -> CertreadenW<ScsecctrlSpec> {
306        CertreadenW::new(self, 1)
307    }
308    #[doc = "Bit 2 - Control to disable writes to security-related control registers in this register block"]
309    #[inline(always)]
310    pub fn scseccfglock(&mut self) -> ScseccfglockW<ScsecctrlSpec> {
311        ScseccfglockW::new(self, 2)
312    }
313    #[doc = "Bit 16 - Indicates that the Certification write path has been disabled"]
314    #[inline(always)]
315    pub fn certdisabled(&mut self) -> CertdisabledW<ScsecctrlSpec> {
316        CertdisabledW::new(self, 16)
317    }
318    #[doc = "Bit 17 - Indicates whether the certification read access is enabled"]
319    #[inline(always)]
320    pub fn certreadenabled(&mut self) -> CertreadenabledW<ScsecctrlSpec> {
321        CertreadenabledW::new(self, 17)
322    }
323}
324#[doc = "System Security Control\n\nYou can [`read`](crate::Reg::read) this register and get [`scsecctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`scsecctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
325pub struct ScsecctrlSpec;
326impl crate::RegisterSpec for ScsecctrlSpec {
327    type Ux = u32;
328}
329#[doc = "`read()` method returns [`scsecctrl::R`](R) reader structure"]
330impl crate::Readable for ScsecctrlSpec {}
331#[doc = "`write(|w| ..)` method takes [`scsecctrl::W`](W) writer structure"]
332impl crate::Writable for ScsecctrlSpec {
333    type Safety = crate::Unsafe;
334    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
335    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
336}
337#[doc = "`reset()` method sets SCSECCTRL to value 0"]
338impl crate::Resettable for ScsecctrlSpec {
339    const RESET_VALUE: u32 = 0;
340}