mimxrt685s_pac/sysctl0/
dbg_features.rs

1#[doc = "Register `DBG_FEATURES` reader"]
2pub type R = crate::R<DbgFeaturesSpec>;
3#[doc = "Register `DBG_FEATURES` writer"]
4pub type W = crate::W<DbgFeaturesSpec>;
5#[doc = "CM33 Debug Enable Control\n\nValue on reset: 1"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8#[repr(u8)]
9pub enum Dbgen {
10    #[doc = "0: enabled"]
11    Enabled = 0,
12    #[doc = "1: disabled"]
13    Disbaled1 = 1,
14    #[doc = "2: disabled"]
15    Disabled2 = 2,
16    #[doc = "3: disabled"]
17    Disabled3 = 3,
18}
19impl From<Dbgen> for u8 {
20    #[inline(always)]
21    fn from(variant: Dbgen) -> Self {
22        variant as _
23    }
24}
25impl crate::FieldSpec for Dbgen {
26    type Ux = u8;
27}
28impl crate::IsEnum for Dbgen {}
29#[doc = "Field `DBGEN` reader - CM33 Debug Enable Control"]
30pub type DbgenR = crate::FieldReader<Dbgen>;
31impl DbgenR {
32    #[doc = "Get enumerated values variant"]
33    #[inline(always)]
34    pub const fn variant(&self) -> Dbgen {
35        match self.bits {
36            0 => Dbgen::Enabled,
37            1 => Dbgen::Disbaled1,
38            2 => Dbgen::Disabled2,
39            3 => Dbgen::Disabled3,
40            _ => unreachable!(),
41        }
42    }
43    #[doc = "enabled"]
44    #[inline(always)]
45    pub fn is_enabled(&self) -> bool {
46        *self == Dbgen::Enabled
47    }
48    #[doc = "disabled"]
49    #[inline(always)]
50    pub fn is_disbaled1(&self) -> bool {
51        *self == Dbgen::Disbaled1
52    }
53    #[doc = "disabled"]
54    #[inline(always)]
55    pub fn is_disabled2(&self) -> bool {
56        *self == Dbgen::Disabled2
57    }
58    #[doc = "disabled"]
59    #[inline(always)]
60    pub fn is_disabled3(&self) -> bool {
61        *self == Dbgen::Disabled3
62    }
63}
64#[doc = "Field `DBGEN` writer - CM33 Debug Enable Control"]
65pub type DbgenW<'a, REG> = crate::FieldWriter<'a, REG, 2, Dbgen, crate::Safe>;
66impl<'a, REG> DbgenW<'a, REG>
67where
68    REG: crate::Writable + crate::RegisterSpec,
69    REG::Ux: From<u8>,
70{
71    #[doc = "enabled"]
72    #[inline(always)]
73    pub fn enabled(self) -> &'a mut crate::W<REG> {
74        self.variant(Dbgen::Enabled)
75    }
76    #[doc = "disabled"]
77    #[inline(always)]
78    pub fn disbaled1(self) -> &'a mut crate::W<REG> {
79        self.variant(Dbgen::Disbaled1)
80    }
81    #[doc = "disabled"]
82    #[inline(always)]
83    pub fn disabled2(self) -> &'a mut crate::W<REG> {
84        self.variant(Dbgen::Disabled2)
85    }
86    #[doc = "disabled"]
87    #[inline(always)]
88    pub fn disabled3(self) -> &'a mut crate::W<REG> {
89        self.variant(Dbgen::Disabled3)
90    }
91}
92#[doc = "CM33 NID Enable Control\n\nValue on reset: 1"]
93#[cfg_attr(feature = "defmt", derive(defmt::Format))]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95#[repr(u8)]
96pub enum Niden {
97    #[doc = "0: enabled"]
98    Enabled = 0,
99    #[doc = "1: disabled"]
100    Disbaled1 = 1,
101    #[doc = "2: disabled"]
102    Disabled2 = 2,
103    #[doc = "3: disabled"]
104    Disabled3 = 3,
105}
106impl From<Niden> for u8 {
107    #[inline(always)]
108    fn from(variant: Niden) -> Self {
109        variant as _
110    }
111}
112impl crate::FieldSpec for Niden {
113    type Ux = u8;
114}
115impl crate::IsEnum for Niden {}
116#[doc = "Field `NIDEN` reader - CM33 NID Enable Control"]
117pub type NidenR = crate::FieldReader<Niden>;
118impl NidenR {
119    #[doc = "Get enumerated values variant"]
120    #[inline(always)]
121    pub const fn variant(&self) -> Niden {
122        match self.bits {
123            0 => Niden::Enabled,
124            1 => Niden::Disbaled1,
125            2 => Niden::Disabled2,
126            3 => Niden::Disabled3,
127            _ => unreachable!(),
128        }
129    }
130    #[doc = "enabled"]
131    #[inline(always)]
132    pub fn is_enabled(&self) -> bool {
133        *self == Niden::Enabled
134    }
135    #[doc = "disabled"]
136    #[inline(always)]
137    pub fn is_disbaled1(&self) -> bool {
138        *self == Niden::Disbaled1
139    }
140    #[doc = "disabled"]
141    #[inline(always)]
142    pub fn is_disabled2(&self) -> bool {
143        *self == Niden::Disabled2
144    }
145    #[doc = "disabled"]
146    #[inline(always)]
147    pub fn is_disabled3(&self) -> bool {
148        *self == Niden::Disabled3
149    }
150}
151#[doc = "Field `NIDEN` writer - CM33 NID Enable Control"]
152pub type NidenW<'a, REG> = crate::FieldWriter<'a, REG, 2, Niden, crate::Safe>;
153impl<'a, REG> NidenW<'a, REG>
154where
155    REG: crate::Writable + crate::RegisterSpec,
156    REG::Ux: From<u8>,
157{
158    #[doc = "enabled"]
159    #[inline(always)]
160    pub fn enabled(self) -> &'a mut crate::W<REG> {
161        self.variant(Niden::Enabled)
162    }
163    #[doc = "disabled"]
164    #[inline(always)]
165    pub fn disbaled1(self) -> &'a mut crate::W<REG> {
166        self.variant(Niden::Disbaled1)
167    }
168    #[doc = "disabled"]
169    #[inline(always)]
170    pub fn disabled2(self) -> &'a mut crate::W<REG> {
171        self.variant(Niden::Disabled2)
172    }
173    #[doc = "disabled"]
174    #[inline(always)]
175    pub fn disabled3(self) -> &'a mut crate::W<REG> {
176        self.variant(Niden::Disabled3)
177    }
178}
179#[doc = "CM33 SPID Enable Control\n\nValue on reset: 1"]
180#[cfg_attr(feature = "defmt", derive(defmt::Format))]
181#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182#[repr(u8)]
183pub enum Spiden {
184    #[doc = "0: enabled"]
185    Enabled = 0,
186    #[doc = "1: disabled"]
187    Disbaled1 = 1,
188    #[doc = "2: disabled"]
189    Disabled2 = 2,
190    #[doc = "3: disabled"]
191    Disabled3 = 3,
192}
193impl From<Spiden> for u8 {
194    #[inline(always)]
195    fn from(variant: Spiden) -> Self {
196        variant as _
197    }
198}
199impl crate::FieldSpec for Spiden {
200    type Ux = u8;
201}
202impl crate::IsEnum for Spiden {}
203#[doc = "Field `SPIDEN` reader - CM33 SPID Enable Control"]
204pub type SpidenR = crate::FieldReader<Spiden>;
205impl SpidenR {
206    #[doc = "Get enumerated values variant"]
207    #[inline(always)]
208    pub const fn variant(&self) -> Spiden {
209        match self.bits {
210            0 => Spiden::Enabled,
211            1 => Spiden::Disbaled1,
212            2 => Spiden::Disabled2,
213            3 => Spiden::Disabled3,
214            _ => unreachable!(),
215        }
216    }
217    #[doc = "enabled"]
218    #[inline(always)]
219    pub fn is_enabled(&self) -> bool {
220        *self == Spiden::Enabled
221    }
222    #[doc = "disabled"]
223    #[inline(always)]
224    pub fn is_disbaled1(&self) -> bool {
225        *self == Spiden::Disbaled1
226    }
227    #[doc = "disabled"]
228    #[inline(always)]
229    pub fn is_disabled2(&self) -> bool {
230        *self == Spiden::Disabled2
231    }
232    #[doc = "disabled"]
233    #[inline(always)]
234    pub fn is_disabled3(&self) -> bool {
235        *self == Spiden::Disabled3
236    }
237}
238#[doc = "Field `SPIDEN` writer - CM33 SPID Enable Control"]
239pub type SpidenW<'a, REG> = crate::FieldWriter<'a, REG, 2, Spiden, crate::Safe>;
240impl<'a, REG> SpidenW<'a, REG>
241where
242    REG: crate::Writable + crate::RegisterSpec,
243    REG::Ux: From<u8>,
244{
245    #[doc = "enabled"]
246    #[inline(always)]
247    pub fn enabled(self) -> &'a mut crate::W<REG> {
248        self.variant(Spiden::Enabled)
249    }
250    #[doc = "disabled"]
251    #[inline(always)]
252    pub fn disbaled1(self) -> &'a mut crate::W<REG> {
253        self.variant(Spiden::Disbaled1)
254    }
255    #[doc = "disabled"]
256    #[inline(always)]
257    pub fn disabled2(self) -> &'a mut crate::W<REG> {
258        self.variant(Spiden::Disabled2)
259    }
260    #[doc = "disabled"]
261    #[inline(always)]
262    pub fn disabled3(self) -> &'a mut crate::W<REG> {
263        self.variant(Spiden::Disabled3)
264    }
265}
266#[doc = "CM33 SPNIDEN Enable Control\n\nValue on reset: 1"]
267#[cfg_attr(feature = "defmt", derive(defmt::Format))]
268#[derive(Clone, Copy, Debug, PartialEq, Eq)]
269#[repr(u8)]
270pub enum Spniden {
271    #[doc = "0: enabled"]
272    Enabled = 0,
273    #[doc = "1: disabled"]
274    Disbaled1 = 1,
275    #[doc = "2: disabled"]
276    Disabled2 = 2,
277    #[doc = "3: disabled"]
278    Disabled3 = 3,
279}
280impl From<Spniden> for u8 {
281    #[inline(always)]
282    fn from(variant: Spniden) -> Self {
283        variant as _
284    }
285}
286impl crate::FieldSpec for Spniden {
287    type Ux = u8;
288}
289impl crate::IsEnum for Spniden {}
290#[doc = "Field `SPNIDEN` reader - CM33 SPNIDEN Enable Control"]
291pub type SpnidenR = crate::FieldReader<Spniden>;
292impl SpnidenR {
293    #[doc = "Get enumerated values variant"]
294    #[inline(always)]
295    pub const fn variant(&self) -> Spniden {
296        match self.bits {
297            0 => Spniden::Enabled,
298            1 => Spniden::Disbaled1,
299            2 => Spniden::Disabled2,
300            3 => Spniden::Disabled3,
301            _ => unreachable!(),
302        }
303    }
304    #[doc = "enabled"]
305    #[inline(always)]
306    pub fn is_enabled(&self) -> bool {
307        *self == Spniden::Enabled
308    }
309    #[doc = "disabled"]
310    #[inline(always)]
311    pub fn is_disbaled1(&self) -> bool {
312        *self == Spniden::Disbaled1
313    }
314    #[doc = "disabled"]
315    #[inline(always)]
316    pub fn is_disabled2(&self) -> bool {
317        *self == Spniden::Disabled2
318    }
319    #[doc = "disabled"]
320    #[inline(always)]
321    pub fn is_disabled3(&self) -> bool {
322        *self == Spniden::Disabled3
323    }
324}
325#[doc = "Field `SPNIDEN` writer - CM33 SPNIDEN Enable Control"]
326pub type SpnidenW<'a, REG> = crate::FieldWriter<'a, REG, 2, Spniden, crate::Safe>;
327impl<'a, REG> SpnidenW<'a, REG>
328where
329    REG: crate::Writable + crate::RegisterSpec,
330    REG::Ux: From<u8>,
331{
332    #[doc = "enabled"]
333    #[inline(always)]
334    pub fn enabled(self) -> &'a mut crate::W<REG> {
335        self.variant(Spniden::Enabled)
336    }
337    #[doc = "disabled"]
338    #[inline(always)]
339    pub fn disbaled1(self) -> &'a mut crate::W<REG> {
340        self.variant(Spniden::Disbaled1)
341    }
342    #[doc = "disabled"]
343    #[inline(always)]
344    pub fn disabled2(self) -> &'a mut crate::W<REG> {
345        self.variant(Spniden::Disabled2)
346    }
347    #[doc = "disabled"]
348    #[inline(always)]
349    pub fn disabled3(self) -> &'a mut crate::W<REG> {
350        self.variant(Spniden::Disabled3)
351    }
352}
353impl R {
354    #[doc = "Bits 0:1 - CM33 Debug Enable Control"]
355    #[inline(always)]
356    pub fn dbgen(&self) -> DbgenR {
357        DbgenR::new((self.bits & 3) as u8)
358    }
359    #[doc = "Bits 2:3 - CM33 NID Enable Control"]
360    #[inline(always)]
361    pub fn niden(&self) -> NidenR {
362        NidenR::new(((self.bits >> 2) & 3) as u8)
363    }
364    #[doc = "Bits 4:5 - CM33 SPID Enable Control"]
365    #[inline(always)]
366    pub fn spiden(&self) -> SpidenR {
367        SpidenR::new(((self.bits >> 4) & 3) as u8)
368    }
369    #[doc = "Bits 6:7 - CM33 SPNIDEN Enable Control"]
370    #[inline(always)]
371    pub fn spniden(&self) -> SpnidenR {
372        SpnidenR::new(((self.bits >> 6) & 3) as u8)
373    }
374}
375#[cfg(feature = "debug")]
376impl core::fmt::Debug for R {
377    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
378        f.debug_struct("DBG_FEATURES")
379            .field("dbgen", &self.dbgen())
380            .field("niden", &self.niden())
381            .field("spiden", &self.spiden())
382            .field("spniden", &self.spniden())
383            .finish()
384    }
385}
386impl W {
387    #[doc = "Bits 0:1 - CM33 Debug Enable Control"]
388    #[inline(always)]
389    pub fn dbgen(&mut self) -> DbgenW<DbgFeaturesSpec> {
390        DbgenW::new(self, 0)
391    }
392    #[doc = "Bits 2:3 - CM33 NID Enable Control"]
393    #[inline(always)]
394    pub fn niden(&mut self) -> NidenW<DbgFeaturesSpec> {
395        NidenW::new(self, 2)
396    }
397    #[doc = "Bits 4:5 - CM33 SPID Enable Control"]
398    #[inline(always)]
399    pub fn spiden(&mut self) -> SpidenW<DbgFeaturesSpec> {
400        SpidenW::new(self, 4)
401    }
402    #[doc = "Bits 6:7 - CM33 SPNIDEN Enable Control"]
403    #[inline(always)]
404    pub fn spniden(&mut self) -> SpnidenW<DbgFeaturesSpec> {
405        SpnidenW::new(self, 6)
406    }
407}
408#[doc = "Debug features control for the CM33\n\nYou can [`read`](crate::Reg::read) this register and get [`dbg_features::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dbg_features::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
409pub struct DbgFeaturesSpec;
410impl crate::RegisterSpec for DbgFeaturesSpec {
411    type Ux = u32;
412}
413#[doc = "`read()` method returns [`dbg_features::R`](R) reader structure"]
414impl crate::Readable for DbgFeaturesSpec {}
415#[doc = "`write(|w| ..)` method takes [`dbg_features::W`](W) writer structure"]
416impl crate::Writable for DbgFeaturesSpec {
417    type Safety = crate::Unsafe;
418    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
419    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
420}
421#[doc = "`reset()` method sets DBG_FEATURES to value 0x55"]
422impl crate::Resettable for DbgFeaturesSpec {
423    const RESET_VALUE: u32 = 0x55;
424}