ra2e1/dbg/
dbgstopcr.rs

1#[doc = "Register `DBGSTOPCR` reader"]
2pub struct R(crate::R<DBGSTOPCR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DBGSTOPCR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DBGSTOPCR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DBGSTOPCR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DBGSTOPCR` writer"]
17pub struct W(crate::W<DBGSTOPCR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DBGSTOPCR_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<DBGSTOPCR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DBGSTOPCR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DBGSTOP_IWDT` reader - Mask bit for IWDT reset/interrupt"]
38pub type DBGSTOP_IWDT_R = crate::BitReader<DBGSTOP_IWDT_A>;
39#[doc = "Mask bit for IWDT reset/interrupt\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum DBGSTOP_IWDT_A {
42    #[doc = "0: Enable IWDT reset/interrupt"]
43    _0 = 0,
44    #[doc = "1: Mask IWDT reset/interrupt and stop IWDT count when CPU is in OCD break mode"]
45    _1 = 1,
46}
47impl From<DBGSTOP_IWDT_A> for bool {
48    #[inline(always)]
49    fn from(variant: DBGSTOP_IWDT_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl DBGSTOP_IWDT_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> DBGSTOP_IWDT_A {
57        match self.bits {
58            false => DBGSTOP_IWDT_A::_0,
59            true => DBGSTOP_IWDT_A::_1,
60        }
61    }
62    #[doc = "Checks if the value of the field is `_0`"]
63    #[inline(always)]
64    pub fn is_0(&self) -> bool {
65        *self == DBGSTOP_IWDT_A::_0
66    }
67    #[doc = "Checks if the value of the field is `_1`"]
68    #[inline(always)]
69    pub fn is_1(&self) -> bool {
70        *self == DBGSTOP_IWDT_A::_1
71    }
72}
73#[doc = "Field `DBGSTOP_IWDT` writer - Mask bit for IWDT reset/interrupt"]
74pub type DBGSTOP_IWDT_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, DBGSTOPCR_SPEC, DBGSTOP_IWDT_A, O>;
76impl<'a, const O: u8> DBGSTOP_IWDT_W<'a, O> {
77    #[doc = "Enable IWDT reset/interrupt"]
78    #[inline(always)]
79    pub fn _0(self) -> &'a mut W {
80        self.variant(DBGSTOP_IWDT_A::_0)
81    }
82    #[doc = "Mask IWDT reset/interrupt and stop IWDT count when CPU is in OCD break mode"]
83    #[inline(always)]
84    pub fn _1(self) -> &'a mut W {
85        self.variant(DBGSTOP_IWDT_A::_1)
86    }
87}
88#[doc = "Field `DBGSTOP_WDT` reader - Mask bit for WDT reset/interrupt"]
89pub type DBGSTOP_WDT_R = crate::BitReader<DBGSTOP_WDT_A>;
90#[doc = "Mask bit for WDT reset/interrupt\n\nValue on reset: 1"]
91#[derive(Clone, Copy, Debug, PartialEq, Eq)]
92pub enum DBGSTOP_WDT_A {
93    #[doc = "0: Enable WDT reset/interrupt"]
94    _0 = 0,
95    #[doc = "1: Mask WDT reset/interrupt and stop WDT count when CPU is in OCD break mode"]
96    _1 = 1,
97}
98impl From<DBGSTOP_WDT_A> for bool {
99    #[inline(always)]
100    fn from(variant: DBGSTOP_WDT_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl DBGSTOP_WDT_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> DBGSTOP_WDT_A {
108        match self.bits {
109            false => DBGSTOP_WDT_A::_0,
110            true => DBGSTOP_WDT_A::_1,
111        }
112    }
113    #[doc = "Checks if the value of the field is `_0`"]
114    #[inline(always)]
115    pub fn is_0(&self) -> bool {
116        *self == DBGSTOP_WDT_A::_0
117    }
118    #[doc = "Checks if the value of the field is `_1`"]
119    #[inline(always)]
120    pub fn is_1(&self) -> bool {
121        *self == DBGSTOP_WDT_A::_1
122    }
123}
124#[doc = "Field `DBGSTOP_WDT` writer - Mask bit for WDT reset/interrupt"]
125pub type DBGSTOP_WDT_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, DBGSTOPCR_SPEC, DBGSTOP_WDT_A, O>;
127impl<'a, const O: u8> DBGSTOP_WDT_W<'a, O> {
128    #[doc = "Enable WDT reset/interrupt"]
129    #[inline(always)]
130    pub fn _0(self) -> &'a mut W {
131        self.variant(DBGSTOP_WDT_A::_0)
132    }
133    #[doc = "Mask WDT reset/interrupt and stop WDT count when CPU is in OCD break mode"]
134    #[inline(always)]
135    pub fn _1(self) -> &'a mut W {
136        self.variant(DBGSTOP_WDT_A::_1)
137    }
138}
139#[doc = "Field `DBGSTOP_LVD0` reader - Mask bit for LVD0 reset"]
140pub type DBGSTOP_LVD0_R = crate::BitReader<DBGSTOP_LVD0_A>;
141#[doc = "Mask bit for LVD0 reset\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143pub enum DBGSTOP_LVD0_A {
144    #[doc = "0: Enable LVD0 reset"]
145    _0 = 0,
146    #[doc = "1: Mask LVD0 reset"]
147    _1 = 1,
148}
149impl From<DBGSTOP_LVD0_A> for bool {
150    #[inline(always)]
151    fn from(variant: DBGSTOP_LVD0_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl DBGSTOP_LVD0_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> DBGSTOP_LVD0_A {
159        match self.bits {
160            false => DBGSTOP_LVD0_A::_0,
161            true => DBGSTOP_LVD0_A::_1,
162        }
163    }
164    #[doc = "Checks if the value of the field is `_0`"]
165    #[inline(always)]
166    pub fn is_0(&self) -> bool {
167        *self == DBGSTOP_LVD0_A::_0
168    }
169    #[doc = "Checks if the value of the field is `_1`"]
170    #[inline(always)]
171    pub fn is_1(&self) -> bool {
172        *self == DBGSTOP_LVD0_A::_1
173    }
174}
175#[doc = "Field `DBGSTOP_LVD0` writer - Mask bit for LVD0 reset"]
176pub type DBGSTOP_LVD0_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, DBGSTOPCR_SPEC, DBGSTOP_LVD0_A, O>;
178impl<'a, const O: u8> DBGSTOP_LVD0_W<'a, O> {
179    #[doc = "Enable LVD0 reset"]
180    #[inline(always)]
181    pub fn _0(self) -> &'a mut W {
182        self.variant(DBGSTOP_LVD0_A::_0)
183    }
184    #[doc = "Mask LVD0 reset"]
185    #[inline(always)]
186    pub fn _1(self) -> &'a mut W {
187        self.variant(DBGSTOP_LVD0_A::_1)
188    }
189}
190#[doc = "Field `DBGSTOP_LVD1` reader - Mask bit for LVD1 reset/interrupt"]
191pub type DBGSTOP_LVD1_R = crate::BitReader<DBGSTOP_LVD1_A>;
192#[doc = "Mask bit for LVD1 reset/interrupt\n\nValue on reset: 0"]
193#[derive(Clone, Copy, Debug, PartialEq, Eq)]
194pub enum DBGSTOP_LVD1_A {
195    #[doc = "0: Enable LVD1 reset/interrupt"]
196    _0 = 0,
197    #[doc = "1: Mask LVD1 reset/interrupt"]
198    _1 = 1,
199}
200impl From<DBGSTOP_LVD1_A> for bool {
201    #[inline(always)]
202    fn from(variant: DBGSTOP_LVD1_A) -> Self {
203        variant as u8 != 0
204    }
205}
206impl DBGSTOP_LVD1_R {
207    #[doc = "Get enumerated values variant"]
208    #[inline(always)]
209    pub fn variant(&self) -> DBGSTOP_LVD1_A {
210        match self.bits {
211            false => DBGSTOP_LVD1_A::_0,
212            true => DBGSTOP_LVD1_A::_1,
213        }
214    }
215    #[doc = "Checks if the value of the field is `_0`"]
216    #[inline(always)]
217    pub fn is_0(&self) -> bool {
218        *self == DBGSTOP_LVD1_A::_0
219    }
220    #[doc = "Checks if the value of the field is `_1`"]
221    #[inline(always)]
222    pub fn is_1(&self) -> bool {
223        *self == DBGSTOP_LVD1_A::_1
224    }
225}
226#[doc = "Field `DBGSTOP_LVD1` writer - Mask bit for LVD1 reset/interrupt"]
227pub type DBGSTOP_LVD1_W<'a, const O: u8> =
228    crate::BitWriter<'a, u32, DBGSTOPCR_SPEC, DBGSTOP_LVD1_A, O>;
229impl<'a, const O: u8> DBGSTOP_LVD1_W<'a, O> {
230    #[doc = "Enable LVD1 reset/interrupt"]
231    #[inline(always)]
232    pub fn _0(self) -> &'a mut W {
233        self.variant(DBGSTOP_LVD1_A::_0)
234    }
235    #[doc = "Mask LVD1 reset/interrupt"]
236    #[inline(always)]
237    pub fn _1(self) -> &'a mut W {
238        self.variant(DBGSTOP_LVD1_A::_1)
239    }
240}
241#[doc = "Field `DBGSTOP_LVD2` reader - Mask bit for LVD2 reset/interrupt"]
242pub type DBGSTOP_LVD2_R = crate::BitReader<DBGSTOP_LVD2_A>;
243#[doc = "Mask bit for LVD2 reset/interrupt\n\nValue on reset: 0"]
244#[derive(Clone, Copy, Debug, PartialEq, Eq)]
245pub enum DBGSTOP_LVD2_A {
246    #[doc = "0: Enable LVD2 reset/interrupt"]
247    _0 = 0,
248    #[doc = "1: Mask LVD2 reset/interrupt"]
249    _1 = 1,
250}
251impl From<DBGSTOP_LVD2_A> for bool {
252    #[inline(always)]
253    fn from(variant: DBGSTOP_LVD2_A) -> Self {
254        variant as u8 != 0
255    }
256}
257impl DBGSTOP_LVD2_R {
258    #[doc = "Get enumerated values variant"]
259    #[inline(always)]
260    pub fn variant(&self) -> DBGSTOP_LVD2_A {
261        match self.bits {
262            false => DBGSTOP_LVD2_A::_0,
263            true => DBGSTOP_LVD2_A::_1,
264        }
265    }
266    #[doc = "Checks if the value of the field is `_0`"]
267    #[inline(always)]
268    pub fn is_0(&self) -> bool {
269        *self == DBGSTOP_LVD2_A::_0
270    }
271    #[doc = "Checks if the value of the field is `_1`"]
272    #[inline(always)]
273    pub fn is_1(&self) -> bool {
274        *self == DBGSTOP_LVD2_A::_1
275    }
276}
277#[doc = "Field `DBGSTOP_LVD2` writer - Mask bit for LVD2 reset/interrupt"]
278pub type DBGSTOP_LVD2_W<'a, const O: u8> =
279    crate::BitWriter<'a, u32, DBGSTOPCR_SPEC, DBGSTOP_LVD2_A, O>;
280impl<'a, const O: u8> DBGSTOP_LVD2_W<'a, O> {
281    #[doc = "Enable LVD2 reset/interrupt"]
282    #[inline(always)]
283    pub fn _0(self) -> &'a mut W {
284        self.variant(DBGSTOP_LVD2_A::_0)
285    }
286    #[doc = "Mask LVD2 reset/interrupt"]
287    #[inline(always)]
288    pub fn _1(self) -> &'a mut W {
289        self.variant(DBGSTOP_LVD2_A::_1)
290    }
291}
292#[doc = "Field `DBGSTOP_RPER` reader - Mask bit for SRAM parity error reset/interrupt"]
293pub type DBGSTOP_RPER_R = crate::BitReader<DBGSTOP_RPER_A>;
294#[doc = "Mask bit for SRAM parity error reset/interrupt\n\nValue on reset: 0"]
295#[derive(Clone, Copy, Debug, PartialEq, Eq)]
296pub enum DBGSTOP_RPER_A {
297    #[doc = "0: Enable SRAM parity error reset/interrupt"]
298    _0 = 0,
299    #[doc = "1: Mask SRAM parity error reset/interrupt"]
300    _1 = 1,
301}
302impl From<DBGSTOP_RPER_A> for bool {
303    #[inline(always)]
304    fn from(variant: DBGSTOP_RPER_A) -> Self {
305        variant as u8 != 0
306    }
307}
308impl DBGSTOP_RPER_R {
309    #[doc = "Get enumerated values variant"]
310    #[inline(always)]
311    pub fn variant(&self) -> DBGSTOP_RPER_A {
312        match self.bits {
313            false => DBGSTOP_RPER_A::_0,
314            true => DBGSTOP_RPER_A::_1,
315        }
316    }
317    #[doc = "Checks if the value of the field is `_0`"]
318    #[inline(always)]
319    pub fn is_0(&self) -> bool {
320        *self == DBGSTOP_RPER_A::_0
321    }
322    #[doc = "Checks if the value of the field is `_1`"]
323    #[inline(always)]
324    pub fn is_1(&self) -> bool {
325        *self == DBGSTOP_RPER_A::_1
326    }
327}
328#[doc = "Field `DBGSTOP_RPER` writer - Mask bit for SRAM parity error reset/interrupt"]
329pub type DBGSTOP_RPER_W<'a, const O: u8> =
330    crate::BitWriter<'a, u32, DBGSTOPCR_SPEC, DBGSTOP_RPER_A, O>;
331impl<'a, const O: u8> DBGSTOP_RPER_W<'a, O> {
332    #[doc = "Enable SRAM parity error reset/interrupt"]
333    #[inline(always)]
334    pub fn _0(self) -> &'a mut W {
335        self.variant(DBGSTOP_RPER_A::_0)
336    }
337    #[doc = "Mask SRAM parity error reset/interrupt"]
338    #[inline(always)]
339    pub fn _1(self) -> &'a mut W {
340        self.variant(DBGSTOP_RPER_A::_1)
341    }
342}
343impl R {
344    #[doc = "Bit 0 - Mask bit for IWDT reset/interrupt"]
345    #[inline(always)]
346    pub fn dbgstop_iwdt(&self) -> DBGSTOP_IWDT_R {
347        DBGSTOP_IWDT_R::new((self.bits & 1) != 0)
348    }
349    #[doc = "Bit 1 - Mask bit for WDT reset/interrupt"]
350    #[inline(always)]
351    pub fn dbgstop_wdt(&self) -> DBGSTOP_WDT_R {
352        DBGSTOP_WDT_R::new(((self.bits >> 1) & 1) != 0)
353    }
354    #[doc = "Bit 16 - Mask bit for LVD0 reset"]
355    #[inline(always)]
356    pub fn dbgstop_lvd0(&self) -> DBGSTOP_LVD0_R {
357        DBGSTOP_LVD0_R::new(((self.bits >> 16) & 1) != 0)
358    }
359    #[doc = "Bit 17 - Mask bit for LVD1 reset/interrupt"]
360    #[inline(always)]
361    pub fn dbgstop_lvd1(&self) -> DBGSTOP_LVD1_R {
362        DBGSTOP_LVD1_R::new(((self.bits >> 17) & 1) != 0)
363    }
364    #[doc = "Bit 18 - Mask bit for LVD2 reset/interrupt"]
365    #[inline(always)]
366    pub fn dbgstop_lvd2(&self) -> DBGSTOP_LVD2_R {
367        DBGSTOP_LVD2_R::new(((self.bits >> 18) & 1) != 0)
368    }
369    #[doc = "Bit 24 - Mask bit for SRAM parity error reset/interrupt"]
370    #[inline(always)]
371    pub fn dbgstop_rper(&self) -> DBGSTOP_RPER_R {
372        DBGSTOP_RPER_R::new(((self.bits >> 24) & 1) != 0)
373    }
374}
375impl W {
376    #[doc = "Bit 0 - Mask bit for IWDT reset/interrupt"]
377    #[inline(always)]
378    #[must_use]
379    pub fn dbgstop_iwdt(&mut self) -> DBGSTOP_IWDT_W<0> {
380        DBGSTOP_IWDT_W::new(self)
381    }
382    #[doc = "Bit 1 - Mask bit for WDT reset/interrupt"]
383    #[inline(always)]
384    #[must_use]
385    pub fn dbgstop_wdt(&mut self) -> DBGSTOP_WDT_W<1> {
386        DBGSTOP_WDT_W::new(self)
387    }
388    #[doc = "Bit 16 - Mask bit for LVD0 reset"]
389    #[inline(always)]
390    #[must_use]
391    pub fn dbgstop_lvd0(&mut self) -> DBGSTOP_LVD0_W<16> {
392        DBGSTOP_LVD0_W::new(self)
393    }
394    #[doc = "Bit 17 - Mask bit for LVD1 reset/interrupt"]
395    #[inline(always)]
396    #[must_use]
397    pub fn dbgstop_lvd1(&mut self) -> DBGSTOP_LVD1_W<17> {
398        DBGSTOP_LVD1_W::new(self)
399    }
400    #[doc = "Bit 18 - Mask bit for LVD2 reset/interrupt"]
401    #[inline(always)]
402    #[must_use]
403    pub fn dbgstop_lvd2(&mut self) -> DBGSTOP_LVD2_W<18> {
404        DBGSTOP_LVD2_W::new(self)
405    }
406    #[doc = "Bit 24 - Mask bit for SRAM parity error reset/interrupt"]
407    #[inline(always)]
408    #[must_use]
409    pub fn dbgstop_rper(&mut self) -> DBGSTOP_RPER_W<24> {
410        DBGSTOP_RPER_W::new(self)
411    }
412    #[doc = "Writes raw bits to the register."]
413    #[inline(always)]
414    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
415        self.0.bits(bits);
416        self
417    }
418}
419#[doc = "Debug Stop 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 [dbgstopcr](index.html) module"]
420pub struct DBGSTOPCR_SPEC;
421impl crate::RegisterSpec for DBGSTOPCR_SPEC {
422    type Ux = u32;
423}
424#[doc = "`read()` method returns [dbgstopcr::R](R) reader structure"]
425impl crate::Readable for DBGSTOPCR_SPEC {
426    type Reader = R;
427}
428#[doc = "`write(|w| ..)` method takes [dbgstopcr::W](W) writer structure"]
429impl crate::Writable for DBGSTOPCR_SPEC {
430    type Writer = W;
431    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
432    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
433}
434#[doc = "`reset()` method sets DBGSTOPCR to value 0x03"]
435impl crate::Resettable for DBGSTOPCR_SPEC {
436    const RESET_VALUE: Self::Ux = 0x03;
437}