xmc4700/flash0/
procon2.rs

1#[doc = "Register `PROCON2` reader"]
2pub type R = crate::R<PROCON2_SPEC>;
3#[doc = "Sector 0 Locked Forever by User 2\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum S0ROM_A {
6    #[doc = "0: No ROM functionality configured for sector n."]
7    VALUE1 = 0,
8    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
9    VALUE2 = 1,
10}
11impl From<S0ROM_A> for bool {
12    #[inline(always)]
13    fn from(variant: S0ROM_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `S0ROM` reader - Sector 0 Locked Forever by User 2"]
18pub type S0ROM_R = crate::BitReader<S0ROM_A>;
19impl S0ROM_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> S0ROM_A {
23        match self.bits {
24            false => S0ROM_A::VALUE1,
25            true => S0ROM_A::VALUE2,
26        }
27    }
28    #[doc = "No ROM functionality configured for sector n."]
29    #[inline(always)]
30    pub fn is_value1(&self) -> bool {
31        *self == S0ROM_A::VALUE1
32    }
33    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
34    #[inline(always)]
35    pub fn is_value2(&self) -> bool {
36        *self == S0ROM_A::VALUE2
37    }
38}
39#[doc = "Sector 1 Locked Forever by User 2\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum S1ROM_A {
42    #[doc = "0: No ROM functionality configured for sector n."]
43    VALUE1 = 0,
44    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
45    VALUE2 = 1,
46}
47impl From<S1ROM_A> for bool {
48    #[inline(always)]
49    fn from(variant: S1ROM_A) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `S1ROM` reader - Sector 1 Locked Forever by User 2"]
54pub type S1ROM_R = crate::BitReader<S1ROM_A>;
55impl S1ROM_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> S1ROM_A {
59        match self.bits {
60            false => S1ROM_A::VALUE1,
61            true => S1ROM_A::VALUE2,
62        }
63    }
64    #[doc = "No ROM functionality configured for sector n."]
65    #[inline(always)]
66    pub fn is_value1(&self) -> bool {
67        *self == S1ROM_A::VALUE1
68    }
69    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
70    #[inline(always)]
71    pub fn is_value2(&self) -> bool {
72        *self == S1ROM_A::VALUE2
73    }
74}
75#[doc = "Sector 2 Locked Forever by User 2\n\nValue on reset: 0"]
76#[derive(Clone, Copy, Debug, PartialEq, Eq)]
77pub enum S2ROM_A {
78    #[doc = "0: No ROM functionality configured for sector n."]
79    VALUE1 = 0,
80    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
81    VALUE2 = 1,
82}
83impl From<S2ROM_A> for bool {
84    #[inline(always)]
85    fn from(variant: S2ROM_A) -> Self {
86        variant as u8 != 0
87    }
88}
89#[doc = "Field `S2ROM` reader - Sector 2 Locked Forever by User 2"]
90pub type S2ROM_R = crate::BitReader<S2ROM_A>;
91impl S2ROM_R {
92    #[doc = "Get enumerated values variant"]
93    #[inline(always)]
94    pub const fn variant(&self) -> S2ROM_A {
95        match self.bits {
96            false => S2ROM_A::VALUE1,
97            true => S2ROM_A::VALUE2,
98        }
99    }
100    #[doc = "No ROM functionality configured for sector n."]
101    #[inline(always)]
102    pub fn is_value1(&self) -> bool {
103        *self == S2ROM_A::VALUE1
104    }
105    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
106    #[inline(always)]
107    pub fn is_value2(&self) -> bool {
108        *self == S2ROM_A::VALUE2
109    }
110}
111#[doc = "Sector 3 Locked Forever by User 2\n\nValue on reset: 0"]
112#[derive(Clone, Copy, Debug, PartialEq, Eq)]
113pub enum S3ROM_A {
114    #[doc = "0: No ROM functionality configured for sector n."]
115    VALUE1 = 0,
116    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
117    VALUE2 = 1,
118}
119impl From<S3ROM_A> for bool {
120    #[inline(always)]
121    fn from(variant: S3ROM_A) -> Self {
122        variant as u8 != 0
123    }
124}
125#[doc = "Field `S3ROM` reader - Sector 3 Locked Forever by User 2"]
126pub type S3ROM_R = crate::BitReader<S3ROM_A>;
127impl S3ROM_R {
128    #[doc = "Get enumerated values variant"]
129    #[inline(always)]
130    pub const fn variant(&self) -> S3ROM_A {
131        match self.bits {
132            false => S3ROM_A::VALUE1,
133            true => S3ROM_A::VALUE2,
134        }
135    }
136    #[doc = "No ROM functionality configured for sector n."]
137    #[inline(always)]
138    pub fn is_value1(&self) -> bool {
139        *self == S3ROM_A::VALUE1
140    }
141    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
142    #[inline(always)]
143    pub fn is_value2(&self) -> bool {
144        *self == S3ROM_A::VALUE2
145    }
146}
147#[doc = "Sector 4 Locked Forever by User 2\n\nValue on reset: 0"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149pub enum S4ROM_A {
150    #[doc = "0: No ROM functionality configured for sector n."]
151    VALUE1 = 0,
152    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
153    VALUE2 = 1,
154}
155impl From<S4ROM_A> for bool {
156    #[inline(always)]
157    fn from(variant: S4ROM_A) -> Self {
158        variant as u8 != 0
159    }
160}
161#[doc = "Field `S4ROM` reader - Sector 4 Locked Forever by User 2"]
162pub type S4ROM_R = crate::BitReader<S4ROM_A>;
163impl S4ROM_R {
164    #[doc = "Get enumerated values variant"]
165    #[inline(always)]
166    pub const fn variant(&self) -> S4ROM_A {
167        match self.bits {
168            false => S4ROM_A::VALUE1,
169            true => S4ROM_A::VALUE2,
170        }
171    }
172    #[doc = "No ROM functionality configured for sector n."]
173    #[inline(always)]
174    pub fn is_value1(&self) -> bool {
175        *self == S4ROM_A::VALUE1
176    }
177    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
178    #[inline(always)]
179    pub fn is_value2(&self) -> bool {
180        *self == S4ROM_A::VALUE2
181    }
182}
183#[doc = "Sector 5 Locked Forever by User 2\n\nValue on reset: 0"]
184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
185pub enum S5ROM_A {
186    #[doc = "0: No ROM functionality configured for sector n."]
187    VALUE1 = 0,
188    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
189    VALUE2 = 1,
190}
191impl From<S5ROM_A> for bool {
192    #[inline(always)]
193    fn from(variant: S5ROM_A) -> Self {
194        variant as u8 != 0
195    }
196}
197#[doc = "Field `S5ROM` reader - Sector 5 Locked Forever by User 2"]
198pub type S5ROM_R = crate::BitReader<S5ROM_A>;
199impl S5ROM_R {
200    #[doc = "Get enumerated values variant"]
201    #[inline(always)]
202    pub const fn variant(&self) -> S5ROM_A {
203        match self.bits {
204            false => S5ROM_A::VALUE1,
205            true => S5ROM_A::VALUE2,
206        }
207    }
208    #[doc = "No ROM functionality configured for sector n."]
209    #[inline(always)]
210    pub fn is_value1(&self) -> bool {
211        *self == S5ROM_A::VALUE1
212    }
213    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
214    #[inline(always)]
215    pub fn is_value2(&self) -> bool {
216        *self == S5ROM_A::VALUE2
217    }
218}
219#[doc = "Sector 6 Locked Forever by User 2\n\nValue on reset: 0"]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum S6ROM_A {
222    #[doc = "0: No ROM functionality configured for sector n."]
223    VALUE1 = 0,
224    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
225    VALUE2 = 1,
226}
227impl From<S6ROM_A> for bool {
228    #[inline(always)]
229    fn from(variant: S6ROM_A) -> Self {
230        variant as u8 != 0
231    }
232}
233#[doc = "Field `S6ROM` reader - Sector 6 Locked Forever by User 2"]
234pub type S6ROM_R = crate::BitReader<S6ROM_A>;
235impl S6ROM_R {
236    #[doc = "Get enumerated values variant"]
237    #[inline(always)]
238    pub const fn variant(&self) -> S6ROM_A {
239        match self.bits {
240            false => S6ROM_A::VALUE1,
241            true => S6ROM_A::VALUE2,
242        }
243    }
244    #[doc = "No ROM functionality configured for sector n."]
245    #[inline(always)]
246    pub fn is_value1(&self) -> bool {
247        *self == S6ROM_A::VALUE1
248    }
249    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
250    #[inline(always)]
251    pub fn is_value2(&self) -> bool {
252        *self == S6ROM_A::VALUE2
253    }
254}
255#[doc = "Sector 7 Locked Forever by User 2\n\nValue on reset: 0"]
256#[derive(Clone, Copy, Debug, PartialEq, Eq)]
257pub enum S7ROM_A {
258    #[doc = "0: No ROM functionality configured for sector n."]
259    VALUE1 = 0,
260    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
261    VALUE2 = 1,
262}
263impl From<S7ROM_A> for bool {
264    #[inline(always)]
265    fn from(variant: S7ROM_A) -> Self {
266        variant as u8 != 0
267    }
268}
269#[doc = "Field `S7ROM` reader - Sector 7 Locked Forever by User 2"]
270pub type S7ROM_R = crate::BitReader<S7ROM_A>;
271impl S7ROM_R {
272    #[doc = "Get enumerated values variant"]
273    #[inline(always)]
274    pub const fn variant(&self) -> S7ROM_A {
275        match self.bits {
276            false => S7ROM_A::VALUE1,
277            true => S7ROM_A::VALUE2,
278        }
279    }
280    #[doc = "No ROM functionality configured for sector n."]
281    #[inline(always)]
282    pub fn is_value1(&self) -> bool {
283        *self == S7ROM_A::VALUE1
284    }
285    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
286    #[inline(always)]
287    pub fn is_value2(&self) -> bool {
288        *self == S7ROM_A::VALUE2
289    }
290}
291#[doc = "Sector 8 Locked Forever by User 2\n\nValue on reset: 0"]
292#[derive(Clone, Copy, Debug, PartialEq, Eq)]
293pub enum S8ROM_A {
294    #[doc = "0: No ROM functionality configured for sector n."]
295    VALUE1 = 0,
296    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
297    VALUE2 = 1,
298}
299impl From<S8ROM_A> for bool {
300    #[inline(always)]
301    fn from(variant: S8ROM_A) -> Self {
302        variant as u8 != 0
303    }
304}
305#[doc = "Field `S8ROM` reader - Sector 8 Locked Forever by User 2"]
306pub type S8ROM_R = crate::BitReader<S8ROM_A>;
307impl S8ROM_R {
308    #[doc = "Get enumerated values variant"]
309    #[inline(always)]
310    pub const fn variant(&self) -> S8ROM_A {
311        match self.bits {
312            false => S8ROM_A::VALUE1,
313            true => S8ROM_A::VALUE2,
314        }
315    }
316    #[doc = "No ROM functionality configured for sector n."]
317    #[inline(always)]
318    pub fn is_value1(&self) -> bool {
319        *self == S8ROM_A::VALUE1
320    }
321    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
322    #[inline(always)]
323    pub fn is_value2(&self) -> bool {
324        *self == S8ROM_A::VALUE2
325    }
326}
327#[doc = "Sector 9 Locked Forever by User 2\n\nValue on reset: 0"]
328#[derive(Clone, Copy, Debug, PartialEq, Eq)]
329pub enum S9ROM_A {
330    #[doc = "0: No ROM functionality configured for sector n."]
331    VALUE1 = 0,
332    #[doc = "1: ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
333    VALUE2 = 1,
334}
335impl From<S9ROM_A> for bool {
336    #[inline(always)]
337    fn from(variant: S9ROM_A) -> Self {
338        variant as u8 != 0
339    }
340}
341#[doc = "Field `S9ROM` reader - Sector 9 Locked Forever by User 2"]
342pub type S9ROM_R = crate::BitReader<S9ROM_A>;
343impl S9ROM_R {
344    #[doc = "Get enumerated values variant"]
345    #[inline(always)]
346    pub const fn variant(&self) -> S9ROM_A {
347        match self.bits {
348            false => S9ROM_A::VALUE1,
349            true => S9ROM_A::VALUE2,
350        }
351    }
352    #[doc = "No ROM functionality configured for sector n."]
353    #[inline(always)]
354    pub fn is_value1(&self) -> bool {
355        *self == S9ROM_A::VALUE1
356    }
357    #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."]
358    #[inline(always)]
359    pub fn is_value2(&self) -> bool {
360        *self == S9ROM_A::VALUE2
361    }
362}
363#[doc = "Sectors 10 and 11 Locked Forever by User 2\n\nValue on reset: 0"]
364#[derive(Clone, Copy, Debug, PartialEq, Eq)]
365pub enum S10_S11ROM_A {
366    #[doc = "0: No ROM functionality is configured for sectors 10+11."]
367    VALUE1 = 0,
368    #[doc = "1: ROM functionality is configured for sectors 10+11."]
369    VALUE2 = 1,
370}
371impl From<S10_S11ROM_A> for bool {
372    #[inline(always)]
373    fn from(variant: S10_S11ROM_A) -> Self {
374        variant as u8 != 0
375    }
376}
377#[doc = "Field `S10_S11ROM` reader - Sectors 10 and 11 Locked Forever by User 2"]
378pub type S10_S11ROM_R = crate::BitReader<S10_S11ROM_A>;
379impl S10_S11ROM_R {
380    #[doc = "Get enumerated values variant"]
381    #[inline(always)]
382    pub const fn variant(&self) -> S10_S11ROM_A {
383        match self.bits {
384            false => S10_S11ROM_A::VALUE1,
385            true => S10_S11ROM_A::VALUE2,
386        }
387    }
388    #[doc = "No ROM functionality is configured for sectors 10+11."]
389    #[inline(always)]
390    pub fn is_value1(&self) -> bool {
391        *self == S10_S11ROM_A::VALUE1
392    }
393    #[doc = "ROM functionality is configured for sectors 10+11."]
394    #[inline(always)]
395    pub fn is_value2(&self) -> bool {
396        *self == S10_S11ROM_A::VALUE2
397    }
398}
399#[doc = "Sectors 12 and 13 Locked Forever by User 2\n\nValue on reset: 0"]
400#[derive(Clone, Copy, Debug, PartialEq, Eq)]
401pub enum S12_S13ROM_A {
402    #[doc = "0: No ROM functionality is configured for sectors 12+13."]
403    VALUE1 = 0,
404    #[doc = "1: ROM functionality is configured for sectors 12+13."]
405    VALUE2 = 1,
406}
407impl From<S12_S13ROM_A> for bool {
408    #[inline(always)]
409    fn from(variant: S12_S13ROM_A) -> Self {
410        variant as u8 != 0
411    }
412}
413#[doc = "Field `S12_S13ROM` reader - Sectors 12 and 13 Locked Forever by User 2"]
414pub type S12_S13ROM_R = crate::BitReader<S12_S13ROM_A>;
415impl S12_S13ROM_R {
416    #[doc = "Get enumerated values variant"]
417    #[inline(always)]
418    pub const fn variant(&self) -> S12_S13ROM_A {
419        match self.bits {
420            false => S12_S13ROM_A::VALUE1,
421            true => S12_S13ROM_A::VALUE2,
422        }
423    }
424    #[doc = "No ROM functionality is configured for sectors 12+13."]
425    #[inline(always)]
426    pub fn is_value1(&self) -> bool {
427        *self == S12_S13ROM_A::VALUE1
428    }
429    #[doc = "ROM functionality is configured for sectors 12+13."]
430    #[inline(always)]
431    pub fn is_value2(&self) -> bool {
432        *self == S12_S13ROM_A::VALUE2
433    }
434}
435#[doc = "Sectors 14 and 15 Locked Forever by User 2\n\nValue on reset: 0"]
436#[derive(Clone, Copy, Debug, PartialEq, Eq)]
437pub enum S14_S15ROM_A {
438    #[doc = "0: No ROM functionality is configured for sectors 14+15."]
439    VALUE1 = 0,
440    #[doc = "1: ROM functionality is configured for sectors 14+15."]
441    VALUE2 = 1,
442}
443impl From<S14_S15ROM_A> for bool {
444    #[inline(always)]
445    fn from(variant: S14_S15ROM_A) -> Self {
446        variant as u8 != 0
447    }
448}
449#[doc = "Field `S14_S15ROM` reader - Sectors 14 and 15 Locked Forever by User 2"]
450pub type S14_S15ROM_R = crate::BitReader<S14_S15ROM_A>;
451impl S14_S15ROM_R {
452    #[doc = "Get enumerated values variant"]
453    #[inline(always)]
454    pub const fn variant(&self) -> S14_S15ROM_A {
455        match self.bits {
456            false => S14_S15ROM_A::VALUE1,
457            true => S14_S15ROM_A::VALUE2,
458        }
459    }
460    #[doc = "No ROM functionality is configured for sectors 14+15."]
461    #[inline(always)]
462    pub fn is_value1(&self) -> bool {
463        *self == S14_S15ROM_A::VALUE1
464    }
465    #[doc = "ROM functionality is configured for sectors 14+15."]
466    #[inline(always)]
467    pub fn is_value2(&self) -> bool {
468        *self == S14_S15ROM_A::VALUE2
469    }
470}
471impl R {
472    #[doc = "Bit 0 - Sector 0 Locked Forever by User 2"]
473    #[inline(always)]
474    pub fn s0rom(&self) -> S0ROM_R {
475        S0ROM_R::new((self.bits & 1) != 0)
476    }
477    #[doc = "Bit 1 - Sector 1 Locked Forever by User 2"]
478    #[inline(always)]
479    pub fn s1rom(&self) -> S1ROM_R {
480        S1ROM_R::new(((self.bits >> 1) & 1) != 0)
481    }
482    #[doc = "Bit 2 - Sector 2 Locked Forever by User 2"]
483    #[inline(always)]
484    pub fn s2rom(&self) -> S2ROM_R {
485        S2ROM_R::new(((self.bits >> 2) & 1) != 0)
486    }
487    #[doc = "Bit 3 - Sector 3 Locked Forever by User 2"]
488    #[inline(always)]
489    pub fn s3rom(&self) -> S3ROM_R {
490        S3ROM_R::new(((self.bits >> 3) & 1) != 0)
491    }
492    #[doc = "Bit 4 - Sector 4 Locked Forever by User 2"]
493    #[inline(always)]
494    pub fn s4rom(&self) -> S4ROM_R {
495        S4ROM_R::new(((self.bits >> 4) & 1) != 0)
496    }
497    #[doc = "Bit 5 - Sector 5 Locked Forever by User 2"]
498    #[inline(always)]
499    pub fn s5rom(&self) -> S5ROM_R {
500        S5ROM_R::new(((self.bits >> 5) & 1) != 0)
501    }
502    #[doc = "Bit 6 - Sector 6 Locked Forever by User 2"]
503    #[inline(always)]
504    pub fn s6rom(&self) -> S6ROM_R {
505        S6ROM_R::new(((self.bits >> 6) & 1) != 0)
506    }
507    #[doc = "Bit 7 - Sector 7 Locked Forever by User 2"]
508    #[inline(always)]
509    pub fn s7rom(&self) -> S7ROM_R {
510        S7ROM_R::new(((self.bits >> 7) & 1) != 0)
511    }
512    #[doc = "Bit 8 - Sector 8 Locked Forever by User 2"]
513    #[inline(always)]
514    pub fn s8rom(&self) -> S8ROM_R {
515        S8ROM_R::new(((self.bits >> 8) & 1) != 0)
516    }
517    #[doc = "Bit 9 - Sector 9 Locked Forever by User 2"]
518    #[inline(always)]
519    pub fn s9rom(&self) -> S9ROM_R {
520        S9ROM_R::new(((self.bits >> 9) & 1) != 0)
521    }
522    #[doc = "Bit 10 - Sectors 10 and 11 Locked Forever by User 2"]
523    #[inline(always)]
524    pub fn s10_s11rom(&self) -> S10_S11ROM_R {
525        S10_S11ROM_R::new(((self.bits >> 10) & 1) != 0)
526    }
527    #[doc = "Bit 11 - Sectors 12 and 13 Locked Forever by User 2"]
528    #[inline(always)]
529    pub fn s12_s13rom(&self) -> S12_S13ROM_R {
530        S12_S13ROM_R::new(((self.bits >> 11) & 1) != 0)
531    }
532    #[doc = "Bit 12 - Sectors 14 and 15 Locked Forever by User 2"]
533    #[inline(always)]
534    pub fn s14_s15rom(&self) -> S14_S15ROM_R {
535        S14_S15ROM_R::new(((self.bits >> 12) & 1) != 0)
536    }
537}
538#[doc = "Flash Protection Configuration Register User 2\n\nYou can [`read`](crate::Reg::read) this register and get [`procon2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
539pub struct PROCON2_SPEC;
540impl crate::RegisterSpec for PROCON2_SPEC {
541    type Ux = u32;
542}
543#[doc = "`read()` method returns [`procon2::R`](R) reader structure"]
544impl crate::Readable for PROCON2_SPEC {}
545#[doc = "`reset()` method sets PROCON2 to value 0"]
546impl crate::Resettable for PROCON2_SPEC {
547    const RESET_VALUE: u32 = 0;
548}