atsamd51g/system_control/
dfsr.rs

1#[doc = "Register `DFSR` reader"]
2pub type R = crate::R<DfsrSpec>;
3#[doc = "Register `DFSR` writer"]
4pub type W = crate::W<DfsrSpec>;
5#[doc = "Field `HALTED` reader - "]
6pub type HaltedR = crate::BitReader;
7#[doc = "Field `HALTED` writer - "]
8pub type HaltedW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `BKPT` reader - "]
10pub type BkptR = crate::BitReader;
11#[doc = "Field `BKPT` writer - "]
12pub type BkptW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `DWTTRAP` reader - "]
14pub type DwttrapR = crate::BitReader;
15#[doc = "Field `DWTTRAP` writer - "]
16pub type DwttrapW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `VCATCH` reader - "]
18pub type VcatchR = crate::BitReader;
19#[doc = "Field `VCATCH` writer - "]
20pub type VcatchW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `EXTERNAL` reader - "]
22pub type ExternalR = crate::BitReader;
23#[doc = "Field `EXTERNAL` writer - "]
24pub type ExternalW<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 0"]
27    #[inline(always)]
28    pub fn halted(&self) -> HaltedR {
29        HaltedR::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1"]
32    #[inline(always)]
33    pub fn bkpt(&self) -> BkptR {
34        BkptR::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 2"]
37    #[inline(always)]
38    pub fn dwttrap(&self) -> DwttrapR {
39        DwttrapR::new(((self.bits >> 2) & 1) != 0)
40    }
41    #[doc = "Bit 3"]
42    #[inline(always)]
43    pub fn vcatch(&self) -> VcatchR {
44        VcatchR::new(((self.bits >> 3) & 1) != 0)
45    }
46    #[doc = "Bit 4"]
47    #[inline(always)]
48    pub fn external(&self) -> ExternalR {
49        ExternalR::new(((self.bits >> 4) & 1) != 0)
50    }
51}
52impl W {
53    #[doc = "Bit 0"]
54    #[inline(always)]
55    #[must_use]
56    pub fn halted(&mut self) -> HaltedW<DfsrSpec> {
57        HaltedW::new(self, 0)
58    }
59    #[doc = "Bit 1"]
60    #[inline(always)]
61    #[must_use]
62    pub fn bkpt(&mut self) -> BkptW<DfsrSpec> {
63        BkptW::new(self, 1)
64    }
65    #[doc = "Bit 2"]
66    #[inline(always)]
67    #[must_use]
68    pub fn dwttrap(&mut self) -> DwttrapW<DfsrSpec> {
69        DwttrapW::new(self, 2)
70    }
71    #[doc = "Bit 3"]
72    #[inline(always)]
73    #[must_use]
74    pub fn vcatch(&mut self) -> VcatchW<DfsrSpec> {
75        VcatchW::new(self, 3)
76    }
77    #[doc = "Bit 4"]
78    #[inline(always)]
79    #[must_use]
80    pub fn external(&mut self) -> ExternalW<DfsrSpec> {
81        ExternalW::new(self, 4)
82    }
83}
84#[doc = "Debug Fault Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`dfsr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dfsr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
85pub struct DfsrSpec;
86impl crate::RegisterSpec for DfsrSpec {
87    type Ux = u32;
88}
89#[doc = "`read()` method returns [`dfsr::R`](R) reader structure"]
90impl crate::Readable for DfsrSpec {}
91#[doc = "`write(|w| ..)` method takes [`dfsr::W`](W) writer structure"]
92impl crate::Writable for DfsrSpec {
93    type Safety = crate::Unsafe;
94    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
95    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
96}
97#[doc = "`reset()` method sets DFSR to value 0"]
98impl crate::Resettable for DfsrSpec {
99    const RESET_VALUE: u32 = 0;
100}